Bug 165089 - Example grid document that seems to need AddExtLeading
Summary: Example grid document that seems to need AddExtLeading
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
25.2.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Jonathan Clark
URL:
Whiteboard: target:25.8.0
Keywords: bibisected, bisected
Depends on:
Blocks: Text-Grid
  Show dependency treegraph
 
Reported: 2025-02-07 00:13 UTC by Justin L
Modified: 2025-02-18 12:51 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
moz335197-19.doc: example document (483.00 KB, application/msword)
2025-02-07 00:13 UTC, Justin L
Details
moz335197-19.doc_mso.pdf: how it looks in Word 2019 (and 2010) (384.15 KB, application/pdf)
2025-02-07 00:14 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-07 00:13:28 UTC
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
Comment 1 Justin L 2025-02-07 00:14:13 UTC
Created attachment 199027 [details]
moz335197-19.doc_mso.pdf: how it looks in Word 2019 (and 2010)
Comment 2 Jonathan Clark 2025-02-14 17:05:58 UTC
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.
Comment 3 Commit Notification 2025-02-18 12:50:41 UTC
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.