summaryrefslogtreecommitdiffstats
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-01-11 11:18:07 +0100
commit92d2035acc9d13fea46003a2b2650439d6a2f2fb (patch)
tree6625ef7a0c890226dfed4b5147bcba2d1bab3baf
parentlokCalcRTL: fix editcell tile painting (diff)
downloadcore-92d2035acc9d13fea46003a2b2650439d6a2f2fb.tar.gz
core-92d2035acc9d13fea46003a2b2650439d6a2f2fb.zip
lokCalcRTL: text cursor pos should be mirrored w.r.t output area
Change-Id: Ied4e02d2dd30b7132ea1bc5f0d5b717355ed8b4f
-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 c485b8d64174..55486adf6ac4 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1332,6 +1332,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.