diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2021-11-22 14:12:32 +0530 |
---|---|---|
committer | Dennis Francis <dennis.francis@collabora.com> | 2022-01-29 05:02:12 +0100 |
commit | 5264f325ab8fc6b7523821a9fc7dd7157a7c66ba (patch) | |
tree | bf369b9980a3b440f0d97c428445d9ed5519ff76 /editeng | |
parent | 09ed49ae42b7c5368d0ef2774ba4e04aeb9bafdb (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.cxx | 7 |
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. |