Bug 158900 - A line with a long trailing spaces, followed by manual line break, moves the break to the next line
Summary: A line with a long trailing spaces, followed by manual line break, moves the ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:24.8.0 target:24.2.0.2
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-28 08:17 UTC by Mike Kaganski
Modified: 2024-01-02 11:13 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Spaces in ends of lines (11.98 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-12-28 08:17 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2023-12-28 08:17:18 UTC
Created attachment 191608 [details]
Spaces in ends of lines

The attached DOCX opens as four lines in Word. In Writer, an extra empty line gets inserted after second line.

The reason is that in the second line, after the 1001 spaces inserted after the "Lorem ipsum" text, there is a manual line break. Unlike the first line, which has only 11 spaces after the "Lorem Ipsum" text, the second line's spaces go far beyond the right margin. That makes Writer split the line in the end of the spaces, but it doesn't take care about the following line break.

Note that this behavior is a violation of Unicode Line Breaking Algorithm's non-tailorable rule LB6 "Do not break before hard line breaks".


[1] https://www.unicode.org/reports/tr14/#LB6
Comment 1 Commit Notification 2023-12-28 10:19:08 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#158900: make sure to not break after spaces before \n

It will be available in 24.8.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 2 Commit Notification 2024-01-02 11:13:39 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/89113b1aa39ea064c27b5a67513bade1620ba0d9

tdf#158900: make sure to not break after spaces before \n

It will be available in 24.2.0.2.

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.