Bug 69065 - FORMATTING: mirrored page style uses wrong margins if the page style is used as first-page both on a left-page and a right-page
Summary: FORMATTING: mirrored page style uses wrong margins if the page style is used ...
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.6.2 release
Hardware: Other Linux (All)
: medium normal
Assignee: Michael Stahl
QA Contact:
URL:
Whiteboard: BSA target:4.3.0 target:4.2.0.2 targe...
Keywords: regression
: 71360 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-09-07 09:42 UTC by Martin Sourada
Modified: 2014-01-10 14:10 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Shortest test file I was able to create which seems to always trigger the issue (for me) (8.37 KB, application/vnd.oasis.opendocument.text)
2013-09-07 09:42 UTC, Martin Sourada
Details
Screenshot of the bug happening. (98.34 KB, image/png)
2013-09-07 09:44 UTC, Martin Sourada
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Sourada 2013-09-07 09:42:32 UTC
Created attachment 85391 [details]
Shortest test file I was able to create which seems to always trigger the issue (for me)

Problem description:
When I use page mirroring for having different margins on left and right pages and combine it with page organization (e.g. I want to start a new always-on-the-right page without header and then follow with normal pages that contain headers), it sometimes change left and right pages style. If the broken page is not the first one, usually hitting enter after the first paragraph in the broken page resets it to normal.

Steps to reproduce:
1. Edit Right Page page style to be always on a right page and have Default page follow it automatically.
2. Change Default page style to mirroring.
3. Edit margins in the above two styles to easily notice which page is right and which is left.
4. Make first page with the Default style.
5. Insert page break that forces Right Page style.
6. Insert text or page break to overflow to next page (which should be then Default again)
7. Save & close.
8. Open.

Current behavior:
First page margins are as if it were a left page. Ruler however seems to know it is a right page.

Expected behavior:
Left pages have margins for left pages, right pages have margins for right pages.

Additional info:
The file saves correctly, just opening it is broken, because I tried opening a file with this issue under CentOS and LO 3.4.5 and there it worked correctly. Also Apache OO 4.0.0 opens it just as fine.
              
Operating System: Fedora
Version: 4.1.1.2 rc
Last worked in: 3.4 all versions
Comment 1 Martin Sourada 2013-09-07 09:44:53 UTC
Created attachment 85392 [details]
Screenshot of the bug happening.
Comment 2 Dominique Boutry 2013-10-20 15:22:18 UTC
Reproduced with Lib0 4.1.2.3 on Win7.

Additional constatation : Once the file reloaded and the error noted, addind a header to the first page corrects the error .

Bug.
Comment 3 Michael Stahl 2013-12-18 13:34:55 UTC
regression from:

commit 4df438c9a9d5e698c47c1e85903eb81880a5e6fa
Author:     Michael Stahl <mstahl@redhat.com>
AuthorDate: Tue Aug 20 11:41:37 2013 +0200

    fdo#66145: do not check IsFirstShared() in SwPageDesc::GetLeftFmt()
    
    ... and GetRightFmt().  If the first format is requested it must be
    returned; the sharing works by copying the SwFmtHeader/Footer from
    aMaster to the other members.
Comment 4 Michael Stahl 2013-12-20 10:24:20 UTC
problem is that in this document the same page style "Default" is used
as a first-page both on a right page (1) and a left page (4),
and the LRSpace item that stores the margins cannot possibly be correct
for both if the page style is "mirrored".
Comment 5 Commit Notification 2013-12-20 23:07:12 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e936ecc92a7e362f57ce72a955697840920636b8

fdo#69065: sw: fix mirrored page style with first-page



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 6 Michael Stahl 2013-12-20 23:53:43 UTC
this required adding another epicycle to the SwPageDesc train-wreck but should be fixed now.
Comment 7 Commit Notification 2013-12-21 16:03:18 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0eafb69609d58798a9e00e93dd9ea39e9189db8b&h=libreoffice-4-2

fdo#69065: sw: fix mirrored page style with first-page


It will be available in LibreOffice 4.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2013-12-21 16:20:42 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-4-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=283b76abeafe28c335de2d7cdc2fde04a55d4192&h=libreoffice-4-1

fdo#69065: sw: fix mirrored page style with first-page


It will be available in LibreOffice 4.1.5.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 sophie 2014-01-10 07:42:27 UTC
Verified in Version: 4.2.0.2
Build ID: 601a398b803303d1a40a3299729531824fe0db56, set to Closed - Sophie
Comment 10 Michael Stahl 2014-01-10 14:10:04 UTC
*** Bug 71360 has been marked as a duplicate of this bug. ***