diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-12-16 12:11:38 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-12-16 21:17:15 +0000 |
commit | 1726c27e0d633ab04843834d2bf987bc7645807f (patch) | |
tree | 7810a18cd5bc3bf5aa345b816b372d93bd323974 /cui/source/tabpages/chardlg.cxx | |
parent | 1ae71d8f09771ba7180be6ebdf89d36a31eb8625 (diff) |
check SfxObjectShell::Current()
SfxObjectShell::Current() can return null, it's based on the equally
vile SfxViewFrame::Current()
Change-Id: Ia5c7783680e9d8e5d3075078f16a2c15cb6f7a47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144339
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source/tabpages/chardlg.cxx')
-rw-r--r-- | cui/source/tabpages/chardlg.cxx | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 3d77e2a338fb..3fff1a62352a 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -344,10 +344,8 @@ const FontList* SvxCharNamePage::GetFontList() const { if ( !m_pImpl->m_pFontList ) { - SfxObjectShell* pDocSh = SfxObjectShell::Current(); - /* #110771# SvxFontListItem::GetFontList can return NULL */ - if ( pDocSh ) + if (SfxObjectShell* pDocSh = SfxObjectShell::Current()) { const SfxPoolItem* pItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST ); if ( pItem != nullptr ) @@ -1366,8 +1364,7 @@ void SvxCharEffectsPage::Initialize() const SfxUInt16Item* pHtmlModeItem = GetItemSet().GetItemIfSet( SID_HTML_MODE, false ); if ( !pHtmlModeItem) { - SfxObjectShell* pShell = SfxObjectShell::Current(); - if (pShell) + if (SfxObjectShell* pShell = SfxObjectShell::Current()) pHtmlModeItem = pShell->GetItem( SID_HTML_MODE ); } if (pHtmlModeItem) |