diff options
-rw-r--r-- | include/svx/imapdlg.hxx | 18 | ||||
-rw-r--r-- | svx/source/dialog/imapdlg.cxx | 6 |
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 &) |