Created attachment 162495 [details]
Example file from Word
Attached file contains a few paragraphs formatted with List Paragraph style in Word.
This style has the “Don’t add space between paragraphs of the same style” setting turned on.
One of the paragraphs overrides this setting with direct formatting, which is imported correctly in Writer.
Saving to DOCX however loses this override.
Steps to reproduce:
1. Open attached document and save as DOCX
Paragraph3 loses its direct format setting of “Don’t add space between paragraphs of the same style” being OFF.
Direct formatting setting retained.
Version: 22.214.171.124.alpha0+ (x86)
Build ID: 8ed11b7289533bd609fbcb2adfb7b2982ef6fe22
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Also happens in:
Build az.: 64a0f66915f38c6217de274f0aa8e15618924765
CPU szálak: 4; OS: Windows 6.3; Felületmegjelenítés: alapértelmezett;
Területi beállítások: hu-HU (hu_HU); Calc: CL
Build ID: 1b1a90865e348b492231e1c451437d7a15bb262b
Locale: hu-HU (hu_HU)
Build az.: 05dceb5d363845f2cf968344d7adab8dcfb2ba71
But not in:
Build az.: 89ea49ddacd9aa532507cbf852f2bb22b1ace28
Created attachment 162496 [details]
Screenshot of the original document side by side in Word and Writer
Created attachment 162497 [details]
The original file saved by Writer
Created attachment 162498 [details]
Screenshot of the original and exported document side by side in Word
Build ID: fa844c15233f108a0e9b0b2e8c9757c1aa088a4b
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
repro 7.2. Also true for .doc and .rtf formats.
I bibisected this to 6.0 IMPORT patch:
Author: Miklos Vajna on Oct 24 09:27:19 2017 +0200
tdf#113202 RTF import: fix lack of expected contextual spacing
HOWEVER, I wasn't comparing with MS Word. MS Word 2016 also does display any spacing. So actually this 6.0 bibisect is a fix.
So, if I bibisect using MS Word 2016 as the verifier, then I confirm NISZ's conclusion that it was in broken at LO 4.2 with:
Author: Jan Holesovsky on Oct 9 14:39:35 2013 +0200
DOCX export: Write contextualSpacing only if it takes place.
So the fix here will be to see if it inherits contextualspacing == true, and in that case write out a false. (see https://gerrit.libreoffice.org/c/core/+/106315 for a similar case for character properties.)
P.S. At this point, MSWord shows RTF with no spacing - same as with 7.2.
However, DOC has spacing between every single one of the first five paragraphs (which was mysteriously fixed shortly thereafter in the range https://cgit.freedesktop.org/libreoffice/core/log/?id=33e97347ac5b1a3206ddcc2c8313c7e88461bb0b&qt=range&q=ff3b823ef4b867263711703fab596584314e4f58..fdba797bd9c2a3fe4de82f92c3ee815c15f8ac84)
RTF has "\contextualspace", but no negation of that. So I don't think it is possible to cancel in RTF. (In MS Word, it removes \contextualspace from the string of formatting in front of Paragraph3.)
Proposed fix at https://gerrit.libreoffice.org/c/core/+/113064
Justin Luth committed a patch related to this issue.
It has been pushed to "master":
tdf#134385 doc/docxexport: maybe export false contextualspacing
It will be available in 7.2.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:
Affected users are encouraged to test the fix and report feedback.
Version: 126.96.36.199.alpha1+ (x64) / LibreOffice Community
Build ID: aa9cb8e14749e7fb7a83b55a2bb095501f731a18
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU