vcl/source/window/cursor.cxx |   15 ++++++++++++++-
 vcl/source/window/paint.cxx  |   19 +++++++++++++------
 2 files changed, 27 insertions(+), 7 deletions(-)

New commits:
commit c892b224bee72c35e145f0f190b3fec64ac343e1
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Thu Jan 13 19:58:34 2022 +0100
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Mon Jan 24 09:46:10 2022 +0100

    RTL: lok: mirror cursor position when needed
    
    Change-Id: I3e574e1b1d5e26528794c39cb631d8f5cf60e927
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128390
    Reviewed-by: Henry Castro <hcas...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128836
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

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());
     }
 
commit 26a57a59b9ca8af2f9584e292f03655c02fc2698
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Thu Jan 13 11:04:36 2022 +0100
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Mon Jan 24 09:45:56 2022 +0100

    RTL: lok: render tunneled dialogs mirrored
    
    Change-Id: I14d33706eddb99167cf5537f6ece379124187bf2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128371
    Reviewed-by: Henry Castro <hcas...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128835
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index b2b7db7b6557..49fd65f8c5fe 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1211,13 +1211,14 @@ void Window::PixelInvalidate(const tools::Rectangle* 
pRectangle)
     {
         // In case we are routing the window, notify the client
         std::vector<vcl::LOKPayloadItem> aPayload;
+        tools::Rectangle aRect(Point(0, 0), aSize);
         if (pRectangle)
-            aPayload.emplace_back("rectangle", pRectangle->toString());
-        else
-        {
-            const tools::Rectangle aRect(Point(0, 0), aSize);
-            aPayload.emplace_back("rectangle", aRect.toString());
-        }
+            aRect = *pRectangle;
+
+        if (IsRTLEnabled() && GetOutDev() && 
!GetOutDev()->ImplIsAntiparallel())
+            GetOutDev()->ReMirror(aRect);
+
+        aPayload.emplace_back("rectangle", aRect.toString());
 
         pNotifier->notifyWindow(GetLOKWindowId(), "invalidate", aPayload);
     }
@@ -1353,6 +1354,7 @@ void Window::ImplPaintToDevice( OutputDevice* 
i_pTargetOutDev, const Point& i_rP
     if (comphelper::LibreOfficeKit::isActive())
     {
         VclPtrInstance<VirtualDevice> pDevice(*i_pTargetOutDev);
+        pDevice->EnableRTL(IsRTLEnabled());
 
         Size aSize(GetOutputSizePixel());
         pDevice->SetOutputSizePixel(aSize);
@@ -1405,6 +1407,8 @@ void Window::ImplPaintToDevice( OutputDevice* 
i_pTargetOutDev, const Point& i_rP
 
         i_pTargetOutDev->DrawOutDev(i_rPos, aSize, Point(), 
pDevice->PixelToLogic(aSize), *pDevice);
 
+        bool bHasMirroredGraphics = pDevice->HasMirroredGraphics();
+
         // get rid of virtual device now so they don't pile up during 
recursive calls
         pDevice.disposeAndClear();
 
@@ -1414,6 +1418,9 @@ void Window::ImplPaintToDevice( OutputDevice* 
i_pTargetOutDev, const Point& i_rP
             if( pChild->mpWindowImpl->mpFrame == mpWindowImpl->mpFrame && 
pChild->IsVisible() )
             {
                 tools::Long nDeltaX = pChild->GetOutDev()->mnOutOffX - 
GetOutDev()->mnOutOffX;
+                if( bHasMirroredGraphics )
+                    nDeltaX = GetOutDev()->mnOutWidth - nDeltaX - 
pChild->GetOutDev()->mnOutWidth;
+
                 tools::Long nDeltaY = pChild->GetOutDev()->mnOutOffY - 
GetOutDev()->mnOutOffY;
 
                 Point aPos( i_rPos );

Reply via email to