Bug 162027 - FILEOPEN DOCX: empty header should apply only page margin, not the header-from-top margin (problem with different-first)
Summary: FILEOPEN DOCX: empty header should apply only page margin, not the header-fro...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
: 162667 (view as bug list)
Depends on:
Blocks: Regressions-ooxml-handle-first-hdr-ftr
  Show dependency treegraph
 
Reported: 2024-07-13 16:00 UTC by Justin L
Modified: 2024-10-09 09:11 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2024-07-13 16:00:00 UTC
This is just re-opening LO 7.2 bug 135217. The unit test for it (writerfilter/dmapper/follow-page-top-margin.docx) was changed to be a 1.25cm margin instead of a very minimal 0.25cm margin, in order to allow a patch to be merged.

This is due to fundamental header/footer differences between MSO and LO. Now that we don't use two page styles for first/follow, we have lost the ability to emulate an enabled first header and disabled follow header.

margin.docx (attachment 154527 [details]): has a 0.25cm top page margin set with some header contents on the first page and no header contents on the second. So the first page is supposed to apply the "header from top" value of 1.25cm, while the second page is supposed to ignore all that and just use the page margin settings.

attachment 163682 [details]: Screenshot of the margin.docx side by side in Word and Writer

The 24.2 regression comes from author Tomaž Vajngerl on 2023-12-01 08:26:38
with commit 4b0fa253a4540f5461397815d290586f9ddabe61 
    tdf#136472 adjust ooxml import to handle first header/footer
https://gerrit.libreoffice.org/c/core/+/157860
Comment 1 Tomaz Vajngerl 2024-07-14 03:41:46 UTC
I have worked a bit for this issue: https://gerrit.libreoffice.org/c/core/+/163884

The problem is that in MSO if the header/footer is empty it takes 0 space, but not in LO. My changes implements the MSO behavior, but that would need to be made an option, so we can turn it only when necessary to not break existing documents (either ooxml or odf).
Comment 2 Tomaz Vajngerl 2024-07-14 03:48:10 UTC
Again this is something that just made an existing bug more visible, but it already existed before. 
For example - a left page header would also necessarily enable a right page header even if the right page would be empty it would still take up space. We minimized the consequences of this to the document format by setting a near 0 font size to the right page header on import, but that's not a proper solution obviously.
Comment 3 Justin L 2024-07-15 15:46:17 UTC
This is the same problem as various other of tdf#136472's disabled tests
-tdf127778 is the same file as margins.docx
-n779642.docx (same file as TestFirstFooterDisabled.docx, can't open in mso2010)

-fdo44176.rtf (not interesting: default margin is larger than "header from top")
-tdf112694.docx (also not interesting in the same way)
Comment 4 Justin L 2024-09-28 18:54:27 UTC
*** Bug 162667 has been marked as a duplicate of this bug. ***