diff options
author | Armin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de> | 2024-04-16 16:26:07 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2024-04-16 18:12:25 +0200 |
commit | 1e1a3825d76ed8071424e8e21bbda23464c10fff (patch) | |
tree | 645a600eff74e0987a29d6ef6d40ffd1589e748a | |
parent | 1d5630c5deeec5dca724c29ec8c886bfa71a2099 (diff) |
tdf#160589: compare the correct OutDev with PageWindows
Change-Id: I29d9c60cac04536bb2d5ad2ed1c086c8e67a9f20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166151
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
-rw-r--r-- | sc/source/ui/inc/output.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/output.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/output3.cxx | 8 |
3 files changed, 9 insertions, 1 deletions
diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx index b94fbb1ec7ac..e19bc6f58100 100644 --- a/sc/source/ui/inc/output.hxx +++ b/sc/source/ui/inc/output.hxx @@ -187,6 +187,7 @@ private: void adjustForHyperlinkInPDF(Point aURLStart, const OutputDevice* pDev); }; + VclPtr<OutputDevice> mpOriginalTargetDevice; // 'unpatched' TargetDevice VclPtr<OutputDevice> mpDev; // Device VclPtr<OutputDevice> mpRefDevice; // printer if used for preview VclPtr<OutputDevice> pFmtDevice; // reference for text formatting diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index bf02db1fd32f..797f58ba4712 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -142,6 +142,7 @@ ScOutputData::ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType, SCCOL nNewX1, SCROW nNewY1, SCCOL nNewX2, SCROW nNewY2, double nPixelPerTwipsX, double nPixelPerTwipsY, const Fraction* pZoomX, const Fraction* pZoomY ) : + mpOriginalTargetDevice( pNewDev ), mpDev( pNewDev ), mpRefDevice( pNewDev ), // default is output device pFmtDevice( pNewDev ), // default is output device diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx index bc6efec65400..760a62a12d1d 100644 --- a/sc/source/ui/view/output3.cxx +++ b/sc/source/ui/view/output3.cxx @@ -206,7 +206,13 @@ void ScOutputData::DrawSelectiveObjects(SdrLayerID nLayer) if(pPageView) { - if (nullptr != pPageView->FindPageWindow(*mpDev)) + // tdf#160589 need to check for registered PaintWindow using the + // 'original' TragetDevice, mpDev might have been changed by a + // call to ::SetContentDevice. That again might patch in a + // pre-render device fetched from SdrPaintWindow::GetTargetOutputDevice + // and thus the test if target is aregistered PageWindow would fail + assert(nullptr != mpOriginalTargetDevice && "mpOriginalTargetDevice *must* be set when constructing ScOutputData (!)"); + if (nullptr != pPageView->FindPageWindow(*mpOriginalTargetDevice)) { // Target OutputDevice is registered for this view // (as it should be), we can just render |