diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2021-11-22 14:12:32 +0530 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-01-11 11:18:07 +0100 |
commit | 92d2035acc9d13fea46003a2b2650439d6a2f2fb (patch) | |
tree | 6625ef7a0c890226dfed4b5147bcba2d1bab3baf /editeng | |
parent | 8266f569c864ae309f362088d42dfb3b952c4267 (diff) |
lokCalcRTL: text cursor pos should be mirrored w.r.t output area
Change-Id: Ied4e02d2dd30b7132ea1bc5f0d5b717355ed8b4f
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 7 |
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. |