diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-01-24 15:19:59 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-01-24 15:19:59 +0000 |
commit | 533f390e609da2f4b0e644a543746a767f1bba62 (patch) | |
tree | 7750511f16c763240a7f36e61502c2442860f8d9 /svx | |
parent | 8e375ba24da264cc4d711b535c547a2546435475 (diff) |
coverity#1265796 Dereference null return value
Change-Id: I779dacdb7fb18ba8148e932b4dc684d08f824cbe
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/imapdlg.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index 0ac7de5d3951..657e4691628e 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -109,7 +109,7 @@ SvxIMapDlgChildWindow::SvxIMapDlgChildWindow( vcl::Window* _pParent, sal_uInt16 void SvxIMapDlgChildWindow::UpdateIMapDlg( const Graphic& rGraphic, const ImageMap* pImageMap, const TargetList* pTargetList, void* pEditingObj ) { - SvxIMapDlg* pDlg = SVXIMAPDLG(); + SvxIMapDlg* pDlg = GetIMapDlg(); if (pDlg) pDlg->UpdateLink(rGraphic, pImageMap, pTargetList, pEditingObj); } @@ -773,4 +773,12 @@ IMPL_LINK_NOARG(SvxIMapDlg, MiscHdl) return 0L; } +SvxIMapDlg* GetIMapDlg() +{ + 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; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |