Bug 165083 - FILESAVE ODT->DOCX: margins swapped for EVEN/ODD page styles
Summary: FILESAVE ODT->DOCX: margins swapped for EVEN/ODD page styles
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.8.0.0 beta1+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:25.8.0 target:25.2.4
Keywords: bibisected, bisected, filter:docx, regression
Depends on:
Blocks: Writer-Styles-Page-Odd-Even
  Show dependency treegraph
 
Reported: 2025-02-06 17:43 UTC by Justin L
Modified: 2025-05-09 13:37 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
bigMargins.odt: exaggerated example (12.84 KB, application/vnd.oasis.opendocument.text)
2025-02-06 17:43 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2025-02-06 17:43:53 UTC
Created attachment 199019 [details]
bigMargins.odt: exaggerated example

Exporting to DOCX from non-DOCX files inverts the margin for left pages.

This started in 25.2 (backported to 24.8) with
commit 8ef9573f087b86f93860c8d07d04b60a40512836
Author: Oliver Specht on Tue Jun 11 08:51:09 2024 +0200
    tdf#161521 fix page margins on first page with mirrord layout

Steps to reproduce
1.) open bigMargins.odt. (Noticed the first page has content on the left side, and the second page has it on the right side.)
2.) export to DOCX format and reload.

Notice that the big margins are applied to the left side in both cases after Oliver's commit. Probably GetFilter needs to be consulted at export time? (although that might not be terribly reliable if the document isn't reloaded immediately, but is instead re-saved...)

I noticed this when looking at Test-DOC-saved.doc (attachment 130353 [details] from bug 105148). So the same problem comes when converting from DOC to DOCX.

Found by Collabora's mso-test
Comment 1 mikhail.machine 2025-02-11 08:07:07 UTC
Hello Justin L,

Thank you for reporting the bug. I can confirm that the bug is present in master.

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a8ec21adf255b70bb6eeb0a1717190df303d8b26
CPU threads: 12; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_FI); UI: en-US
/Writer: threaded
Comment 2 Commit Notification 2025-04-23 07:57:32 UTC
Oliver Specht committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/bac7665f78b734a9ba79a4511484c579047ea0df

tdf#165083 Remove of wrong page margin export code

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Commit Notification 2025-05-08 15:19:34 UTC
Oliver Specht committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/46189f520842b0324e0edce412ee624072f26a54

tdf#165083 Remove of wrong page margin export code

It will be available in 25.2.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.