From b4d36ba6e813d4fffadf277572d6e543dff7c827 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Fri, 18 Oct 2024 01:32:08 +0200 Subject: tdf#163486: PVS: check mpViewSh V595 The 'mpViewSh' pointer was utilized before it was verified against nullptr. Check lines: 704, 713. Change-Id: I5c1902d9aa9a33e62cf2aa559bab9c0b3f45f688 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175112 Tested-by: Jenkins Reviewed-by: Xisco Fauli (cherry picked from commit eeca3ea10109aeea45d7da279c05ef278d4e2cd0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175056 Reviewed-by: Michael Stahl --- sd/source/ui/view/sdview.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index cfa0fa909f5a..0cb038aa8ba1 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -700,10 +700,13 @@ bool View::SdrBeginTextEdit( pOutl->SetDefaultLanguage( Application::GetSettings().GetLanguageTag().getLanguageType() ); } - // check if we have IASS active and propagate that info to the view with the active TextEdit - rtl::Reference< SlideShow > xSlideshow(SlideShow::GetSlideShow(mpViewSh->GetViewShellBase())); - const bool bIASS(xSlideshow.is() && xSlideshow->isRunning() && xSlideshow->IsInteractiveSlideshow()); - setInteractiveSlideShow(bIASS); + if (mpViewSh) + { + // check if we have IASS active and propagate that info to the view with the active TextEdit + rtl::Reference< SlideShow > xSlideshow(SlideShow::GetSlideShow(mpViewSh->GetViewShellBase())); + const bool bIASS(xSlideshow.is() && xSlideshow->isRunning() && xSlideshow->IsInteractiveSlideshow()); + setInteractiveSlideShow(bIASS); + } bool bReturn = FmFormView::SdrBeginTextEdit( pObj, pPV, pWin, bIsNewObj, pOutl, -- cgit