diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-02-16 10:42:06 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-02-16 15:13:21 +0000 |
commit | 0908c7c1184ab7acb7b6f6740a82c2f12c296fae (patch) | |
tree | 7bfe09dce871f6f2bc59a81b689d7ab5a3a6f3ea /sc/source/ui/app | |
parent | e71080e19365aa074c56d1136dad2b09783949a2 (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 'sc/source/ui/app')
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/app/inputwin.cxx | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index f80b6c1b49a8..8d310e1c94d5 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -878,7 +878,7 @@ void ScInputHandler::UpdateRefDevice() return; bool bTextWysiwyg = SC_MOD()->GetInputOptions().GetTextWysiwyg(); - bool bInPlace = pActiveViewSh && pActiveViewSh->GetViewFrame()->GetFrame().IsInPlace(); + bool bInPlace = pActiveViewSh && pActiveViewSh->GetViewFrame().GetFrame().IsInPlace(); EEControlBits nCtrl = mpEditEngine->GetControlWord(); if ( bTextWysiwyg || bInPlace ) nCtrl |= EEControlBits::FORMAT100; // EditEngine default: always format for 100% @@ -2860,11 +2860,11 @@ void ScInputHandler::ShowRefFrame() return; bool bFound = false; - SfxViewFrame* pRefFrame = pRefViewSh->GetViewFrame(); + SfxViewFrame& rRefFrame = pRefViewSh->GetViewFrame(); SfxViewFrame* pOneFrame = SfxViewFrame::GetFirst(); while ( pOneFrame && !bFound ) { - if ( pOneFrame == pRefFrame ) + if ( pOneFrame == &rRefFrame ) bFound = true; pOneFrame = SfxViewFrame::GetNext( *pOneFrame ); } @@ -3371,7 +3371,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode, bool bBeforeSavingInL if ( pExecuteSh ) { - SfxBindings& rBindings = pExecuteSh->GetViewFrame()->GetBindings(); + SfxBindings& rBindings = pExecuteSh->GetViewFrame().GetBindings(); sal_uInt16 nId = FID_INPUTLINE_ENTER; if ( nBlockMode == ScEnterMode::BLOCK ) diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index ed82c9d7a0a3..f833e743b991 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -2607,8 +2607,8 @@ void ScPosWnd::DoEnter() else if (eType == SC_MANAGE_NAMES) { sal_uInt16 nId = ScNameDlgWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pViewSh->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pViewSh->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); SC_MOD()->SetRefDialog( nId, pWnd == nullptr ); } |