diff options
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/notify/eventsupplier.cxx | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx index 99ff4c0d80e3..356d28c1430a 100644 --- a/sfx2/source/notify/eventsupplier.cxx +++ b/sfx2/source/notify/eventsupplier.cxx @@ -180,25 +180,29 @@ void SfxEvents_Impl::Execute( uno::Any const & aEventData, const document::Docum } } - if (aType == STAR_BASIC && !aScript.isEmpty()) + if (aType.isEmpty()) + { + // Empty type means no active binding for the event. Just ignore do nothing. + return; + } + + if (aScript.isEmpty()) + return; + + if (aType == STAR_BASIC) { uno::Any aAny; SfxMacroLoader::loadMacro( aScript, aAny, pDoc ); } - else if (aType == "Service" || - aType == "Script") + else if (aType == "Service" || aType == "Script") { - bool bAllowed = false; util::URL aURL; - if (!aScript.isEmpty()) - { - uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); + uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); - aURL.Complete = aScript; - xTrans->parseStrict( aURL ); + aURL.Complete = aScript; + xTrans->parseStrict( aURL ); - bAllowed = !SfxObjectShell::UnTrustedScript(aURL.Complete); - } + bool bAllowed = !SfxObjectShell::UnTrustedScript(aURL.Complete); if (bAllowed) { @@ -226,7 +230,6 @@ void SfxEvents_Impl::Execute( uno::Any const & aEventData, const document::Docum if ( xDisp.is() ) { - beans::PropertyValue aEventParam; aEventParam.Value <<= aTrigger; uno::Sequence< beans::PropertyValue > aDispatchArgs( &aEventParam, 1 ); @@ -234,10 +237,6 @@ void SfxEvents_Impl::Execute( uno::Any const & aEventData, const document::Docum } } } - else if ( aType.isEmpty() ) - { - // Empty type means no active binding for the event. Just ignore do nothing. - } else { SAL_WARN( "sfx.notify", "notifyEvent(): Unsupported event type" ); |