diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2022-01-13 11:04:36 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2022-01-24 09:45:56 +0100 |
commit | 26a57a59b9ca8af2f9584e292f03655c02fc2698 (patch) | |
tree | 5588151e3133a20cb7f358fedaf102f8da853287 /vcl/source/window | |
parent | 74c80afa8544be52bce20b93aec982a3c64d233f (diff) |
RTL: lok: render tunneled dialogs mirrored
Change-Id: I14d33706eddb99167cf5537f6ece379124187bf2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128371
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128835
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'vcl/source/window')
-rw-r--r-- | vcl/source/window/paint.cxx | 19 |
1 files changed, 13 insertions, 6 deletions
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 ); |