Bug 125469 - FILEOPEN DOCX Inline images separated by line-break overlap
Summary: FILEOPEN DOCX Inline images separated by line-break overlap
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1 all versions
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:25.2.0
Keywords: filter:docx
Depends on:
Blocks: DOCX-Images Writer-Page-Break
  Show dependency treegraph
 
Reported: 2019-05-23 20:20 UTC by Richard Sinden
Modified: 2024-07-19 13:03 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
DOCX exhibiting issue (895.97 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-05-23 20:20 UTC, Richard Sinden
Details
MSOffice Rendering (678.59 KB, application/pdf)
2019-05-23 20:20 UTC, Richard Sinden
Details
LibreOffice Rendering (598.90 KB, application/pdf)
2019-05-23 20:21 UTC, Richard Sinden
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Sinden 2019-05-23 20:20:08 UTC
Created attachment 151642 [details]
DOCX exhibiting issue

I have a DOCX file that was generated using Telerik's RadFlowDocument library. It contains several pages of images (containing charts) each separated by a line-break, with a page-break at the end of each set of images. This renders without a problem in each version of MS Word (2012 to 2019) that I have tried. 
In LibreOffice, these images all appear overlapped as if the line-break starts the subsequent image a few pixels below the previous one. The page-breaks seem to be completely ignored.
I've attached a DOCX that exhibits the behaviour and PDFs showing MS Office's rendering vs LibreOffice's.
Comment 1 Richard Sinden 2019-05-23 20:20:44 UTC
Created attachment 151643 [details]
MSOffice Rendering
Comment 2 Richard Sinden 2019-05-23 20:21:24 UTC
Created attachment 151644 [details]
LibreOffice Rendering
Comment 3 Dieter 2019-06-07 09:19:57 UTC
I confirm it with

Version: 6.3.0.0.beta1 (x64)
Build ID: a187af327633f5f00363be5131bd21a13e0f1a7b
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: en-US (de_DE); UI-Language: en-GB
Calc: threaded

in comparison with MS Word 2016
Comment 4 Dieter 2019-06-07 09:22:38 UTC
No repro with

Version: 6.1.6.3 (x64)
Build-ID: 5896ab1714085361c45cf540f76f60673dd96a72
CPU-Threads: 4; BS: Windows 10.0; UI-Render: GL; 
Gebietsschema: de-DE (de_DE); Calc: CL
Comment 5 Xisco Faulí 2019-06-07 16:35:55 UTC
This is not a regression.
I can reproduce the problem in

Version: 5.2.0.0.alpha0+
Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53
Threads 4; Ver: 4.15; Render: default; 

Version: 4.3.0.0.alpha1+
Build ID: c15927f20d4727c3b8de68497b6949e72f9e6e9e

Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)

Depending on the zoom level, it's displayed better or worse, but it has never worked as in MSO
Comment 6 Buovjaga 2024-07-02 11:39:09 UTC
Still repro

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: cc1f1e0e6dcabee2b6ca28f4f1341f0099814966
CPU threads: 8; OS: Linux 6.9; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Comment 7 Justin L 2024-07-16 16:22:02 UTC
The issue here is the LO says these paragraphs all have a fixed line spacing of 0.17inch. If this is changed to "single spacing", then it looks fine.

If we round-trip the file in LO, then Word looks like LO.
After the round-trip, we have <w:spacing w:lineRule="exact" w:line="240"/>,
and before the round-trip we have <w:spacing w:line="240"/>

lineRule (Spacing Between Lines)
Specifies how the spacing between lines is calculated as stored in the line attribute. If this attribute is omitted, then it shall be assumed to be of a value auto if a line attribute value is present.

However, we default to "fixed" 240 twips instead of "Auto" 240 (aka single).
Comment 8 Commit Notification 2024-07-19 00:44:58 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

NFC tdf#125469 writerfilter: move code into SetLineSpacing function

It will be available in 25.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:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2024-07-19 00:48:01 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#125469 writerfilter: use "auto" for not-provided lineRule

It will be available in 25.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:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2024-07-19 00:50:04 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/965d83d3a729b0c01c882e200d8bf18dd347c027

related tdf#125469 writerfilter: support negative exact and atLeast

It will be available in 25.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:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2024-07-19 00:52:07 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

related tdf#125469 docx im/export: better precision percent<->value

It will be available in 25.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:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Buovjaga 2024-07-19 13:03:30 UTC
Verified

Arch Linux 64-bit
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: aac4974f2a50ebd34137d0384a5e21567c6ae646
CPU threads: 8; OS: Linux 6.9; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Built on 19 July 2024