diff options
author | Luigi Iucci <luigi.iucci@collabora.com> | 2023-05-26 11:49:59 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-06-05 11:28:22 +0200 |
commit | 6ee03e6dc269c712dc6ed2c3af38ffda6240d0e6 (patch) | |
tree | 50b056b8fbee0e7b42c62cd5b4a838e14eb46b15 /sd | |
parent | 3daad27698f3e91f6e35ba44cd193fc892c12ec9 (diff) |
sd: fix crash deleting 2 slides during paintTile
pPageView was null in SdXImpressDocument::paintTile while trying
to paint form controls, which is a corner case in most cases
then we skip painting in order to avoid a crash
Change-Id: I6c166035220c058fac276f2b7746a8ebc9651f81
(cherry picked from commit 16dbf903a809a6c5b2099c91adca88666228f2cc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152399
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index d52974081ee1..f2bceac96fd4 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2300,11 +2300,14 @@ void SdXImpressDocument::paintTile( VirtualDevice& rDevice, // Draw Form controls SdrView* pDrawView = pViewSh->GetDrawView(); SdrPageView* pPageView = pDrawView->GetSdrPageView(); - SdrPage* pPage = pPageView->GetPage(); - ::sd::Window* pActiveWin = pViewSh->GetActiveWindow(); - ::tools::Rectangle aTileRect(Point(nTilePosX, nTilePosY), Size(nTileWidth, nTileHeight)); - Size aOutputSize(nOutputWidth, nOutputHeight); - LokControlHandler::paintControlTile(pPage, pDrawView, *pActiveWin, rDevice, aOutputSize, aTileRect); + if (pPageView != nullptr) + { + SdrPage* pPage = pPageView->GetPage(); + ::sd::Window* pActiveWin = pViewSh->GetActiveWindow(); + ::tools::Rectangle aTileRect(Point(nTilePosX, nTilePosY), Size(nTileWidth, nTileHeight)); + Size aOutputSize(nOutputWidth, nOutputHeight); + LokControlHandler::paintControlTile(pPage, pDrawView, *pActiveWin, rDevice, aOutputSize, aTileRect); + } comphelper::LibreOfficeKit::setTiledPainting(false); } |