From 5316ef725e26133be42f044bdc2229a9071c7c13 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Thu, 13 Jan 2022 11:04:36 +0100 Subject: RTL: lok: render tunneled dialogs mirrored Change-Id: I14d33706eddb99167cf5537f6ece379124187bf2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128371 Reviewed-by: Henry Castro Tested-by: Jenkins CollaboraOffice --- vcl/source/window/paint.cxx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) 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 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 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 ); -- cgit