Bug 151336 - Wrong cursor placement when moving past LTR to RTL paragraph
Summary: Wrong cursor placement when moving past LTR to RTL paragraph
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Jonathan Clark
URL:
Whiteboard: target:25.8.0
Keywords:
Depends on:
Blocks: RTL-UI
  Show dependency treegraph
 
Reported: 2022-10-04 15:22 UTC by Eyal Rozenberg
Modified: 2025-05-16 09:16 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Presentation for easy reproduction of the bug (14.21 KB, application/vnd.oasis.opendocument.presentation)
2022-10-04 15:24 UTC, Eyal Rozenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2022-10-04 15:22:41 UTC
Reproduction instruction:

1. Create a new Impress presentation
2. Add two paragraphs with text to the main textbox on the first slide (e.g. "LTR paragraph" and "RTL paragraph" respectively.
3. Switch the second paragraph's direction to RTL
4. Place cursor in the first paragraph, one character before the end.
5. Press the right arrow key.
6. Press the right arrow key.

Expected results: The cursor should be - logically and visually - at the start of the second paragraph (i.e. on the right edge of its single line). This is what happens in Writer.

Actual results: The cursor is on the left edge of the second paragraph's single line.
Comment 1 Eyal Rozenberg 2022-10-04 15:24:51 UTC
Created attachment 182828 [details]
Presentation for easy reproduction of the bug

In this presentation, just perform the cursor placement and movement from the first to the second paragraph.
Comment 2 QA Administrators 2024-10-21 03:15:46 UTC Comment hidden (obsolete)
Comment 3 Jonathan Clark 2025-05-15 12:36:07 UTC
Looks like an oversight. There is special logic in Edit Engine to correctly position the cursor when the home and end keys are pressed, but it's not applied when the cursor moves to the prev/next paragraphs.
Comment 4 Commit Notification 2025-05-16 09:15:44 UTC
Jonathan Clark committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1d70690e304cd3321d6c5a14e28df717e3d315d9

tdf#151336 editeng: Fix bad cursor pos when moving to RTL paragraph

It will be available in 25.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.