Description: In attachment #129129 [details] the first two paragraphs in the table cells get a 0.35 cm spacing after in the Default style, while in Word it was 0. Steps to Reproduce: 1. Open attachment #129129 [details] and check the paragraph settings of the first paragraph in the cells. Compare to Word. Actual Results: Spacing After is 0.35 cm. Expected Results: Spacing After is 0. Reproducible: Always User Profile Reset: No Additional Info: LibreOffice details: Version: 6.4.0.0.alpha1+ (x86) Build ID: f0340d58cc0f2808ce8003099ff2a0495360f267 CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: default; VCL: win; Locale: hu-HU (hu_HU); UI-Language: en-US Calc: CL
Created attachment 155753 [details] Screenshot of the original document side by side in Word and Writer
I think, it is an error in Word. The paragraph has a direct setting <w:spacing before="5.5pt">. A value for 'after' is not specified. So the rule "If this attribute is omitted on a given paragraph, the value of the setting it represents is the value previously set in the style hierarchy." (ISO/IEC 29500-1:2016, page 249). Looking into the style hierarchy, you find a value in the element docDefaults, it is 'after="10pt"'. Because of vertical space collapsing of paragraphs, the effective distance is 10pt. And that is the 3.53mm, that LibreOffice renders. If the direct setting has an attribute 'after="0pt"', then LibreOffice takes it, and renders the 5.5pt from the next paragraph. That is the formal part. Of cause a user has a different view on the problem, and we need to decide, whether we will follow the bug of Word to please the customer. And how to do it in that case. Perhaps yet another compatibility option?
(In reply to Regina Henschel from comment #2) > I think, it is an error in Word. The paragraph has a direct setting > <w:spacing before="5.5pt">. A value for 'after' is not specified. So the > rule "If this attribute is omitted on a given paragraph, the value of the > setting it represents is the value previously set in the style hierarchy." > (ISO/IEC 29500-1:2016, page 249). Looking into the style hierarchy, you find > a value in the element docDefaults, it is 'after="10pt"'. Because of > vertical space collapsing of paragraphs, the effective distance is 10pt. And > that is the 3.53mm, that LibreOffice renders. If the direct setting has an > attribute 'after="0pt"', then LibreOffice takes it, and renders the 5.5pt > from the next paragraph. > > That is the formal part. Of cause a user has a different view on the > problem, and we need to decide, whether we will follow the bug of Word to > please the customer. And how to do it in that case. Perhaps yet another > compatibility option? Thanks for the detailed analysis. I guess then this belongs to the family of bug #117982 which is about the crazy handling of spacing in docx tables.
It seems, in Word there is a multiple inheritance within tables: paragraphs get the settings (with higher priority) of the Table Grid paragraph style. In the case of the Normal style, this is visible on the UI, too, but not in the case of the other paragraph styles. See the attached test file. The blue color comes from the Table Grid style.
Created attachment 155781 [details] Paragraph styles get extra or modified style settings in table cells (Multiple or modified style inheritance in MSO...)
Created attachment 155784 [details] screen shot of the previous test file in Word
It seems, there is no multiple inheritance or wrong style hierarchy. Table styles overwrite the docDefault style: http://officeopenxml.com/WPstyles.php In this case, where <w:spacing w:after="200"> was defined.
But thanks to this behavior, a text with same paragraph style can have different formatting within a table cell and outside a table...
László Németh committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d8f3f8ecd9e6304f3a98ab03fae6bc545893f782 tdf#128752 DOCX: fix partial direct paragraph spacing in tables It will be available in 6.5.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.
tdf#128752 DOCX: fix partial direct paragraph spacing in tables When direct formatting of a table paragraph set only top margin, but not the bottom margin, also there was no paragraph style setting for the bottom margin, the paragraph was imported using docDefault bottom spacing instead of the table style bottom spacing.
László Németh committed a patch related to this issue. It has been pushed to "libreoffice-6-4": https://git.libreoffice.org/core/commit/28444a2cf7ac637a0161733121c59de82bc7e4db tdf#128752 DOCX: fix partial direct paragraph spacing in tables It will be available in 6.4.0.1. 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.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/749fd6508504cf3b2e3822eca52a67fa36d75fb8 revert obsolete writerfilter hacks for tdf#119054 and tdf#128752 It will be available in 6.5.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.
László Németh committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/c90b6a208d867a00252ad58d8eeab2fd12516157 Revert "revert obsolete writerfilter hacks for tdf#119054 and tdf#128752" It will be available in 7.0.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.
Everything ok. Verified on Version: 6.4.3.2 Build ID: libreoffice-6.4.3.2-snap1 CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3; Locale: ro-RO (ro_RO.UTF-8); UI-Language: en-US Calc: threaded And also on Version: 7.0.0.0.alpha1 Build ID: 6a03b2a54143a9bc0c6d4c7f1... CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3; Locale: ro-RO (ro_RO.UTF-8); UI: en-US Calc: threaded