Created attachment 144973 [details] Sample DOCX The attached DOCX has top and bottom margin set to -2" and -1.5" respectively, with some header/footer text. As far as I can see Word treats this as the non-negative value. In Writer the header/footer aren't shown. After saving, the margins are set to unexpected values, though at least the header/footer text becomes visible. Observed using LO 6.1.1.2 & 3.3.0 / Windows 7. In 5.2.0.4 the header/footer are still visible on open (not in 5.3.0.3), though the margins are still incorrect. This change could be bibisected.
Created attachment 144974 [details] Screenshot in Word
Relevant spec: ECMA-376-1:2016 17.6.11 pgMar (Page Margins) > A negative value indicates that the contents of the main document shall be measured > from the bottom of the page extent regardless of the footer for that document, and > therefore shall overlap the footer text. A code pointer: SectionPropertyMap::PrepareHeaderFooterProperties (writerfilter/source/dmapper/PropertyMap.cxx)
Ww8 implementation for reference: wwSectionManager::SetPageULSpaceItems in sw/source/filter/ww8/ww8par6.cxx
(In reply to Aron Budea from comment #0) > In 5.2.0.4 the header/footer are still visible on open (not in 5.3.0.3), > though the margins are still incorrect. This change could be bibisected. Here's the result with bibisect-linux-64-5.3. Seems unrelated, but apparently an exception is triggered somewhere. https://cgit.freedesktop.org/libreoffice/core/commit/?id=bdd4a238a1d8a0cbbebbd759011050659668f92b author Justin Luth <justin_luth@sil.org> 2016-09-09 12:42:55 +0300 committer Justin Luth <justin_luth@sil.org> 2016-09-09 12:54:23 +0000 tdf#86926 writerfilter allow fallback if exceptions
I believe that there's no need in the bisecting, because there's a need to reimplement the function, and that fixes all this at once. The "regression" part is simply some coincidence. I created a quick attempt: https://gerrit.libreoffice.org/60730. It is not complete, and I don't plan to continue it ATM. Feel free to continue based on it. Its problems are mentioned in the commit message.
Created attachment 154232 [details] Sample DOCX compared MSO LO
*** Bug 118489 has been marked as a duplicate of this bug. ***
Attila Szűcs committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d656191ec308d4280b93c7169372e543a255d108 tdf#119952 DOCX import: fix negative page margins It will be available in 7.3.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.
Attila Szűcs committed a patch related to this issue. It has been pushed to "libreoffice-7-2": https://git.libreoffice.org/core/commit/11c61e5f0544966f3901c8fb4270bb07424942f1 tdf#119952 DOCX import: fix negative page margins It will be available in 7.2.0.0.beta2. 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.
Verified in: Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community Build ID: bd2f2273d83dcca43eb6b465308707efd45e7adf CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: default; VCL: win Locale: hu-HU (hu_HU); UI: hu-HU Calc: threaded
Thanks for fixing and verification. It should confirm that duplicate is also tested as resolved (I cannot do it myself).
All if fine, original and duplicate DOCX, MSO saved DOC, open and save.
*** Bug 120113 has been marked as a duplicate of this bug. ***
*** Bug 64876 has been marked as a duplicate of this bug. ***