editeng/source/editeng/impedit.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 5264f325ab8fc6b7523821a9fc7dd7157a7c66ba
Author:     Dennis Francis <dennis.fran...@collabora.com>
AuthorDate: Mon Nov 22 14:12:32 2021 +0530
Commit:     Dennis Francis <dennis.fran...@collabora.com>
CommitDate: Sat Jan 29 05:02:12 2022 +0100

    lokCalcRTL: text cursor pos should be mirrored w.r.t output area
    
    Change-Id: Ied4e02d2dd30b7132ea1bc5f0d5b717355ed8b4f
    (cherry picked from commit 92d2035acc9d13fea46003a2b2650439d6a2f2fb)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128897
    Tested-by: Jenkins
    Reviewed-by: Dennis Francis <dennis.fran...@collabora.com>

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 3b44e851b821..267045460073 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1339,6 +1339,13 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
                 Point aRefPointLogical = GetOutputArea().TopLeft();
                 // Get the relative coordinates w.r.t refpoint in display hmm.
                 aCursorRectPureLogical.Move(-aRefPointLogical.X(), 
-aRefPointLogical.Y());
+                if (pEditEngine->IsRightToLeft(nPara))
+                {
+                    tools::Long nMirrorW = GetOutputArea().GetWidth();
+                    tools::Long nLeft = aCursorRectPureLogical.Left(), nRight 
= aCursorRectPureLogical.Right();
+                    aCursorRectPureLogical.SetLeft(nMirrorW - nRight);
+                    aCursorRectPureLogical.SetRight(nMirrorW - nLeft);
+                }
                 // Convert to twips.
                 aCursorRectPureLogical = 
OutputDevice::LogicToLogic(aCursorRectPureLogical, MapMode(eDevUnit), 
MapMode(MapUnit::MapTwip));
                 // "refpoint" in print twips.

Reply via email to