From a5e08f0631b7cd3976c9fc1afe8317ecc3b406a2 Mon Sep 17 00:00:00 2001 From: Sarper Akdemir Date: Fri, 19 Apr 2024 00:40:28 +0200 Subject: related tdf#33603: sd: do not assume there's always a viewshell Change-Id: I171639150a84372e7e25b5246d4882c467edd58b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166271 Tested-by: Jenkins Reviewed-by: Sarper Akdemir --- sd/source/ui/view/sdwindow.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index 5c64e4d1dda4..753e6921e461 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -738,7 +738,8 @@ void Window::LoseFocus() { mnTicks = 0; vcl::Window::LoseFocus (); - GetViewShell()->onLoseFocus(); + if (mpViewShell) + mpViewShell->onLoseFocus(); } /** @@ -748,7 +749,8 @@ void Window::GrabFocus() { mnTicks = 0; vcl::Window::GrabFocus (); - GetViewShell()->onGrabFocus(); + if (mpViewShell) + mpViewShell->onGrabFocus(); } void Window::DataChanged( const DataChangedEvent& rDCEvt ) -- cgit v1.2.3