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.
Created attachment 157265 [details] Sample DOC from MSO
Created attachment 157266 [details] Sample DOC seen in MSO
Created attachment 157267 [details] Sample DOCX from MSO
Created attachment 157268 [details] Sample DOCX seen in MSO
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.
Reproduced in Version: 6.5.0.0.alpha0+ 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
This bug may focus on the first line "A Memos..... (continued)", if all is not possible.
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).
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 ***
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).
László Németh committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/7d08767b890e723cd502b1c61d250924f695eb98 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: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
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.
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.
(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).
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.
@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.