From 5cf5683f944d08fdb9ac22c4a21b095ec1af2ac5 Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Tue, 20 Oct 2009 05:35:27 +0000 Subject: #i106041# check the dispatch in impl_select not before --- framework/source/helper/popupmenucontrollerbase.cxx | 6 ++++-- framework/source/uielement/fontmenucontroller.cxx | 4 +++- framework/source/uielement/fontsizemenucontroller.cxx | 4 +++- framework/source/uielement/headermenucontroller.cxx | 4 +++- framework/source/uielement/objectmenucontroller.cxx | 4 +++- 5 files changed, 16 insertions(+), 6 deletions(-) (limited to 'framework') diff --git a/framework/source/helper/popupmenucontrollerbase.cxx b/framework/source/helper/popupmenucontrollerbase.cxx index 7a768b11a32d..af46386edb35 100644 --- a/framework/source/helper/popupmenucontrollerbase.cxx +++ b/framework/source/helper/popupmenucontrollerbase.cxx @@ -186,7 +186,9 @@ void SAL_CALL PopupMenuControllerBase::highlight( const css::awt::MenuEvent& ) t void PopupMenuControllerBase::impl_select(const Reference< XDispatch >& _xDispatch,const ::com::sun::star::util::URL& aURL) { Sequence aArgs; - _xDispatch->dispatch( aURL, aArgs ); + OSL_ENSURE(_xDispatch.is(),"PopupMenuControllerBase::impl_select: No dispatch"); + if ( _xDispatch.is() ) + _xDispatch->dispatch( aURL, aArgs ); } void SAL_CALL PopupMenuControllerBase::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException) @@ -204,7 +206,7 @@ void SAL_CALL PopupMenuControllerBase::select( const css::awt::MenuEvent& rEvent xServiceManager = m_xServiceManager; aLock.unlock(); - if ( xPopupMenu.is() && xDispatch.is() ) + if ( xPopupMenu.is() ) { VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( xPopupMenu ); if ( pPopupMenu ) diff --git a/framework/source/uielement/fontmenucontroller.cxx b/framework/source/uielement/fontmenucontroller.cxx index ee1014f25b77..e12843f7514d 100644 --- a/framework/source/uielement/fontmenucontroller.cxx +++ b/framework/source/uielement/fontmenucontroller.cxx @@ -188,7 +188,9 @@ void FontMenuController::impl_select(const Reference< XDispatch >& _xDispatch,co m_xFrame, aTargetURL, Sequence()); - _xDispatch->dispatch( aTargetURL, aArgs ); + OSL_ENSURE(_xDispatch.is(),"FontMenuController::impl_select: No dispatch"); + if ( _xDispatch.is() ) + _xDispatch->dispatch( aTargetURL, aArgs ); } void SAL_CALL FontMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException) diff --git a/framework/source/uielement/fontsizemenucontroller.cxx b/framework/source/uielement/fontsizemenucontroller.cxx index bbf3915d2e06..2f7bce27d151 100644 --- a/framework/source/uielement/fontsizemenucontroller.cxx +++ b/framework/source/uielement/fontsizemenucontroller.cxx @@ -326,7 +326,9 @@ void FontSizeMenuController::impl_select(const Reference< XDispatch >& _xDispatc Sequence aArgs; if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# UiEventLogHelper(::rtl::OUString::createFromAscii("FontSizeMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs); - _xDispatch->dispatch( aTargetURL, aArgs ); + OSL_ENSURE(_xDispatch.is(),"FontSizeMenuController::impl_select: No dispatch"); + if ( _xDispatch.is() ) + _xDispatch->dispatch( aTargetURL, aArgs ); } // XPopupMenuController diff --git a/framework/source/uielement/headermenucontroller.cxx b/framework/source/uielement/headermenucontroller.cxx index 4e90d86fe0c9..56f45c5c52c2 100644 --- a/framework/source/uielement/headermenucontroller.cxx +++ b/framework/source/uielement/headermenucontroller.cxx @@ -254,7 +254,9 @@ void HeaderMenuController::impl_select(const Reference< XDispatch >& _xDispatch, Sequence aArgs; if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# UiEventLogHelper(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(m_bFooter ? "FooterMenuController" : "HeaderMenuController"))).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs); - _xDispatch->dispatch( aTargetURL, aArgs ); + OSL_ENSURE(_xDispatch.is(),"HeaderMenuController::impl_select: No dispatch"); + if ( _xDispatch.is() ) + _xDispatch->dispatch( aTargetURL, aArgs ); } void SAL_CALL HeaderMenuController::updatePopupMenu() throw (::com::sun::star::uno::RuntimeException) diff --git a/framework/source/uielement/objectmenucontroller.cxx b/framework/source/uielement/objectmenucontroller.cxx index 9f7d3bb64f5e..937fb7ded0dc 100644 --- a/framework/source/uielement/objectmenucontroller.cxx +++ b/framework/source/uielement/objectmenucontroller.cxx @@ -160,7 +160,9 @@ void ObjectMenuController::impl_select(const Reference< XDispatch >& _xDispatch, Sequence aArgs; if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# UiEventLogHelper(::rtl::OUString::createFromAscii("ObjectMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs); - _xDispatch->dispatch( aTargetURL, aArgs ); + OSL_ENSURE(_xDispatch.is(),"ObjectMenuController::impl_select: No dispatch"); + if ( _xDispatch.is() ) + _xDispatch->dispatch( aTargetURL, aArgs ); } } -- cgit