Bug 125893 - FILEOPEN DOCX Space between paragraphs of the same style is altered (different contextual spacing setting)
Summary: FILEOPEN DOCX Space between paragraphs of the same style is altered (differen...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.2.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.1.0 target:7.0.0.1
Keywords:
Depends on:
Blocks: DOCX-Paragraph
  Show dependency treegraph
 
Reported: 2019-06-13 07:36 UTC by NISZ LibreOffice Team
Modified: 2021-03-20 10:14 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Example file with paragraph in same style (22.49 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-06-13 07:37 UTC, NISZ LibreOffice Team
Details
Screenshot about LibreOffice Writer (71.31 KB, image/png)
2019-06-13 07:37 UTC, NISZ LibreOffice Team
Details
Ccreenshot about Microsoft Word (67.86 KB, image/png)
2019-06-13 07:38 UTC, NISZ LibreOffice Team
Details
Result after step 4 (169.45 KB, image/jpeg)
2021-02-28 17:35 UTC, Dieter
Details
Result after step 6 (172.49 KB, image/jpeg)
2021-02-28 17:37 UTC, Dieter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2019-06-13 07:36:46 UTC
Description:
Space between paragraphs of the same style is altered

Steps to Reproduce:
Steps to reproduce:
    1. Create some paragraphs in an empty document
    2. Set a big space before paragraph in a style
    3. Set the “Don’t add space between paragraphs of the same style”
    4. Reset the “Don’t add space between paragraphs of the same style” for a selected paragraph with direct paragraph formatting
    5. Save the document as docx
    6. Open the saved document with Microsoft Word

Actual Results:
The space between paragraphs is the big value both before and after the selected paragraph in LibreOffice Writer view. The space between paragraphs is the big value only before the selected paragraph in Microsoft Word’s view.

Expected Results:
The space between paragraphs after the selected paragraph are same in LibreOffice Writer and Microsoft Word.


Reproducible: Always


User Profile Reset: No



Additional Info:
Remark:
The “Don’t add space between paragraphs of the same style” meanings are different in Writer and in Word. It means space before AND after the paragraph in Writer, but it means ONLY before the paragraph in Word. Therefore you can generate the document even in MS Word, the actual results will be the same.
Comment 1 NISZ LibreOffice Team 2019-06-13 07:37:29 UTC
Created attachment 152150 [details]
Example file with paragraph in same style
Comment 2 NISZ LibreOffice Team 2019-06-13 07:37:55 UTC
Created attachment 152151 [details]
Screenshot about LibreOffice Writer
Comment 3 NISZ LibreOffice Team 2019-06-13 07:38:19 UTC
Created attachment 152152 [details]
Ccreenshot about Microsoft Word
Comment 4 Dieter 2019-06-13 20:10:18 UTC
I confirm it with attachment from comment 1 in comparison between MS Word 2016 and

Version: 6.4.0.0.alpha0+ (x64)
Build ID: b170256fb6ebaf774b02b89835b19d9f3a1afb89
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-06-07_03:30:35
Locale: de-DE (de_DE); UI-Language: en-US
Calc: threaded
Comment 5 Commit Notification 2020-06-25 08:13:26 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e318d5d8146d18e2c76e23f2e3c39527f2af9f36

tdf#125893 DOCX import: fix "half" contextual paragraph spacing

It will be available in 7.1.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.
Comment 6 László Németh 2020-06-25 16:41:05 UTC
Note: I've modified this issue only for the visible import problem. While ODT export keeps the recent fix, the DOCX export still lost the non-contextual paragraph setting, if the contextual spacing comes from the paragraph style. I suggest to file a new issue for that different bug.
Comment 7 Commit Notification 2020-06-26 10:52:47 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/461634632d796fc719e941d925021ae48a210e59

tdf#125893 DOCX import: fix "half" contextual paragraph spacing

It will be available in 7.0.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.
Comment 8 Dieter 2021-02-24 08:25:09 UTC
Tested with

Version: 7.1.0.3 (x64) / LibreOffice Community
Build ID: f6099ecf3d29644b5008cc8f48f42f4a40986e4c
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

Actual result:
No space between the paragraphs, because "Don’t add space between paragraphs of the same style" is again enabled (same result in LO and in Word 2016)

=> REOPEN (but perhaps it might be treated as a new bug)
Comment 9 Gabor Kelemen (allotropia) 2021-02-25 16:47:31 UTC
(In reply to Dieter from comment #8)
> Tested with
> 
> Version: 7.1.0.3 (x64) / LibreOffice Community
> Build ID: f6099ecf3d29644b5008cc8f48f42f4a40986e4c
> CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL:
> win
> Locale: de-DE (de_DE); UI: en-GB
> Calc: CL
> 
> Actual result:
> No space between the paragraphs, because "Don’t add space between paragraphs
> of the same style" is again enabled (same result in LO and in Word 2016)
> 
> => REOPEN (but perhaps it might be treated as a new bug)

Could you attach a screenshot please?

I see in bibisect repo versions the attachment #152150 [details] docx to look like in Word on attachment #152152 [details] : big spacing is only between the Bek2 and Bek3 paragraphs.

Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: 7b649f835cc00ed76927c6821a135605609bed4e
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: hu-HU (hu_HU.UTF-8); UI: en-US
Calc: threaded 

Version: 7.1.1.0.0+ / LibreOffice Community
Build ID: f490652153498b6184c6589263212b3b3326900b
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: hu-HU (hu_HU.UTF-8); UI: en-US
Calc: threaded
Comment 10 Dieter 2021-02-28 17:35:36 UTC
Created attachment 170131 [details]
Result after step 4
Comment 11 Dieter 2021-02-28 17:37:11 UTC
Created attachment 170132 [details]
Result after step 6

Same result in MS Word 2016
Comment 12 Dieter 2021-02-28 17:40:18 UTC
(In reply to Gabor Kelemen from comment #9)
> Could you attach a screenshot please?

Steps to reproduce:
1. Create some paragraphs in an empty document
2. Set a big space before paragraph in a style
3. Set the “Don’t add space between paragraphs of the same style”
4. Reset the “Don’t add space between paragraphs of the same style” for a selected paragraph with direct paragraph formatting

Works as expected (see attachment 170131 [details])

5. Save the document as docx
6. Reload or open the saved document with Microsoft Word

Result: "Don't add space between paragraphs of the same style" is selected now (see attachment 170132 [details])
Comment 13 Gabor Kelemen (allotropia) 2021-02-28 22:46:10 UTC
(In reply to Dieter from comment #12)
> (In reply to Gabor Kelemen from comment #9)
> > Could you attach a screenshot please?
> 
> Steps to reproduce:
> 1. Create some paragraphs in an empty document
> 2. Set a big space before paragraph in a style
> 3. Set the “Don’t add space between paragraphs of the same style”
> 4. Reset the “Don’t add space between paragraphs of the same style” for a
> selected paragraph with direct paragraph formatting
> 
> Works as expected (see attachment 170131 [details])
> 
Excellent! :)
This bug was originally about two problems: fileopen and filesave. 
The patch fixed the fileopen part as Laszlo wrote in comment #5.

> 5. Save the document as docx
> 6. Reload or open the saved document with Microsoft Word
> 
> Result: "Don't add space between paragraphs of the same style" is selected
> now (see attachment 170132 [details])

I see that too, even in Writer after reload with 7.2 bibisect repo.

For the second part of the original problem we submitted bug #134385 (in See Also) after the patch landed. Just couldn't find the time to fix it :(.

Let's keep this closed for the fileopen issue and track the filesave in the other one.