Bug 57908 - Margins, header/footer spacing imported incorrectly from .doc
Summary: Margins, header/footer spacing imported incorrectly from .doc
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: All All
: high major
Assignee: Not Assigned
Whiteboard: target:4.0.1
Depends on:
Reported: 2012-12-05 09:57 UTC by Luke Deller
Modified: 2020-10-23 09:20 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:
Regression By:


Note You need to log in before you can comment on or make changes to this bug.
Description Luke Deller 2012-12-05 09:57:23 UTC
The bugdoc for fdo#56513 exhibited a secondary import problem.  This item is picking that up:

To reproduce:
1. Open the .doc sample attached to fdo#56513
2. Observe that the second page header and footer are positioned further from the edge than on other pages: the top/bottom margin and the header/footer spacing have different values on this page than other pages

Expected output: the vertical position of headers and footers on all three pages should be the same

Explanation: The second page is the start of a second section, whose header and footer are set as "Different First Page" *and* "Link to Previous" in Word.  When LibreOffice imports this section, it thinks there is no header or footer on this page, because (rSection.maSep.grpfIhdt & WW8_HEADER_FIRST) is not set (same for footer) and so imports margins accordingly.  It seems that this flag is only set in the .doc file if the section actually includes its own header, as opposed to being linked to the previous section's header.
Comment 1 Joel Madero 2012-12-06 21:00:38 UTC
Confirmed on so I changed version to reflect oldest release that has been proven to have problem.

Marked as:

New (Confirmed)
Major (can prevent high quality work and a different in professional quality depending on if being viewed on MSO or LibO)
High (headers/footers relatively common + professional quality could be lost)
Platform: Changed to All

Thanks for the report :)
Comment 2 Not Assigned 2013-02-14 08:45:11 UTC
Luke Deller committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":


minimal change to fix fdo#57908 for backport

It will be available in LibreOffice 4.0.1.

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:
Affected users are encouraged to test the fix and report feedback.