summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-11-25 10:28:27 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-11-25 14:54:02 +0000
commitf676e9a604bed14865e5c9a277fda0d7b564085d (patch)
tree8bc4221daf53699c82fbb91bfd9d0965bf8ec92b
parent2fc4952bd0123de06bf281733597b3f9fc487d75 (diff)
tidy up this deref before check code
Change-Id: Icd9ff99616c452bd16ffc3dc8ab0981d75a386a2
-rw-r--r--sfx2/source/dialog/templdlg.cxx17
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 )