diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-25 10:28:27 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-25 14:54:02 +0000 |
commit | f676e9a604bed14865e5c9a277fda0d7b564085d (patch) | |
tree | 8bc4221daf53699c82fbb91bfd9d0965bf8ec92b /sfx2 | |
parent | Remove unused URE_LIB_DIR (diff) | |
download | core-f676e9a604bed14865e5c9a277fda0d7b564085d.tar.gz core-f676e9a604bed14865e5c9a277fda0d7b564085d.zip |
tidy up this deref before check code
Change-Id: Icd9ff99616c452bd16ffc3dc8ab0981d75a386a2
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/templdlg.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index aa9bac7cf633..72c5a18a1c73 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -716,14 +716,17 @@ void SfxCommonTemplateDialog_Impl::ReadResource() pCurObjShell = pViewFrame->GetObjectShell(); pModule = pCurObjShell ? pCurObjShell->GetModule() : NULL; ResMgr* pMgr = pModule ? pModule->GetResMgr() : NULL; - ResId aFamId( DLG_STYLE_DESIGNER, *pMgr ); - aFamId.SetRT(RSC_SFX_STYLE_FAMILIES); - m_pStyleFamiliesId = new ResId( aFamId.GetId(), *pMgr ); - m_pStyleFamiliesId->SetRT(RSC_SFX_STYLE_FAMILIES); - if( !pMgr || !pMgr->IsAvailable( aFamId ) ) + if (pMgr) + { + ResId aFamId( DLG_STYLE_DESIGNER, *pMgr ); + aFamId.SetRT(RSC_SFX_STYLE_FAMILIES); + m_pStyleFamiliesId = new ResId( aFamId.GetId(), *pMgr ); + m_pStyleFamiliesId->SetRT(RSC_SFX_STYLE_FAMILIES); + if (pMgr->IsAvailable(aFamId)) + pStyleFamilies = new SfxStyleFamilies( aFamId ); + } + if (!pStyleFamilies) pStyleFamilies = new SfxStyleFamilies; - else - pStyleFamilies = new SfxStyleFamilies( aFamId ); nActFilter = pCurObjShell ? static_cast< sal_uInt16 >( LoadFactoryStyleFilter( pCurObjShell ) ) : SFXSTYLEBIT_ALL; if ( pCurObjShell && SFXSTYLEBIT_ALL == nActFilter ) |