Bug 130088 - Fileopen DOC/DOCX: Simple text different width in Writer (multiple lines) and Word (single line) for Microsoft fonts
Summary: Fileopen DOC/DOCX: Simple text different width in Writer (multiple lines) and...
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
Whiteboard: target:24.2.0
Keywords: filter:doc, filter:docx
Depends on:
Blocks: 119908
  Show dependency treegraph
Reported: 2020-01-20 11:56 UTC by Timur
Modified: 2023-11-27 14:12 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:

Sample DOC from MSO (41.50 KB, application/msword)
2020-01-20 11:57 UTC, Timur
Sample DOC seen in MSO (86.86 KB, image/jpeg)
2020-01-20 11:57 UTC, Timur
Sample DOCX from MSO (23.64 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-01-20 11:57 UTC, Timur
Sample DOCX seen in MSO (86.91 KB, image/jpeg)
2020-01-20 11:58 UTC, Timur

Note You need to log in before you can comment on or make changes to this bug.
Description Timur 2020-01-20 11:56:36 UTC
Open attached DOC and DOCX and see that simple text has different width in Writer (multiple lines) and Word (single line) for Microsoft fonts.

Normally we have different bugs for DOC and DOCX but let's first wee what's gonna happen here.

This is offshoot from bug 93977, with simplified example.
Bug 94801 and bug 130087 are for tables, so different.
Comment 1 Timur 2020-01-20 11:57:08 UTC
Created attachment 157265 [details]
Sample DOC from MSO
Comment 2 Timur 2020-01-20 11:57:29 UTC
Created attachment 157266 [details]
Sample DOC seen in MSO
Comment 3 Timur 2020-01-20 11:57:51 UTC
Created attachment 157267 [details]
Sample DOCX from MSO
Comment 4 Timur 2020-01-20 11:58:28 UTC
Created attachment 157268 [details]
Sample DOCX seen in MSO
Comment 5 Timur 2020-01-20 12:00:51 UTC
Note: Check if DOCX the same issue as:
1. DOCX attachment 123358 [details] from Bug 98480 (multiple issues) for "Secteur d’activité de l’organisme" and following spaces on 1st page.
2. DOCX attachment 90934 [details] from Bug 72837 (that was compared as attachment 90935 [details])  for "Форма по ОКУД" position.
Comment 6 Xisco Faulí 2020-01-20 18:37:36 UTC
Reproduced in

Build ID: fc1f85127968d1c2e0a53dace51bf8a78f9e6ca5
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded

using the docx file
Comment 7 Timur 2020-01-20 20:22:51 UTC
This bug may focus on the first line "A Memos..... (continued)", if all is not possible.
Comment 8 NISZ LibreOffice Team 2020-12-01 10:13:53 UTC
The first paragraph is justified aligned, nothing else interesting about it.
In Writer removing the last ) from this line makes the line break go away.
My bet is on bug #38159 being in action here (too).
Comment 9 Justin L 2023-05-26 19:39:20 UTC
It isn't likely the 2013 smart justify for DOC format, but the concept is the same and should be taken into consideration when redesigning justify.

*** This bug has been marked as a duplicate of bug 119908 ***
Comment 10 László Németh 2023-10-17 08:36:54 UTC
Bug 119908 will be solved in two steps, and the first step is the line count compatibility, and this bug is reopened for that temporarily (and focus only on DOCX).
Comment 11 Commit Notification 2023-10-17 08:38:29 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":


tdf#130088 tdf#119908 smart justify: fix DOCX line count + compat opt.

It will be available in 24.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.
Comment 12 László Németh 2023-10-17 09:14:24 UTC
Note: please, don't modify the test document of testFloattableAvoidManipOfst, as suggested by the fix. According to Miklós Vajna in https://gerrit.libreoffice.org/c/core/+/158063/comments/fbd095f4_8c1adb9a, that is not the right fix for that test broken accidentally by the fix of the line break positions.
Comment 13 Timur 2023-10-19 15:29:48 UTC
I tested with todays build and:
DOC attachment 157265 [details] is unchanges, as expected, since fix is for DOCX
DOCX attachment 157267 [details] has no change in the first line "A Memos..... (continued)", which is still 2 lines.
DOCX attachment 157267 [details] has change in "Other County Departments A7" which is 1 line now, not aligned right.
DOCX attachment 123358 [details] for "Secteur d’activité de l’organisme" etc still has following spaces thant make it to 2nd line.
DOCX attachment 90934 [details] for "Форма по ОКУД" position still NOK.
Comment 14 László Németh 2023-10-23 14:42:54 UTC
(In reply to Timur from comment #13)

@Timur: Many thanks for testing and the detailed feedback! The lines with multiple formatting haven't been handled, yet, but the next commits will fix those, too. (the ("continued") are smaller font size in "A Memos..... (continued)"). I'm very glad of the fix of "Other County Departments A7". Likely the ToC contains more issues, than the different justification algorithm. The plan is to file new issues for the possible problems remaining after the fix of Bug 119908 (e.g. complex cases with hyphenation and direct formatting).
Comment 15 Timur 2023-11-17 10:19:35 UTC
I tested again after related bug was fixed and I see no change to the previous test for any of the samples. 
I cannot see what this was closed, what the commit relates to fomr here.
Comment 16 László Németh 2023-11-27 14:12:30 UTC
@Timur: Thanks for your feedback! See unit test document of this fix: https://bugs.documentfoundation.org/attachment.cgi?id=190989 (attached to the Issue 158333), which solved the extra lines/pages problem, but not for multiple text portion, yet, which could result the difference here.

Issue 158333 solved the multiple text portion case, too, so it's worth to check the original test document of the issue after that fix, too.