summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-01-24 15:15:44 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-01-24 15:15:44 +0000
commit8e375ba24da264cc4d711b535c547a2546435475 (patch)
tree1828fc4fe5d9941f1240b36dfb2205b6001824db
parent6cfce6ead21a1c6c985d3d79cef6c584abbc7e8e (diff)
coverity#1265799 Dereference null return value
Change-Id: I7f1838b55d7b526327efb0562f3ad1ab5a1778a1
-rw-r--r--include/svx/imapdlg.hxx18
-rw-r--r--svx/source/dialog/imapdlg.cxx6
2 files changed, 10 insertions, 14 deletions
diff --git a/include/svx/imapdlg.hxx b/include/svx/imapdlg.hxx
index 5530488c95ef..d4bbb7a1b9e5 100644
--- a/include/svx/imapdlg.hxx
+++ b/include/svx/imapdlg.hxx
@@ -155,17 +155,13 @@ public:
virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
};
-
-/*************************************************************************
-|*
-|* Defines
-|*
-\************************************************************************/
-
-#define SVXIMAPDLG() ( static_cast<SvxIMapDlg*>( SfxViewFrame::Current()->GetChildWindow( \
- SvxIMapDlgChildWindow::GetChildWindowId() )-> \
- GetWindow() ) )
-
+inline SvxIMapDlg* SVXIMAPDLG()
+{
+ SfxChildWindow* pWnd = NULL;
+ if (SfxViewFrame::Current() && SfxViewFrame::Current()->HasChildWindow(SvxIMapDlgChildWindow::GetChildWindowId()))
+ pWnd = SfxViewFrame::Current()->GetChildWindow(SvxIMapDlgChildWindow::GetChildWindowId());
+ return pWnd ? static_cast<SvxIMapDlg*>(pWnd->GetWindow()) : NULL;
+}
#endif // INCLUDED_SVX_IMAPDLG_HXX
diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx
index 6866020c4004..0ac7de5d3951 100644
--- a/svx/source/dialog/imapdlg.cxx
+++ b/svx/source/dialog/imapdlg.cxx
@@ -109,9 +109,9 @@ SvxIMapDlgChildWindow::SvxIMapDlgChildWindow( vcl::Window* _pParent, sal_uInt16
void SvxIMapDlgChildWindow::UpdateIMapDlg( const Graphic& rGraphic, const ImageMap* pImageMap,
const TargetList* pTargetList, void* pEditingObj )
{
- if ( SfxViewFrame::Current() &&
- SfxViewFrame::Current()->HasChildWindow( SvxIMapDlgChildWindow::GetChildWindowId() ) )
- SVXIMAPDLG()->UpdateLink( rGraphic, pImageMap, pTargetList, pEditingObj );
+ SvxIMapDlg* pDlg = SVXIMAPDLG();
+ if (pDlg)
+ pDlg->UpdateLink(rGraphic, pImageMap, pTargetList, pEditingObj);
}
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeStatusBar(vcl::Window *pParent, VclBuilder::stringmap &)