diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-02-15 19:52:01 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-02-16 09:24:57 +0000 |
commit | dc214bcff335024f21c208e239cc36232d611145 (patch) | |
tree | 3bc0fe3cdb032a0f195469da70a75ddb444704a8 /sfx2 | |
parent | 2f0b16a6a9bfff1646b14412e5918b6d483b9cdc (diff) |
SfxViewShell never takes a null SfxViewFrame*
Change-Id: I36f3a5c77a7fb2d3cf267184e403e6cd24dbd70b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147112
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/view/viewfac.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 12 |
3 files changed, 10 insertions, 10 deletions
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index dcc559fc4f87..84797484d3a3 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -4262,11 +4262,11 @@ Reference< frame::XController2 > SAL_CALL SfxBaseModel::createViewController( // determine the ViewFrame belonging to the given XFrame SfxViewFrame* pViewFrame = FindOrCreateViewFrame_Impl( i_rFrame, aViewCreationGuard ); - SAL_WARN_IF( !pViewFrame , "sfx.doc", "SfxBaseModel::createViewController: no frame?" ); + assert(pViewFrame && "SfxBaseModel::createViewController: no frame"); // delegate to SFX' view factory pViewFrame->GetBindings().ENTERREGISTRATIONS(); - SfxViewShell* pViewShell = pViewFactory->CreateInstance( pViewFrame, pOldViewShell ); + SfxViewShell* pViewShell = pViewFactory->CreateInstance(*pViewFrame, pOldViewShell); pViewFrame->GetBindings().LEAVEREGISTRATIONS(); ENSURE_OR_THROW( pViewShell, "invalid view shell provided by factory" ); diff --git a/sfx2/source/view/viewfac.cxx b/sfx2/source/view/viewfac.cxx index b83f4184725e..fbcb8c2c14f6 100644 --- a/sfx2/source/view/viewfac.cxx +++ b/sfx2/source/view/viewfac.cxx @@ -21,9 +21,9 @@ #include <sfx2/viewfrm.hxx> #include <sfx2/viewsh.hxx> -SfxViewShell *SfxViewFactory::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldSh ) +SfxViewShell *SfxViewFactory::CreateInstance(SfxViewFrame& rFrame, SfxViewShell *pOldSh) { - return (*fnCreate)(pFrame, pOldSh); + return (*fnCreate)(rFrame, pOldSh); } OUString SfxViewFactory::GetLegacyViewName() const diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index cd4ffe676f2b..535784ea6300 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1054,14 +1054,14 @@ ViewShellDocId SfxViewShell::mnCurrentDocId(0); SfxViewShell::SfxViewShell ( - SfxViewFrame* pViewFrame, /* <SfxViewFrame>, which will be + SfxViewFrame& rViewFrame, /* <SfxViewFrame>, which will be displayed in this View */ SfxViewShellFlags nFlags /* See <SfxViewShell-Flags> */ ) : SfxShell(this) , pImpl( new SfxViewShell_Impl(nFlags, SfxViewShell::mnCurrentDocId) ) -, pFrame(pViewFrame) +, pFrame(&rViewFrame) , pWindow(nullptr) , bNoNewWindow( nFlags & SfxViewShellFlags::NO_NEWWINDOW ) , mbPrinterSettingsModified(false) @@ -1069,10 +1069,10 @@ SfxViewShell::SfxViewShell , maLOKLocale(LANGUAGE_NONE) , maLOKDeviceFormFactor(LOKDeviceFormFactor::UNKNOWN) { - SetMargin( pViewFrame->GetMargin_Impl() ); + SetMargin( rViewFrame.GetMargin_Impl() ); - SetPool( &pViewFrame->GetObjectShell()->GetPool() ); - StartListening(*pViewFrame->GetObjectShell()); + SetPool( &rViewFrame.GetObjectShell()->GetPool() ); + StartListening(*rViewFrame.GetObjectShell()); // Insert into list std::vector<SfxViewShell*> &rViewArr = SfxGetpApp()->GetViewShells_Impl(); @@ -1089,7 +1089,7 @@ SfxViewShell::SfxViewShell maLOKDeviceFormFactor = SfxLokHelper::getDeviceFormFactor(); - vcl::Window* pFrameWin = pViewFrame->GetWindow().GetFrameWindow(); + vcl::Window* pFrameWin = rViewFrame.GetWindow().GetFrameWindow(); if (pFrameWin && !pFrameWin->GetLOKNotifier()) pFrameWin->SetLOKNotifier(this, true); } |