diff options
Diffstat (limited to 'scripting/source/protocolhandler')
-rw-r--r-- | scripting/source/protocolhandler/scripthandler.cxx | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx index 3b3fe4e307ef..ea29661a489a 100644 --- a/scripting/source/protocolhandler/scripthandler.cxx +++ b/scripting/source/protocolhandler/scripthandler.cxx @@ -267,33 +267,33 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification( pDlg->Execute(); } - if ( xListener.is() ) - { - // always call dispatchFinished(), because we didn't load a document but - // executed a macro instead! - css::frame::DispatchResultEvent aEvent; + if ( !xListener.is() ) + return; - aEvent.Source = static_cast< ::cppu::OWeakObject* >( this ); - aEvent.Result = invokeResult; - if ( bSuccess ) - { - aEvent.State = css::frame::DispatchResultState::SUCCESS; - } - else - { - aEvent.State = css::frame::DispatchResultState::FAILURE; - } + // always call dispatchFinished(), because we didn't load a document but + // executed a macro instead! + css::frame::DispatchResultEvent aEvent; - try - { - xListener->dispatchFinished( aEvent ) ; - } - catch(const RuntimeException &) - { - TOOLS_WARN_EXCEPTION("scripting", - "ScriptProtocolHandler::dispatchWithNotification: caught RuntimeException" - "while dispatchFinished" ); - } + aEvent.Source = static_cast< ::cppu::OWeakObject* >( this ); + aEvent.Result = invokeResult; + if ( bSuccess ) + { + aEvent.State = css::frame::DispatchResultState::SUCCESS; + } + else + { + aEvent.State = css::frame::DispatchResultState::FAILURE; + } + + try + { + xListener->dispatchFinished( aEvent ) ; + } + catch(const RuntimeException &) + { + TOOLS_WARN_EXCEPTION("scripting", + "ScriptProtocolHandler::dispatchWithNotification: caught RuntimeException" + "while dispatchFinished" ); } } |