Description: If I insert text of the opposite direction to the paragraph direction (i.e., RTL text in an LTR paragraph or LTR text in an RTL paragraph) towards the end of the line, the opposite-direction word correctly wraps to the next line. If, however, I then try to change the formatting of some of the characters of the opposite-direction wrapped word (e.g., bold, italics, strikethrough, etc.), then the word breaks in the middle and stops wrapping. (I am also experiencing a problem where sometimes undoing the formatting results in the word wrapping correctly again, and sometimes not. I cannot figure out when the wrapping is fixed and when it is not.) Steps to Reproduce: 1. Type a line of text in whatever the current text orientation is (e.g., English in LTR orientation, Hebrew/Arabic in RTL orientation). 2. As you get towards the end of the line, switch to the opposite orientation language (e.g., if the paragraph is LTR, switch to Hebrew/Arabic; if the paragraph is RTL, switch to English). Type enough letters to wrap the word to the next line. 3. Select several of the characters toward the beginning of the wrapped word. Bold or italicize the text. Actual Results: The word stops wrapping to the next line, but splits in the middle. Expected Results: The word should continue wrapping on the next line. Reproducible: Always User Profile Reset: No Additional Info: Version: 7.6.2.1 (X86_64) / LibreOffice Community Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333 CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win Locale: en-US (en_US); UI: en-US Calc: CL threaded
Created attachment 190301 [details] File with text to experiment on Here is an example of text on which the problem occurs. To see the bug, select the first few Hebrew letters of the first line and change their formatting, and select the first few English letters of the second line and change their formatting.
Created attachment 190302 [details] Video demonstrating the bug Here's a video demonstrating the problem. You can see both problems: the initial bold breaks the word wrap, but un-bolding fixes it. But then italicizing breaks the word wrap, but un-italicizing does not fix the wrap. Undo, however, does fix the wrap. The same occurs in with the LTR text in an RTL paragraph, but in that case un-bolding doesn't fix the wrap.
Created attachment 190303 [details] Bigger video demonstrating the problem Here's the same video above, but in a different format that's larger and easier to see. (VLC can open this format.)
Reproduced already with 5.2 and 3.5. Arch Linux 64-bit, X11 Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 86f0d88025262b0cfb519545ae7956f6ecea16f9 CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+xcb) Locale: fi-FI (fi_FI.UTF-8); UI: en-US Calc: threaded Built on 30 October 2023
Seeing this with: Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 3161a6c351a2f5f70c0420ee8cccf2eb23de1ecf CPU threads: 4; OS: Linux 6.5; UI render: default; VCL: gtk3 Locale: he-IL (en_IL); UI: en-US Calc: threaded it's weird that the wrapping doesn't even occur at the boundary of the boldfaced text; doing that switches LO to enabling wrapping at an arbitrary point in the Hebrew sequence. But... the question is, why is that not the behavior in the first place? If I replace the Hebrew sequence with "bcdefghijklmnopqrstuvwxyz", that wraps after the "j" character.
Eyal, do you mean that you replaced the sequence אבגדהוזחטיכלמנ after the string of "a"s in the LTR text with "bcdefghijklmnopqrstuvwxyz"? When I do so, that entire sequence of letters wraps as well, as it should. Are you sure you didn't accidentally delete the space after the colon after the last "a"? The current behavior -- wrapping entire RTL words in LTR sequences just as LTR words are wrapped (and the reverse) is correct; the question is why the wrapping breaks when part of the wrapped RTL word is bolded (or italicized or whatever).
(In reply to William Friedman from comment #6) > Eyal, do you mean that you replaced the sequence אבגדהוזחטיכלמנ after the > string of "a"s in the LTR text with "bcdefghijklmnopqrstuvwxyz"? When I do > so, that entire sequence of letters wraps as well, as it should. Are you > sure you didn't accidentally delete the space after the colon after the last > "a"? Oh, actually, I did. Good catch, sorry. Let readers also note that, in attachment 190301 [details], there is a space after the "a", so, indeed, the word's characters should be kept together.
Jonathan Clark committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/04184aa7e3aada8f4d938d20dfdb54b3a7dd3896 tdf#157829 sw: Implemented line break underflow for bidi portions 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.
(In reply to Commit Notification from comment #8) So, you're on a roll with that bidi portion underflow... :-) (for those who haven't noticed: bug 56408 comment 33 ; I'll even link the two bugs)
Jonathan Clark committed a patch related to this issue. It has been pushed to "libreoffice-24-8": https://git.libreoffice.org/core/commit/a38e6e65057f0380f07dae724be3b8b33ca3afee tdf#157829 sw: Implemented line break underflow for bidi portions It will be available in 24.8.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.