From b81ff51a8ccac942effdd309f014591604376ecc Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Mon, 27 May 2024 20:04:31 +0200 Subject: sd: use SAL_RET_MAYBENULL in GetDrawView() Directly return nullptr instead of calling SfxViewShell::GetDrawView() which return nullptr to make it obvious Change-Id: I5e81d23f541a73181bb6f7d9e7f1d6ec56ff57ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168116 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- sd/source/ui/inc/ViewShellBase.hxx | 2 +- sd/source/ui/view/ViewShellBase.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/inc/ViewShellBase.hxx b/sd/source/ui/inc/ViewShellBase.hxx index cdec6d8a6b02..1e1517eb6550 100644 --- a/sd/source/ui/inc/ViewShellBase.hxx +++ b/sd/source/ui/inc/ViewShellBase.hxx @@ -153,7 +153,7 @@ public: virtual bool PrepareClose (bool bUI = true) override; virtual void WriteUserData (OUString&, bool bBrowse = false) override; virtual void ReadUserData (const OUString&, bool bBrowse = false) override; - virtual SdrView* GetDrawView() const override; + SAL_RET_MAYBENULL virtual SdrView* GetDrawView() const override; /** When is given, then the mouse shape is set to hour glass (or whatever the busy shape looks like on the system.) diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index bf125e126b0d..3672f5655bf6 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -816,8 +816,8 @@ SdrView* ViewShellBase::GetDrawView() const ViewShell* pShell = GetMainViewShell().get(); if (pShell != nullptr) return pShell->GetDrawView (); - else - return SfxViewShell::GetDrawView(); + + return nullptr; } void ViewShellBase::SetBusyState (bool bBusy) -- cgit