Bug 160170 - FILEOPEN .DOCX: words pulled together, characters overlap in some line of hyphenated paragraph
Summary: FILEOPEN .DOCX: words pulled together, characters overlap in some line of hyp...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.0.2 rc
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:25.2.0 target:24.8.0.0.beta2 t...
Keywords: bibisected, bisected, regression
: 160347 161451 (view as bug list)
Depends on:
Blocks: Hyphenation
  Show dependency treegraph
 
Reported: 2024-03-12 17:04 UTC by Julian Groß
Modified: 2024-07-02 15:02 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of words overlapping each other. (469.24 KB, image/png)
2024-03-12 17:04 UTC, Julian Groß
Details
Example DOCX file exhibiting the behaviour. (19.28 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2024-03-12 17:05 UTC, Julian Groß
Details
Same file converted to PDF by Microsoft Word. (182.13 KB, application/pdf)
2024-03-12 17:06 UTC, Julian Groß
Details
English unit test document (23.20 KB, application/vnd.oasis.opendocument.text-flat-xml)
2024-07-02 00:27 UTC, László Németh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Groß 2024-03-12 17:04:39 UTC
Created attachment 193079 [details]
Screenshot of words overlapping each other.

When opening a DOCX file in LibreOffice, words are seemingly randomly pulled together.
Comment 1 Julian Groß 2024-03-12 17:05:44 UTC
Created attachment 193080 [details]
Example DOCX file exhibiting the behaviour.
Comment 2 Julian Groß 2024-03-12 17:06:41 UTC
Created attachment 193081 [details]
Same file converted to PDF by Microsoft Word.
Comment 3 Julian Groß 2024-03-12 17:08:59 UTC
This happens on LibreOffice 24.2.1.2 from Flathub on postmarketOS Edge (aarch64).

```
Version: 24.2.1.2 (AARCH64) / LibreOffice Community
Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac
CPU threads: 8; OS: Linux 6.6; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Flatpak
Calc: threaded
```
Comment 4 raal 2024-03-13 17:13:26 UTC
No repro with Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 7eebe680068f68d2e4081c2f4d9b290a4524d40a
CPU threads: 4; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded Jumbo
Comment 5 wjsim 2024-03-13 18:26:50 UTC
Hi there, I cannot reproduce it on:

Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac
CPU threads: 16; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 6a064b1967e06e40be40817deff99d00c1a8554f
CPU threads: 16; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

The example docx file attached seems to not exhibit the said behavior on my end.
Comment 6 Julian Groß 2024-03-13 19:12:12 UTC
Looks like this is Flatpak specific then.
The issue also doesn't appear on:

Version: 24.2.0.3 (X86_64) / LibreOffice Community
Build ID: 420(Build:3)
CPU threads: 32; OS: Linux 6.6; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Debian package version: 4:24.2.0-1
Calc: threaded

it does however also appear on:
Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac
CPU threads: 32; OS: Linux 6.6; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Flatpak
Calc: threaded
Comment 7 Stéphane Guillou (stragu) 2024-03-28 05:47:22 UTC
*** Bug 160347 has been marked as a duplicate of this bug. ***
Comment 8 Stéphane Guillou (stragu) 2024-03-28 06:02:00 UTC
Confirmed with:

Version: 24.2.2.1 (X86_64) / LibreOffice Community
Build ID: bf759d854b5ab45b6ef0bfd22e51c6dc4fb8b882
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 2146e66d8df2b7b6a2dd868e886cae76aaf7f48b
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded

... installed from deb, so unrelated to Flatpak.
I have this extension installed to support German hyphenation:

https://extensions.libreoffice.org/en/extensions/show/german-de-de-frami-dictionaries

Not reproduced with 7.6.5.2 -> regression.

Bibisected with linux-64-24.2 repo to first bad build [817bca5601e09a41cad2cbcb897f95b33e61f673] which points to 8d247e3ad47e0b828437abb019e1573dbb1c05b1 which is a cherrypick of:

commit 36bfc86e27fa03ee16f87819549ab126c5a68cac
author	László Németh 	Tue Dec 19 11:58:40 2023 +0100
committer	László Németh 	Tue Dec 19 22:18:13 2023 +0100
tdf#119908 tdf#158776 sw smart justify: shrink only spaces
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160988

László, can you please have a look?
Comment 9 Stéphane Guillou (stragu) 2024-03-28 06:04:30 UTC
Same on Windows 11 with 24.2.1, same extension and attachment 193080 [details].
Comment 10 Mike Kaganski 2024-03-28 06:23:41 UTC
(In reply to Stéphane Guillou (stragu) from comment #8)
> I have this extension installed to support German hyphenation:
> 
> https://extensions.libreoffice.org/en/extensions/show/german-de-de-frami-
> dictionaries

Reproducible with Version: 24.2.2.2 (X86_64) / LibreOffice Community
Build ID: d56cc158d8a96260b836f100ef4b4ef25d6f1a01
CPU threads: 24; OS: Windows 10.0 Build 22631; UI render: default; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL threaded

with only the *bundled* German (Austria, Germany, Switzerland) spelling dictionaries, hyphenation rules, and thesaurus 2017.01.12.
Comment 11 Commit Notification 2024-06-12 21:13:54 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

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

tdf#160170 sw: fix overshrunk justified lines at hyphenation

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 László Németh 2024-06-12 21:18:24 UTC
Fixed in the master (already likely by Caolán McNamara's commit, too, see "stale hyphenation data after skipping blanks), and started to back-port to 24.2.

@Julian and all: thanks for your bug report and feedback!

Full commit description:

tdf#160170 sw: fix overshrunk justified lines at hyphenation

Smart justify uses 2 SwTextGuess::Guess() calls to break a
line, but using the same SwTextGuess object resulted overshrunk
lines, if the first call resulted hyphenation, because of the
bad state of the object for the second call. If we need a
second call, now instantiate a new object for it.

Regression from commit 36bfc86e27fa03ee16f87819549ab126c5a68cac
"tdf#119908 tdf#158776 sw smart justify: shrink only spaces".

Note: the reported test document was already fixed by
commit f050103c3324d878b310f37429ea3580a8230905
"stale hyphenation data after skipping blanks".
Comment 13 Commit Notification 2024-06-13 09:43:39 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/3fdbc6083336f84ed7fa55fb0ec3fd0288382967

tdf#160170 sw: fix overshrunk justified lines at hyphenation

It will be available in 24.8.0.0.beta2.

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 14 Stéphane Guillou (stragu) 2024-06-14 03:13:59 UTC
Verified in:

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 0e2409e5e3c73ec25c61aa4ea140d114869ea512
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded

Thank you László!
Comment 15 László Németh 2024-06-14 10:55:10 UTC
(In reply to Stéphane Guillou (stragu) from comment #14)
> Verified in:
> 
> Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
> Build ID: 0e2409e5e3c73ec25c61aa4ea140d114869ea512
> CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
> Locale: en-AU (en_AU.UTF-8); UI: en-US
> Calc: CL threaded
> 
> Thank you László!

@Stéphane: thanks for the verification and feedback! Also thanks to Caolán McNamara, whose work was likely an alternative solution before my commit!
Comment 16 László Németh 2024-06-14 14:51:53 UTC
*** Bug 161451 has been marked as a duplicate of this bug. ***
Comment 17 Commit Notification 2024-06-27 16:35:15 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

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

tdf#160170 sw: fix overshrunk justified lines at hyphenation

It will be available in 24.2.5.

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 18 Commit Notification 2024-07-01 18:37:41 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/83733601124f611938c365426485d0001e1fe454

tdf#160170 sw: test for fix overshrank lines with hyphenation

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 19 László Németh 2024-07-02 00:27:46 UTC
Created attachment 195076 [details]
English unit test document