summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2022-01-13 19:58:34 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2022-01-24 09:46:10 +0100
commitc892b224bee72c35e145f0f190b3fec64ac343e1 (patch)
treed3a296ba703193e96f32e2740b7c185ab80a8ef1
parent26a57a59b9ca8af2f9584e292f03655c02fc2698 (diff)
RTL: lok: mirror cursor position when needed
Change-Id: I3e574e1b1d5e26528794c39cb631d8f5cf60e927 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128390 Reviewed-by: Henry Castro <hcastro@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128836 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r--vcl/source/window/cursor.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index 09406b927e00..45f2f6d46282 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -256,7 +256,20 @@ void vcl::Cursor::LOKNotify( vcl::Window* pWindow, const OUString& rAction )
if (!aSize.Width())
aSize.setWidth( pWindow->GetSettings().GetStyleSettings().GetCursorSize() );
- const tools::Rectangle aRect(Point(nX, nY), aSize);
+ Point aPos(nX, nY);
+
+ if (pWindow->IsRTLEnabled() && pWindow->GetOutDev() && pParent->GetOutDev()
+ && !pWindow->GetOutDev()->ImplIsAntiparallel())
+ pParent->GetOutDev()->ReMirror(aPos);
+
+ if (!pWindow->IsRTLEnabled() && pWindow->GetOutDev() && pParent->GetOutDev()
+ && pWindow->GetOutDev()->ImplIsAntiparallel())
+ {
+ pWindow->GetOutDev()->ReMirror(aPos);
+ pParent->GetOutDev()->ReMirror(aPos);
+ }
+
+ const tools::Rectangle aRect(aPos, aSize);
aItems.emplace_back("rectangle", aRect.toString());
}