vcl/source/window/paint.cxx |   19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

New commits:
commit 5316ef725e26133be42f044bdc2229a9071c7c13
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 17 10:05:36 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>

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 425c6c19118c..ea11451d99b9 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1234,13 +1234,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() && !ImplIsAntiparallel())
+            GetOutDev()->ReMirror(aRect);
+
+        aPayload.emplace_back("rectangle", aRect.toString());
 
         pNotifier->notifyWindow(GetLOKWindowId(), "invalidate", aPayload);
     }
@@ -1376,6 +1377,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);
@@ -1428,6 +1430,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();
 
@@ -1437,6 +1441,9 @@ void Window::ImplPaintToDevice( OutputDevice* 
i_pTargetOutDev, const Point& i_rP
             if( pChild->mpWindowImpl->mpFrame == mpWindowImpl->mpFrame && 
pChild->IsVisible() )
             {
                 tools::Long nDeltaX = pChild->mnOutOffX - mnOutOffX;
+                if( bHasMirroredGraphics )
+                    nDeltaX = mnOutWidth - nDeltaX - pChild->mnOutWidth;
+
                 tools::Long nDeltaY = pChild->mnOutOffY - mnOutOffY;
 
                 Point aPos( i_rPos );

Reply via email to