diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-01-29 15:30:34 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-01-29 16:41:31 +0000 |
commit | e3149900156ef4d207f64ec16fb2d367c3c29dba (patch) | |
tree | 5d73b05324a7091c12838c19518f7034a91c2fb7 /sd | |
parent | 94753842eb83bb16783310416bdb95d6827d7ead (diff) |
coverity#1132704 Dereference before null check
Change-Id: I1922d7f3481fc56b33a078277cd17e54b14d6953
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/dlg/sdtreelb.cxx | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 56a856c07fe8..8d00e1bf6130 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -1143,34 +1143,20 @@ void SdPageObjsTLB::KeyInput( const KeyEvent& rKEvt ) { sal_Bool bMarked=sal_False; SvTreeListEntry* pNewEntry = GetCurEntry(); - if( GetParent(pNewEntry) == NULL ) + if (!pNewEntry) return; - OUString aStr=GetSelectEntry(); - Window* pWindow=NULL; - SdNavigatorWin* pSdNavigatorWin=NULL; - sd::DrawDocShell* pSdDrawDocShell = NULL; - if(pNewEntry) - pWindow=(Window*)GetParent(pNewEntry); - if(pWindow) - pSdNavigatorWin = (SdNavigatorWin*)pWindow; - if( pSdNavigatorWin ) - pSdDrawDocShell = pSdNavigatorWin->GetDrawDocShell(mpDoc); - if(pSdDrawDocShell) + SvTreeListEntry* pParentEntry = GetParent(pNewEntry); + if (!pParentEntry) + return; + OUString aStr(GetSelectEntry()); + SdNavigatorWin* pSdNavigatorWin = (SdNavigatorWin*)pParentEntry; + sd::DrawDocShell* pSdDrawDocShell = pSdNavigatorWin->GetDrawDocShell(mpDoc); + if (pSdDrawDocShell) { pSdDrawDocShell->GotoTreeBookmark(aStr); bMarked=pSdDrawDocShell->GetObjectIsmarked(aStr); } - if(pNewEntry) - { - if(bMarked) - { - pNewEntry->SetMarked(sal_True); - } - else - { - pNewEntry->SetMarked( sal_False ); - } - } + pNewEntry->SetMarked(bMarked); Invalidate(); } } |