summaryrefslogtreecommitdiff
path: root/sw/source/uibase/sidebar/PageColumnControl.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-12-15 16:40:53 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-12-15 21:30:31 +0000
commit54aa8993baba2a9463a5b412c6c7575efa89bb67 (patch)
tree45c5cc0151b380a21b2f684914e32eccd765952c /sw/source/uibase/sidebar/PageColumnControl.cxx
parent183f5e38ee775f2e8c57bd061db80baf7da3b4c7 (diff)
sw: check SfxViewFrame::Current()
SfxViewFrame::Current() is a festering wound, these ones look like they were safe anyway, so no need to backport. But with enough checked static analysis will kick in to flag new unchecked ones. Change-Id: I359d71bda2ad1f8f720fae1f87a13eae94bb763c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144244 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/uibase/sidebar/PageColumnControl.cxx')
-rw-r--r--sw/source/uibase/sidebar/PageColumnControl.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/uibase/sidebar/PageColumnControl.cxx b/sw/source/uibase/sidebar/PageColumnControl.cxx
index 18d4ef4248d1..bc8d45d2e46b 100644
--- a/sw/source/uibase/sidebar/PageColumnControl.cxx
+++ b/sw/source/uibase/sidebar/PageColumnControl.cxx
@@ -37,10 +37,10 @@ PageColumnControl::PageColumnControl(PageColumnPopup* pControl, weld::Widget* pP
, m_xControl(pControl)
{
bool bLandscape = false;
- if ( SfxViewFrame::Current() )
+ if (SfxViewFrame* pViewFrm = SfxViewFrame::Current())
{
const SvxPageItem *pPageItem;
- SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState( SID_ATTR_PAGE, pPageItem );
+ pViewFrm->GetBindings().GetDispatcher()->QueryState( SID_ATTR_PAGE, pPageItem );
bLandscape = pPageItem->IsLandscape();
}
@@ -89,8 +89,8 @@ void PageColumnControl::ExecuteColumnChange( const sal_uInt16 nColumnType )
{
SfxInt16Item aPageColumnTypeItem(SID_ATTR_PAGE_COLUMN);
aPageColumnTypeItem.SetValue( nColumnType );
- if ( SfxViewFrame::Current() )
- SfxViewFrame::Current()->GetBindings().GetDispatcher()->ExecuteList(SID_ATTR_PAGE_COLUMN,
+ if (SfxViewFrame* pViewFrm = SfxViewFrame::Current())
+ pViewFrm->GetBindings().GetDispatcher()->ExecuteList(SID_ATTR_PAGE_COLUMN,
SfxCallMode::RECORD, { &aPageColumnTypeItem });
}
@@ -112,8 +112,8 @@ IMPL_LINK( PageColumnControl, ColumnButtonClickHdl_Impl, weld::Button&, rButton,
IMPL_LINK_NOARG( PageColumnControl, MoreButtonClickHdl_Impl, weld::Button&, void )
{
- if ( SfxViewFrame::Current() )
- SfxViewFrame::Current()->GetBindings().GetDispatcher()->Execute( FN_FORMAT_PAGE_COLUMN_DLG, SfxCallMode::ASYNCHRON );
+ if (SfxViewFrame* pViewFrm = SfxViewFrame::Current())
+ pViewFrm->GetBindings().GetDispatcher()->Execute( FN_FORMAT_PAGE_COLUMN_DLG, SfxCallMode::ASYNCHRON );
m_xControl->EndPopupMode();
}