Created attachment 198785 [details] 164803_exactHeight.docx: 1 page example where grid of 2 is overridden by exact spacing of 12pt If a paragraph is set to have Exact spacing (or atLeast 0 spacing), then the grid is not supposed to affect it (at least according to MS Word's implementation). Steps to reproduce. 1.) Open 164803_exactHeight.docx The document should be only one page long. The paragraphs are set to have exactly 12pt spacing.
See bug 164803 comment 12 regarding atLeast 0. ooo39057-1.doc is an example of that, and can be found in 164803_more_examples.zip (attachment 198683 [details] from bug 164803 comment 3) [To see this document grid stuff in MS Word, I had to go into File - Options - Languages and add an editing language (Japanese). (Simply that. Not Enabled keyboard and Not Installed grammar is fine...) Now in Page Layout - Page Setup dialog I can see a Document Grid tab, and paragraph properties now shows a Snap-to-Grid checkbox.]
That is the setting "Snap to text grid (if active)" in the alignment tab of the paragraph properties. If it is off, the distances are the same as in Word. So the docx import should set this property to "off".
Created attachment 199110 [details] MSO: Various grid and line spacing cases PDF exported with Microsoft Word, showing various line spacing options used along with text grid.
Created attachment 199111 [details] LO: Various grid and line spacing cases Corresponding cases, exported using LibreOffice.
Confirming. There are some significant differences in how line spacing is handled in Writer versus Word when combined with text grid. Single, 1.5x, double, and multiples seem to work the same in both programs. Writer ignores atLeast and exact when the document/paragraph has grid enabled. The next line is always snapped to the next grid row. In Word, atLeast 0 disables the extra spacing added by the grid. For atLeast N (where N > row pitch), the following line is positioned at N (i.e. it is not snapped to the next grid row). In Word, exact spacing also works as expected (always overriding the grid spacing).
Jonathan Clark committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d48e3e1df55120fc0102ff07f1b637933fc91c87 tdf#164871 sw: Implemented exact and at-least line spacing for grid 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.
Comparing manually, line spacing within paragraphs now matches between Writer and Word when using the exact or at-least spacing types, as discussed previously. There is still a difference in vertical placement of paragraphs. That difference was preexisting, and doesn't seem related to exact or at-least line spacing.
Jonathan Clark committed a patch related to this issue. It has been pushed to "libreoffice-25-2": https://git.libreoffice.org/core/commit/adb18c960b37cbc2042bde799c86f78175dcfcb9 tdf#164871 sw: Implemented exact and at-least line spacing for grid It will be available in 25.2.2. 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.