Bug 157332 - EDITING: Page Style's margin and gutter settings modified on reload (steps in comment 8)
Summary: EDITING: Page Style's margin and gutter settings modified on reload (steps in...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.0.4 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Gutter-Margins
  Show dependency treegraph
 
Reported: 2023-09-19 15:30 UTC by dlphan
Modified: 2023-10-06 13:34 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
MyLeftPage Template, the file created from MyLeftPage Template and the Screenshot indicating the bug (147.43 KB, application/x-zip-compressed)
2023-09-19 15:30 UTC, dlphan
Details
Screenshot, editing your attached template and a new file. (173.21 KB, image/png)
2023-09-22 10:02 UTC, m_a_riosv
Details
MyLeftPage template, The new doc created from MyLeftPage template and the screenshot indicate the bug (86.68 KB, application/x-zip-compressed)
2023-09-25 20:04 UTC, dlphan
Details
TestMyLeft Page.odt file and the description (110.52 KB, application/x-zip-compressed)
2023-10-05 22:47 UTC, dlphan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dlphan 2023-09-19 15:30:35 UTC
Created attachment 189703 [details]
MyLeftPage Template, the file created from MyLeftPage Template and the Screenshot indicating the bug

I create a Page Style in a template for my left page with the margins top=bottom=left=right=.50" and with gutter= .88" and option of gutter margin on the right. 

After saving the template, when creating a new document from this template, the values saved are changed to new values. Specifically, the saved Page Style left margin would now be 0" and the right margin would be 1.38". In addition, the option of gutter margin is switched off in the new document that has been created from the template.

Please see attached for the template, the document created from the template and the screenshot showing the defined values for the margin and gutter option in the template and the changed values in the document created from the template.
Comment 1 m_a_riosv 2023-09-19 22:19:29 UTC
No problem here with
Version: 7.6.1.2 (X86_64) / LibreOffice Community
Build ID: f5defcebd022c5bc36bbb79be232cb6926d8f674
CPU threads: 16; OS: Windows 10.0 Build 22621; UI render: default; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL threaded

Please test in safe mode, Menu/Help/Restart in Safe Mode
Comment 2 dlphan 2023-09-21 03:03:03 UTC
Hi,

Please make sure you open MyLeft Page for edit in the new document created from the template. I tried safe mode and even uninstall and restall LO version 7.6.1.2 and still the problem persists. I also tried with 7.6 and 7.5 all changed the values of MyLeft Page (Page Style) in the new document to what I indicated. Please recheck. Thanks.
Comment 3 QA Administrators 2023-09-21 03:16:22 UTC Comment hidden (obsolete)
Comment 4 m_a_riosv 2023-09-22 10:02:06 UTC
Created attachment 189753 [details]
Screenshot, editing your attached template and a new file.

The screenshot it's from a different template than the attached.

My screenshot, editing your attached template and a new file.
Comment 5 dlphan 2023-09-25 20:04:21 UTC
Created attachment 189813 [details]
MyLeftPage template, The new doc created from MyLeftPage template and the screenshot indicate the bug

It seems that the template changes the values of the left margin, the right margin when the template was saved. Since the values had been changed then, creating the new document from the template always give the wrong margins and the wrong gutter options.
Comment 6 Stéphane Guillou (stragu) 2023-10-04 08:12:57 UTC
Even with the new attachment, I don't reproduce either.

The provided OTT in attachment 189813 [details] has the following page styles:
- Left Page: 2 cm left margin, 2 cm right margin, Gutter off
- MyLeft Page: 0 cm left margin, 3.51 cm right margin, Gutter off
The ODT created from the template has:
- Left Page: 2 cm left margin, 2 cm right margin, Gutter off
- MyLeft Page: 0 cm left margin, 3.51 cm right margin, Gutter off

I notice that in your screenshot, the page style on the right is "Untitled1". Are you sure you didn't confuse the two different page styles?

Can you please test again from the beginning:
1. Create template with 1 custom page style; save
2. Create document from template
3. Compare page styles

