Skip to content

fix(docx): state the Word 2010 compatibility mode the export is measured against - #843

Closed
DemchaAV wants to merge 1 commit into
2.5-devfrom
fix/docx-compat-mode
Closed

DemchaAV wants to merge 1 commit into
2.5-devfrom
fix/docx-compat-mode

Conversation

@DemchaAV

@DemchaAV DemchaAV commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Why

The LibreOffice build on the Linux CI (build 420) reads a body table's w:tblInd as the table's edge and sets its text a cell margin further in. Word 16 and LibreOffice on Windows set the text at the indent. The export writes no w:compat, so this measured whether an explicit Word 2010 compatibility mode makes the Linux build read the indent as Word does.

What changed

stateTheCompatibilityMode writes <w:compat><w:compatSetting w:name="compatibilityMode" w:uri="http://schemas.microsoft.com/office/word" w:val="14"/></w:compat> into settings.xml.

Result: it does not help

  • Word 16 and LibreOffice (Windows). Every line stays exactly where the baselines have it.
  • LibreOffice (Linux, build 420) (run 37213136835). With mode 14 this build pulls the text of every table left by 5.4–5.9pt, about Word's default cell margin. The export already places that text by its indent.
    • Lines past 2pt across: 301 → 3693.
    • 3706 lines further, 561 nearer.
    • The down column is unchanged.
    • Body panels stay off: ModernInvoice's header goes from +16.10 to +8.70.
  • Examples. CommittedAssetDriftTest fails because word-export-companion.docx now carries the setting.

The draft is kept only as a record of the measurement. It is not meant to merge.

Lane: shared-engine (render-docx).

@DemchaAV

DemchaAV commented Oct 4, 2026

Copy link
Copy Markdown
Owner Author

Closed without merging: an explicit compatibilityMode 14 leaves Word and Windows LibreOffice unchanged and pulls every table's text 5.4pt left in the Linux CI build (past-2pt lines 301 → 3693). Measurements in the description.

@DemchaAV DemchaAV closed this Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant