Created attachment 199026 [details] moz335197-19.doc: example document This document was tracking MS Word's layout until 25.2 commit 2b030ded43f440a898733290af087d4aeed53368. Author: Jonathan Clark on Fri Sep 20 00:50:21 2024 -0600 tdf#85435 sw: No longer clear AddExtLeading for doc files with grid This change removes a problematic workaround from the doc importer, which was clearing the AddExtLeading compatibility flag for any doc file containing a document grid. Bug 85435 comment 18 says "I don't expect this will introduce new text grid problems, but if it does, we can address them in a more permanent way." Not marking as a regression because it clearly wasn't right before - it just happened to give a nice result. This SHOULD be a fairly clear example document. It is using Times New Roman and is a rather simple document, except that it has some special layout results. Steps to reproduce. 1.) open moz335197-19.doc On the bottom of page 1, there should be approximately one line of space between "1.1.3 KFTC" and the footer area. More clearly, on the second page there should be 2 lines of the paragraph after "1.1.4.3 Scope of Use and Restrictions" (while currently there is none - all four lines are on the third page). Found by Collabora's mso-test
Created attachment 199027 [details] moz335197-19.doc_mso.pdf: how it looks in Word 2019 (and 2010)
Confirmed; there is a formatting discrepancy. None of the paragraphs in this document are snapped to grid. As far as I can tell, the main layout difference between LO and MSO is grid centering. During layout, LO adjusts the top and bottom margins of the page to center the document grid on the page. Word's grid semantics are very different; doing this doesn't make sense for DOC/DOCX files. Using a simple patch to disable grid centering, I was able to get matching output between LO and MSO. This seems like a reasonable thing to include under the existing grid compatibility flag.
Jonathan Clark committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/fd7717f81b18faab0e400c9fa3e87c4579f254d1 tdf#165089 sw: disable grid centering for DOC/DOCX compatibility 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.