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 /sw/source/uibase/shells/tabsh.cxx | |
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 'sw/source/uibase/shells/tabsh.cxx')
-rw-r--r-- | sw/source/uibase/shells/tabsh.cxx | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 94724a3018cc..3fc8dcd56bc1 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -181,7 +181,7 @@ static std::shared_ptr<SwTableRep> lcl_TableParamToItemSet( SfxItemSet& rSet, Sw { rSh.StartAllAction(); rSh.Push(); - rSh.GetView().GetViewFrame()->GetDispatcher()->Execute( FN_TABLE_SELECT_ALL ); + rSh.GetView().GetViewFrame().GetDispatcher()->Execute( FN_TABLE_SELECT_ALL ); } SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER ); @@ -329,7 +329,7 @@ void ItemSetToTableParam( const SfxItemSet& rSet, rSh.Push(); if(!bTableSel) { - rSh.GetView().GetViewFrame()->GetDispatcher()->Execute( FN_TABLE_SELECT_ALL ); + rSh.GetView().GetViewFrame().GetDispatcher()->Execute( FN_TABLE_SELECT_ALL ); } if(bBorder) rSh.SetTabBorders( rSet ); @@ -607,7 +607,7 @@ void SwTableShell::Execute(SfxRequest &rReq) { //#127012# get the bindings before the dialog is called // it might happen that this shell is removed after closing the dialog - SfxBindings& rBindings = GetView().GetViewFrame()->GetBindings(); + SfxBindings& rBindings = GetView().GetViewFrame().GetBindings(); SfxItemSet aCoreSet( GetPool(), aUITableAttrRange); FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( &rSh.GetView()) != nullptr ); @@ -1004,11 +1004,10 @@ void SwTableShell::Execute(SfxRequest &rReq) ? FN_TABLE_INSERT_COL_AFTER : FN_TABLE_INSERT_ROW_AFTER; SfxUInt16Item aCountItem( nDispatchSlot, pDlg->getInsertCount() ); SfxBoolItem aAfter( FN_PARAM_INSERT_AFTER, !pDlg->isInsertBefore() ); - SfxViewFrame* pVFrame = GetView().GetViewFrame(); - if( pVFrame ) - pVFrame->GetDispatcher()->ExecuteList(nDispatchSlot, - SfxCallMode::SYNCHRON|SfxCallMode::RECORD, - { &aCountItem, &aAfter }); + SfxViewFrame& rVFrame = GetView().GetViewFrame(); + rVFrame.GetDispatcher()->ExecuteList(nDispatchSlot, + SfxCallMode::SYNCHRON|SfxCallMode::RECORD, + { &aCountItem, &aAfter }); } } break; @@ -1132,7 +1131,7 @@ void SwTableShell::Execute(SfxRequest &rReq) ? TableChgMode::FixedWidthChangeProp : TableChgMode::VarWidthChangeAbs ); - SfxBindings& rBind = GetView().GetViewFrame()->GetBindings(); + SfxBindings& rBind = GetView().GetViewFrame().GetBindings(); static sal_uInt16 aInva[] = { FN_TABLE_MODE_FIX, FN_TABLE_MODE_FIX_PROP, @@ -1145,10 +1144,10 @@ void SwTableShell::Execute(SfxRequest &rReq) } case FN_TABLE_AUTOSUM: { - SfxViewFrame* pVFrame = GetView().GetViewFrame(); - pVFrame->GetDispatcher()->Execute(FN_EDIT_FORMULA, SfxCallMode::SYNCHRON); + SfxViewFrame& rVFrame = GetView().GetViewFrame(); + rVFrame.GetDispatcher()->Execute(FN_EDIT_FORMULA, SfxCallMode::SYNCHRON); const sal_uInt16 nId = SwInputChild::GetChildWindowId(); - SwInputChild* pChildWin = static_cast<SwInputChild*>(pVFrame-> + SwInputChild* pChildWin = static_cast<SwInputChild*>(rVFrame. GetChildWindow( nId )); OUString sSum; GetShell().GetAutoSum(sSum); @@ -1170,7 +1169,7 @@ void SwTableShell::Execute(SfxRequest &rReq) { rSh.StartAction(); rSh.StartUndo(); - rSh.GetView().GetViewFrame()->GetDispatcher()->Execute(FN_TABLE_SELECT_ALL); + rSh.GetView().GetViewFrame().GetDispatcher()->Execute(FN_TABLE_SELECT_ALL); rSh.DeleteTable(); rSh.EndUndo(); rSh.EndAction(); |