summaryrefslogtreecommitdiff
path: root/sd/source/ui/view/ViewShellBase.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-02-16 10:42:06 +0000
committerCaolán McNamara <caolanm@redhat.com>2023-02-16 15:13:21 +0000
commit0908c7c1184ab7acb7b6f6740a82c2f12c296fae (patch)
tree7bfe09dce871f6f2bc59a81b689d7ab5a3a6f3ea /sd/source/ui/view/ViewShellBase.cxx
parente71080e19365aa074c56d1136dad2b09783949a2 (diff)
SfxViewShell::GetViewFrame never returns null, change to a reference
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 <caolanm@redhat.com>
Diffstat (limited to 'sd/source/ui/view/ViewShellBase.cxx')
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx21
1 files changed, 8 insertions, 13 deletions
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index a4af703afb38..64d0950c366c 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -233,7 +233,7 @@ ViewShellBase::ViewShellBase (
_rFrame.GetWindow().SetBackground(Application::GetSettings().GetStyleSettings().GetLightColor());
// Set up the members in the correct order.
- if (auto pDrawDocShell = dynamic_cast< DrawDocShell *>( GetViewFrame()->GetObjectShell() ))
+ if (auto pDrawDocShell = dynamic_cast< DrawDocShell *>( GetViewFrame().GetObjectShell() ))
mpDocShell = pDrawDocShell;
if (mpDocShell != nullptr)
mpDocument = mpDocShell->GetDoc();
@@ -280,7 +280,7 @@ ViewShellBase::~ViewShellBase()
mpImpl->mpToolBarManager->Shutdown();
mpImpl->mpViewShellManager->Shutdown();
- EndListening(*GetViewFrame());
+ EndListening(GetViewFrame());
EndListening(*GetDocShell());
SetWindow(nullptr);
@@ -290,7 +290,7 @@ ViewShellBase::~ViewShellBase()
void ViewShellBase::LateInit (const OUString& rsDefaultView)
{
- StartListening(*GetViewFrame(), DuplicateHandling::Prevent);
+ StartListening(GetViewFrame(), DuplicateHandling::Prevent);
StartListening(*GetDocShell(), DuplicateHandling::Prevent);
mpImpl->LateInit();
InitializeFramework();
@@ -409,11 +409,8 @@ void ViewShellBase::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
case SfxEventHintId::OpenDoc:
if( GetDocument() && GetDocument()->IsStartWithPresentation() )
{
- if( GetViewFrame() )
- {
- GetViewFrame()->GetDispatcher()->Execute(
- SID_PRESENTATION, SfxCallMode::ASYNCHRON );
- }
+ GetViewFrame().GetDispatcher()->Execute(
+ SID_PRESENTATION, SfxCallMode::ASYNCHRON );
}
break;
@@ -428,7 +425,7 @@ void ViewShellBase::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
case SfxHintId::LanguageChanged:
{
- GetViewFrame()->GetBindings().Invalidate(SID_LANGUAGE_STATUS);
+ GetViewFrame().GetBindings().Invalidate(SID_LANGUAGE_STATUS);
}
break;
@@ -487,8 +484,6 @@ void ViewShellBase::OuterResizePixel (const Point& rOrigin, const Size &rSize)
void ViewShellBase::Rearrange()
{
- OSL_ASSERT(GetViewFrame()!=nullptr);
-
// There is a bug in the communication between embedded objects and the
// framework::LayoutManager that leads to missing resize updates. The
// following workaround enforces such an update by cycling the border to
@@ -503,7 +498,7 @@ void ViewShellBase::Rearrange()
SAL_WARN("sd.view", "Rearrange: window missing");
}
- GetViewFrame()->Resize(true);
+ GetViewFrame().Resize(true);
}
ErrCode ViewShellBase::DoVerb(sal_Int32 nVerb)
@@ -677,7 +672,7 @@ void ViewShellBase::GetState (SfxItemSet& rSet)
{
mpImpl->GetSlotState(rSet);
- FuBullet::GetSlotState( rSet, nullptr, GetViewFrame() );
+ FuBullet::GetSlotState( rSet, nullptr, &GetViewFrame() );
}
void ViewShellBase::WriteUserDataSequence (