Bug 134784 - Paragraph spacing of first paragraph in a text frames is set to 0,42 cm when importing/opening docx
Summary: Paragraph spacing of first paragraph in a text frames is set to 0,42 cm when ...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.2.0.3 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.1.0 target:7.0.3
Keywords: bibisected, bisected, regression
Depends on:
Blocks: DOCX-Paragraph
  Show dependency treegraph
 
Reported: 2020-07-13 13:52 UTC by rominator
Modified: 2020-11-19 12:16 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Test document for tdf#134784 (172.64 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-07-13 14:08 UTC, Mike Kaganski
Details
Screenshot for tdf#134784 (179.95 KB, image/png)
2020-07-13 14:09 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rominator 2020-07-13 13:52:17 UTC
Description:
We are considering LO as a MS Word replacement and checking out the reproduction of existing DOCX documents.
When opening a docx with a text frame the first paragraph of the frame gets a "Spacing / Abwove paragraph" of 0,42 cm whereas the source document in MS Word has not (0 pt).

I have attached a minimal anonymized document that is quite similiar to the source document for the sake of reproduction in a ask.libreoffice.org-question https://ask.libreoffice.org/en/question/254942/paragraph-spacing-differs-when-opening-docx/

You can easily see the difference in the options of the two programs in the attached screenshot too.

Steps to Reproduce:
Open attached document

Actual Results:
Paragraph spacing is set to a value non zero

Expected Results:
Paragraph spacing is set to a zero


Reproducible: Always


User Profile Reset: No



Additional Info:
Sest paragraph spacing to zero as in input file
Comment 1 Mike Kaganski 2020-07-13 14:02:27 UTC
Reproduced with Version: 7.0.0.1 (x64)
Build ID: 04ba7e3f1e51af6c5d653e543a620e36719083fd
CPU threads: 12; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL
Comment 2 Mike Kaganski 2020-07-13 14:08:15 UTC
Created attachment 162978 [details]
Test document for tdf#134784

Attaching to have it here
Comment 3 Mike Kaganski 2020-07-13 14:09:20 UTC
Created attachment 162979 [details]
Screenshot for tdf#134784
Comment 4 rominator 2020-07-13 14:31:59 UTC
This has been answered on ask.libreoffice.org. The problem stemmed from formatting issues in the source document and could be overcome by already-in-place configurable compatibility mechanisms.
Comment 5 rominator 2020-07-13 14:32:36 UTC
Can be closed imho
Comment 6 Mike Kaganski 2020-07-13 14:34:37 UTC
(In reply to rominator from comment #5)
> Can be closed imho

No, a workaround is not a fix :-)
Comment 7 NISZ LibreOffice Team 2020-07-14 09:42:59 UTC
Confirming with:
Verzió: 6.2.0.3
Build az.: 98c6a8a1c6c7b144ce3cc729e34964b47ce25d62
CPU szálak: 4; OS: Windows 6.3; Felületmegjelenítés: GL; VCL: win; 
Területi beállítások: hu-HU (hu_HU); UI nyelve: hu-HU
Calc: threaded

But not yet in:
Version: 6.1.0.3
Build ID: efb621ed25068d70781dc026f7e9c5187a4decd1
CPU threads: 4; OS: Windows 6.3; UI render: default; 
Locale: en-US (hu_HU); Calc: CL
Comment 8 NISZ LibreOffice Team 2020-07-14 10:01:11 UTC
Bibisected using bibisect-win32-6.2 to:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=dc0300eac3b755bc207cd1fe87217f4ebaeb9f58

author	László Németh <nemeth@numbertext.org>	2018-07-17 19:46:22 +0200
committer	László Németh <nemeth@numbertext.org>	2018-07-18 08:55:01 +0200

tdf#118521 DOCX import: fix paragraph margin from paragraph style

Adding CC to: László Németh
Comment 9 rominator 2020-07-17 14:28:41 UTC
I am not really getting the deal here. Should I use the compatibility settings or expect writer to import the DOCX so that it looks like the MS Word thing?

I am asking this because I am now using 6.3.6.2 (which you say has a problem since this commit 2018) and an UNCHECKED compatibility setting "Add paragraph and table spacings at tops of pages".

This settinng unfortunately leads to other problems in this document (and this version) like the title of the document (title-style) being positioned falsely, and other paragraph spacing issues that I came around later.

I could attach some files for this issues too but I would first need to know what the intentions of the compatibility settings and the DOCX import are and how I should be testing this.
Comment 10 Mike Kaganski 2020-07-17 15:18:27 UTC
(In reply to rominator from comment #9)
> I am not really getting the deal here. Should I use the compatibility
> settings or expect writer to import the DOCX so that it looks like the MS
> Word thing?

As I said in comment 6: a workaround is *not* a fix. This is a bug, and needs fixing. You may see that the bug has been investigated, it was found out when and why has it appeared (so it's a regression), and a developer has assigned it to himself (so you know that László is working on it).

Compatibility settings are set *automatically* when you open a file type that needs those settings. E.g., Writer and Word use different conventions how to calculate tab offsets; it would be impossible to interoperate if LibreOffice didn't introduce a compatibility option "behave like Word for tabs", and didn't enable it automatically every time it opens a DOC(X). So the enabled compatibility option is the *correct* thing for DOCX; disabling it *naturally* results in interoperability problems. And so it's just a workaround to temporary avoid the *bug* in the option's effect.
Comment 11 rominator 2020-07-17 15:55:58 UTC
Thank you very much for the clarification on how the compatibility settings work!
This means of course that I should update the correct answer at ask.libreoffice.org.

I am looking forward to getting the fixed version by László so that we can check other documents of our customers for compatibility issues with this fix!

We have been working with MS Word for over a decade and are now checking out writer mainly for PDF conversion of documents.
Comment 12 Commit Notification 2020-09-16 07:31:36 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

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

tdf#134784 DOCX import: fix shape paragraph margins

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 13 László Németh 2020-09-16 07:33:04 UTC
tdf#134784 DOCX import: fix shape paragraph margins

based on bad style inheritance.

Regression from commit dc0300eac3b755bc207cd1fe87217f4ebaeb9f58
(tdf#118521 DOCX import: fix paragraph margin from paragraph style),
revealing the problematic m_sCurrentParaStyleName, see also

https://cgit.freedesktop.org/libreoffice/core/commit/?id=8920d865ee148518bf71f71ce1866b24cc17c07e)


for more information.
Comment 14 Xisco Faulí 2020-09-29 14:28:41 UTC
Verified in

Version: 7.1.0.0.alpha0+
Build ID: cd85546a2fbdade42f80fd3b6bd650791db9f32d
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: tr-TR (en_US.UTF-8); UI: en-US
Calc: threaded

@László Németh, thanks for fixing this issue!
Comment 15 Commit Notification 2020-10-01 08:34:29 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/2f40b190b22213a80aa11021f69619f1b72838be

tdf#134784 DOCX import: fix shape paragraph margins

It will be available in 7.0.3.

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 16 NISZ LibreOffice Team 2020-10-08 08:52:26 UTC
Verified in:

Version: 7.1.0.0.alpha0+ (x64)
Build ID: a3b4831208da615789bd1e2d5660dd130807f504
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded

Thanks, László :)
Comment 17 rominator 2020-11-19 12:16:24 UTC
Hi,

thanks for the fix! I will also check that out from an end-user perspective.

Kind reagards, Roman