From dee282441f3483c49759caff73ed3e1cde13f58d Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Mon, 4 Oct 2021 12:25:56 +0200 Subject: lok: fix crash on chart doubleclick in patchPaintWindow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit backtrace: SdrPageWindow::patchPaintWindow(SdrPaintWindow&) (this=0x0, rPaintWindow=...) at svx/source/svdraw/sdrpagewindow.cxx:168 SdXImpressDocument::paintTile(VirtualDevice&, int, int, int, int, long, long) (this=0x64589d0, rDevice=..., nOutputWidth=180, nOutputHeight=135, nTilePosX=0, nTilePosY=0, nTileWidth=15875, nTileHeight=11906) at sd/source/ui/unoidl/unomodel.cxx:2240 Change-Id: Ie5270c3cc4a40121485d5da756a498ec4fd8bf80 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123044 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123134 Tested-by: Jenkins --- sd/source/ui/unoidl/unomodel.cxx | 3 ++- svx/source/svdraw/sdrpagewindow.cxx | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index d064f6434c98..a7d1e8568168 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2223,7 +2223,8 @@ void SdXImpressDocument::paintTile( VirtualDevice& rDevice, { patchedPageWindow = pSdrPageView->FindPageWindow(*getDocWindow()->GetOutDev()); temporaryPaintWindow.reset(new SdrPaintWindow(*pDrawView, rDevice)); - previousPaintWindow = patchedPageWindow->patchPaintWindow(*temporaryPaintWindow); + if (patchedPageWindow) + previousPaintWindow = patchedPageWindow->patchPaintWindow(*temporaryPaintWindow); } } diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx index 428faa990f39..aeb337d7a8e5 100644 --- a/svx/source/svdraw/sdrpagewindow.cxx +++ b/svx/source/svdraw/sdrpagewindow.cxx @@ -167,6 +167,9 @@ rtl::Reference< sdr::overlay::OverlayManager > const & SdrPageWindow::GetOverlay SdrPaintWindow* SdrPageWindow::patchPaintWindow(SdrPaintWindow& rPaintWindow) { + if (!mpImpl) + return nullptr; + if (!mpImpl->mpOriginalPaintWindow) { // first patch -- cgit