From 0908c7c1184ab7acb7b6f6740a82c2f12c296fae Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 16 Feb 2023 10:42:06 +0000 Subject: SfxViewShell::GetViewFrame never returns null, change to a reference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit various null checks can be seen to be redundant and removed Change-Id: Icf49c1de4b0302795d2769a370af3abceaad0221 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147147 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vbahelper/source/vbahelper/vbahelper.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'vbahelper') diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 2722f627e9ba..751cc8f24144 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -121,7 +121,7 @@ void dispatchExecute(SfxViewShell const * pViewShell, sal_uInt16 nSlot) { SfxViewFrame* pViewFrame = nullptr; if ( pViewShell ) - pViewFrame = pViewShell->GetViewFrame(); + pViewFrame = &pViewShell->GetViewFrame(); if ( pViewFrame ) { SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher(); @@ -365,7 +365,7 @@ void PrintOutHelper( SfxViewShell const * pViewShell, const uno::Any& From, cons PrToFileName >>= sFileName; SfxViewFrame* pViewFrame = nullptr; if ( pViewShell ) - pViewFrame = pViewShell->GetViewFrame(); + pViewFrame = &pViewShell->GetViewFrame(); if ( !pViewFrame ) return; @@ -424,7 +424,7 @@ void PrintPreviewHelper( const css::uno::Any& /*EnableChanges*/, SfxViewShell co { SfxViewFrame* pViewFrame = nullptr; if ( pViewShell ) - pViewFrame = pViewShell->GetViewFrame(); + pViewFrame = &pViewShell->GetViewFrame(); if ( pViewFrame ) { if ( !pViewFrame->GetFrame().IsInPlace() ) -- cgit