vcl/source/app/salvtables.cxx |   21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

New commits:
commit cf5b0d5972b02809e9b7f35780885445242b3f12
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Mon Jan 17 13:11:19 2022 +0100
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Mon Feb 7 09:01:00 2022 +0100

    RTL: lok: render correctly interim windows
    
    Change-Id: Iec23fba24464c6d29ecb63d3d2018ded8d9937f1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128500
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129495
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index ec8f27366a19..778901f85d37 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1307,6 +1307,8 @@ void SalInstanceWidget::DoRecursivePaint(vcl::Window* 
pWindow, const Point& rRen
             break;
     }
 
+    bool bHasMirroredGraphics = pWindow->GetOutDev()->HasMirroredGraphics();
+
     xOutput.disposeAndClear();
 
     pWindow->EnableMapMode(bOldMapModeEnabled);
@@ -1317,11 +1319,20 @@ void SalInstanceWidget::DoRecursivePaint(vcl::Window* 
pWindow, const Point& rRen
     {
         if (!pChild->IsVisible())
             continue;
-        Point aRelPos(pChild->GetPosPixel());
-        Size aRelLogicOffset(rOutput.PixelToLogic(Size(aRelPos.X(), 
aRelPos.Y())));
-        DoRecursivePaint(pChild,
-                         rRenderLogicPos + Point(aRelLogicOffset.Width(), 
aRelLogicOffset.Height()),
-                         rOutput);
+
+        tools::Long nDeltaX
+            = pChild->GetOutDev()->GetOutOffXPixel() - 
pWindow->GetOutDev()->GetOutOffXPixel();
+        if (bHasMirroredGraphics)
+            nDeltaX = pWindow->GetOutDev()->GetOutputWidthPixel() - nDeltaX
+                      - pChild->GetOutDev()->GetOutputWidthPixel();
+
+        tools::Long nDeltaY
+            = pChild->GetOutDev()->GetOutOffYPixel() - 
pWindow->GetOutDev()->GetOutOffYPixel();
+
+        Point aPos(rRenderLogicPos);
+        aPos += rOutput.PixelToLogic(Point(nDeltaX, nDeltaY));
+
+        DoRecursivePaint(pChild, aPos, rOutput);
     }
 }
 

Reply via email to