diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-03-24 10:20:22 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-24 12:12:28 +0000 |
commit | a1196fc0acc5aecf51c5a89bef127b2ad69d7719 (patch) | |
tree | b77a08544c78ed13cac428ff4242f926c827a4be /sd | |
parent | 4106c6541ecb7a682766ec4d4fde6c52f24198b4 (diff) |
coverity#705857 Dereference before null check
Change-Id: Ifb4dfec6a70e0324bd291f1555706b88e1b4d5be
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/animations/SlideTransitionPane.cxx | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index 4f9228d0c047..42877a396a90 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -253,25 +253,29 @@ void lcl_CreateUndoForPages( ::sd::ViewShellBase& rBase ) { ::sd::DrawDocShell* pDocSh = rBase.GetDocShell(); + if (!pDocSh) + return; ::svl::IUndoManager* pManager = pDocSh->GetUndoManager(); + if (!pManager) + return; SdDrawDocument* pDoc = pDocSh->GetDoc(); - if( pManager && pDocSh && pDoc ) - { - OUString aComment( SdResId(STR_UNDO_SLIDE_PARAMS) ); - pManager->EnterListAction(aComment, aComment); - SdUndoGroup* pUndoGroup = new SdUndoGroup( pDoc ); - pUndoGroup->SetComment( aComment ); - - ::std::vector< SdPage * >::const_iterator aIt( rpPages->begin()); - const ::std::vector< SdPage * >::const_iterator aEndIt( rpPages->end()); - for( ; aIt != aEndIt; ++aIt ) - { - pUndoGroup->AddAction( new sd::UndoTransition( pDoc, (*aIt) ) ); - } + if (!pDoc) + return; - pManager->AddUndoAction( pUndoGroup ); - pManager->LeaveListAction(); + OUString aComment( SdResId(STR_UNDO_SLIDE_PARAMS) ); + pManager->EnterListAction(aComment, aComment); + SdUndoGroup* pUndoGroup = new SdUndoGroup( pDoc ); + pUndoGroup->SetComment( aComment ); + + ::std::vector< SdPage * >::const_iterator aIt( rpPages->begin()); + const ::std::vector< SdPage * >::const_iterator aEndIt( rpPages->end()); + for( ; aIt != aEndIt; ++aIt ) + { + pUndoGroup->AddAction( new sd::UndoTransition( pDoc, (*aIt) ) ); } + + pManager->AddUndoAction( pUndoGroup ); + pManager->LeaveListAction(); } sal_Int32 lcl_getTransitionEffectIndex( |