Bug 57187 - EDITING: Justified text looks wrong as right aligned when breaking line with shift+enter
Summary: EDITING: Justified text looks wrong as right aligned when breaking line with ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low minor
Assignee: Mike Kaganski
URL:
Whiteboard: BSA target:24.8.0 target:24.2.0.2
Keywords:
Depends on:
Blocks: Paragraph
  Show dependency treegraph
 
Reported: 2012-11-16 09:03 UTC by Marcin
Modified: 2024-01-31 13:16 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
The first paragraph has no line broken with shift+enter, and the second has one (second line) - you may see the difference (but there should not be any) (10.45 KB, application/vnd.oasis.opendocument.text)
2012-11-16 09:03 UTC, Marcin
Details
examples of right and wrong line breaking with shift+enter (482.23 KB, image/jpeg)
2012-11-16 10:52 UTC, Marcin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin 2012-11-16 09:03:22 UTC
Created attachment 70151 [details]
The first paragraph has no line broken with shift+enter, and the second has one (second line) - you may see the difference (but there should not be any)

Problem description: 

Full-justified text is wrong justified when breaking line with shift+enter. Ending space is moved into text column like letter, which makes text right indented.

Steps to reproduce:

1. in any text do a line-break with shift+enter (before word and after a space)

Current behavior:

See: "Problem description" above

Expected behavior:

Line ending space should not be indented...

Platform (if different from the browser): 
              
Browser: Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20100101 Firefox/16.0
Comment 1 Urmas 2012-11-16 10:08:58 UTC
Strange, the space before linebreak goes to RIGHT edge for me, causing a small indent on the RIGHT.
Please post a screenshot and set the platform accordingly.
Comment 2 Marcin 2012-11-16 10:52:34 UTC
Created attachment 70152 [details]
examples of right and wrong line breaking with shift+enter
Comment 3 Marcin 2012-11-16 10:54:31 UTC
(In reply to comment #1)
> Strange, the space before linebreak goes to RIGHT edge for me, causing a
> small indent on the RIGHT.
> Please post a screenshot and set the platform accordingly.
Of course, that's exactly what I wrote... 
See the screenshot (examples from LibreOffice, MS Word and Adobe InDesign): examples of right and wrong line breaking with shift+enter.jpg above
Comment 4 Urmas 2012-11-16 13:14:55 UTC
Confirmed in 3.7.0.
Comment 5 QA Administrators 2015-01-05 17:51:17 UTC Comment hidden (obsolete)
Comment 6 Marcin 2015-01-05 18:13:23 UTC Comment hidden (obsolete)
Comment 7 Buovjaga 2015-01-29 11:36:57 UTC Comment hidden (obsolete)
Comment 8 Marcin 2015-01-29 17:37:11 UTC
(In reply to Beluga from comment #7)
> Marcin: I noticed that if I delete your linebreak and insert a new one, the
> problem is not observed.
> 
> Can you try reproducing from scratch? Thanks.
> 
> Win 7 Pro 64-bit Version: 4.5.0.0.alpha0+

OK, I tried.
I still confirm this bug as existing in LO 4.3.5.2.
I also confirm it as existing in LO 4.4.0.3 (just upgraded from 4.3.5.2).

BUt

(1) to say the truth, line with linebreak should be displayed properly (or not) without any action, so maybe you've deleted linebreak space also and then add just linebreak?

(2) your version is 4.5... Perhaps that's the reason...?
Comment 9 Buovjaga 2015-01-29 17:42:50 UTC
Excuse me, I did not read the description carefully enough. I deleted the space also.

I can reproduce with the space before line-break.
Comment 10 QA Administrators 2016-02-21 08:35:05 UTC Comment hidden (obsolete)
Comment 11 Marcin 2016-02-21 13:35:36 UTC Comment hidden (obsolete)
Comment 12 QA Administrators 2017-03-06 15:08:18 UTC Comment hidden (obsolete)
Comment 13 Marcin 2017-03-07 10:31:32 UTC Comment hidden (obsolete)
Comment 14 QA Administrators 2018-09-17 02:46:11 UTC Comment hidden (obsolete)
Comment 15 Marcin 2018-09-17 09:50:32 UTC Comment hidden (obsolete)
Comment 16 QA Administrators 2019-09-18 02:54:52 UTC Comment hidden (obsolete)
Comment 17 Marcin 2019-09-18 07:23:52 UTC Comment hidden (obsolete)
Comment 18 Timur 2019-09-18 07:42:18 UTC
Inherited from OO. Minor issue.
Comment 19 QA Administrators 2021-09-18 03:27:01 UTC Comment hidden (obsolete)
Comment 20 Marcin 2021-09-26 10:44:00 UTC
bug still present

Version: 7.2.1.2 (x64) / LibreOffice Community
Build ID: 87b77fad49947c1441b67c559c339af8f3517e22
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: pl-PL
Calc: threaded
Comment 21 [REDACTED] 2022-07-23 07:42:14 UTC
Why does this count as a bug? If you insist on forcing a line break in justified text right after a space, you probably have a good reason for it.
Comment 22 Mike Kaganski 2023-12-26 15:37:41 UTC
(In reply to [REDACTED] from comment #21)

Because this violates the "spaces in the end of the line are not measured to fit" in https://www.unicode.org/reports/tr14/; and also because this is inconsistent with "manual line break is logically absolutely indistinguishable in behavior from automatic line break, except for line breaking position".
Comment 23 Mike Kaganski 2023-12-27 02:43:32 UTC
Note also, that our algorithm violates also the non-tailorable LB6 "Do not break before hard line breaks" rule of UAX #14 [1]: if you have a problematic line with a space followed by a manual line break, and you start adding spaces before the break, at some point the line becomes properly justified, but the break moves to the next line, where it sits alone (so the line gets broken after the last space, *immediately before hard break*).

[1] https://www.unicode.org/reports/tr14/#LB6
Comment 24 Mike Kaganski 2023-12-29 14:06:16 UTC
https://gerrit.libreoffice.org/c/core/+/161400
Comment 25 Commit Notification 2023-12-30 08:51:52 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/853e13f9146e83b959bc53152ec103470d55fb4f

tdf#57187: make sure to put trailing blanks to hole portion in narrow lines

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 26 Commit Notification 2024-01-09 08:57:52 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

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

tdf#57187: make sure to put trailing blanks to hole portion in narrow lines

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.
Comment 27 Marcin 2024-01-31 13:16:09 UTC
it's ok for me now (24.2.0.3).
thanks