sd: fix crash in DrawViewShell::ExecCtrl

See https://crashreport.libreoffice.org/stats/signature/sd::DrawViewShell::ExecCtrl(SfxRequest%20&)

I believe this crash is triggered with some basic code while
slideshow is running.
Anyway, if I delete the previous SlideShow::IsRunning(GetViewShellBase())
check, launch Impress and add a new slide, LibreOfice also crashes.

Change-Id: Iba40f37485a4a6815729a1a26c380b6c3fdedfd4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150097
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Xisco Fauli
2023-04-06 14:07:37 +02:00
parent bd17c9c949
commit 681c08523c
+2 -2
View File
@@ -140,8 +140,8 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
// switch page in running slide show
if(SlideShow::IsRunning(GetViewShellBase()) && rReq.GetArgs())
{
const SfxUInt32Item* pWhatPage = rReq.GetArg<SfxUInt32Item>(ID_VAL_WHATPAGE);
SlideShow::GetSlideShow(GetViewShellBase())->jumpToPageNumber(static_cast<sal_Int32>((pWhatPage->GetValue()-1)>>1));
if (const SfxUInt32Item* pWhatPage = rReq.GetArg<SfxUInt32Item>(ID_VAL_WHATPAGE))
SlideShow::GetSlideShow(GetViewShellBase())->jumpToPageNumber(static_cast<sal_Int32>((pWhatPage->GetValue()-1)>>1));
}
else
{