summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2021-11-22 14:12:32 +0530
committerAndras Timar <andras.timar@collabora.com>2022-02-14 11:25:43 +0100
commita3176715b03bd285e9791b6ecf839e23856b1413 (patch)
treec6e4729445799fe5b83c7d7f869405870f925ea4 /editeng
parent610d880734cdeff8394540564f257da075a525a5 (diff)
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.francis@collabora.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/impedit.cxx7
1 files changed, 7 insertions, 0 deletions
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.