And if the issue actually exists, please give more information about your configuration, including the version info copied from Help > About LibreOffice.
Thank you!
Comment 7 dlphan 2023-10-05 22:43:14 UTC
Let me explain the bug again in clearer terms: Cannot save PageStyle correctly: Version test (7.6.1.2 on Windows 10)

I create MyLeft Page Style in document TestMyLeft Page with these values:
Left: 1.27cm
Right: 1.27cm
Option: Gutter on right side of page


After saving TestMyLeft Page, I close the file and then open it up again. When I check MyLeft Page Page Style, the margin values for Left, Right are changed to new values, and the option I choose for Gutter on the right is switched off.  After saving the Left, Right Margin become new value:

Left: 0.00cm
Right: 3.51cm
Option: Gutter on right side of page (switched off)

In other words, I can not save the Page Style with the original values:

Left: 1.27cm
Right: 1.27cm
Option: Gutter on right side of page.

Please create the problem by opening the file containing the Page Style MyLeft Page, change the values for Left, Right margins and change the Option to Gutter on the right as shown. Save the file and open it again to see the values changed as shown.
Comment 8 dlphan 2023-10-05 22:47:12 UTC
Created attachment 190054 [details]
TestMyLeft Page.odt file and the description

Let me explain the bug again in clearer terms: Cannot save PageStyle correctly: Version test (7.6.1.2 on Windows 10)

I create MyLeft Page Style in document TestMyLeft Page with these values:
Left: 1.27cm
Right: 1.27cm
Option: Gutter on right side of page


After saving TestMyLeft Page, I close the file and then open it up again. When I check MyLeft Page Page Style, the margin values for Left, Right are changed to new values, and the option I choose for Gutter on the right is switched off.  After saving the Left, Right Margin become new value:

Left: 0.00cm
Right: 3.51cm
Option: Gutter on right side of page (switched off)

In other words, I can not save the Page Style with the original values:

Left: 1.27cm
Right: 1.27cm
Option: Gutter on right side of page.

Please create the problem by opening the file containing the Page Style MyLeft Page, change the values for Left, Right margins and change the Option to Gutter on the right as shown. Save the file and open it again to see the values changed as shown. Please see attached file CannotSavePageStyleCorrectly.zip
Comment 9 QA Administrators 2023-10-06 03:20:14 UTC Comment hidden (obsolete)
Comment 10 m_a_riosv 2023-10-06 12:15:52 UTC
Seems it has some to do with 'Gutter on right side of page' and 'Margin: Gutter'
putting this last at zero, margins are not changed, but 'Gutter on right side of page' is disabled.

Version: 7.6.1.2 (X86_64) / LibreOffice Community
Build ID: f5defcebd022c5bc36bbb79be232cb6926d8f674
CPU threads: 16; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL threaded 

But something have changed with master, margins left and right doesn't change, but Gutter margin change to zero, and 'Gutter on right side of page' is disabled.

Please, @Miklos can you take a look.
Comment 11 Stéphane Guillou (stragu) 2023-10-06 13:30:55 UTC
Thank you for clarifying, I can now reproduce as described and I see that it has nothing to do with templates.

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: f95c3994f0b6a82a3bc2ddfb68822b74479ae185
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

The gutter width is added to the right margin width (and I guess removed from the left margin).

I can reproduce the behaviour since the "Gutter on right side" option appeared in LO 7.2 (I tested libreoffice-7.2.0.0.alpha1)

It seems like an obvious bug, but I admit I find the whole feature quite hard to understand. Regina had a good look at it previously, and Miklos implemented it, so copying them in for input.
Comment 12 Stéphane Guillou (stragu) 2023-10-06 13:34:08 UTC
(In reply to m.a.riosv from comment #10)
> But something have changed with master, margins left and right doesn't
> change, but Gutter margin change to zero, and 'Gutter on right side of page'
> is disabled.

I don't see the behaviour has changed on a recent trunk build. Can you please double-check?

(and sorry for the doubling-up in my previous comment, you beat me to it :) ))