diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-01-24 15:15:44 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-01-24 15:15:44 +0000 |
commit | 8e375ba24da264cc4d711b535c547a2546435475 (patch) | |
tree | 1828fc4fe5d9941f1240b36dfb2205b6001824db /include/svx/imapdlg.hxx | |
parent | 6cfce6ead21a1c6c985d3d79cef6c584abbc7e8e (diff) |
coverity#1265799 Dereference null return value
Change-Id: I7f1838b55d7b526327efb0562f3ad1ab5a1778a1
Diffstat (limited to 'include/svx/imapdlg.hxx')
-rw-r--r-- | include/svx/imapdlg.hxx | 18 |
1 files changed, 7 insertions, 11 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 |