[Libreoffice-commits] core.git: Branch 'feature/cib_contract3756' - scripting/source

Samuel Mehrbrodt (via logerrit) logerrit at kemper.freedesktop.org
Wed Nov 6 07:16:26 UTC 2019


 scripting/source/protocolhandler/scripthandler.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 2e84d034cdc55ec951147a15b0f175cf4e61650a
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Tue Nov 5 16:43:50 2019 +0100
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Wed Nov 6 08:15:30 2019 +0100

    Check if scripting disabled for each dispatch call
    
    Not only when initializing.
    This way, changing the property during runtime has an effect.
    
    Change-Id: Iba5f00996f0079fc4bafb5d373f34c6fd86c7959
    Reviewed-on: https://gerrit.libreoffice.org/82078
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    (cherry picked from commit f5d01aef7697478fe315098ed4855cfcdfc0379f)
    Reviewed-on: https://gerrit.libreoffice.org/82122
    Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index ed960848d072..c167fb3c42d8 100644
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -71,7 +71,7 @@ namespace scripting_protocolhandler
 void SAL_CALL ScriptProtocolHandler::initialize(
     const css::uno::Sequence < css::uno::Any >& aArguments )
 {
-    if ( m_bInitialised || officecfg::Office::Common::Security::Scripting::DisableMacrosExecution::get() )
+    if ( m_bInitialised )
     {
         return ;
     }
@@ -123,6 +123,9 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
     const URL& aURL, const Sequence < PropertyValue >& lArgs,
     const Reference< XDispatchResultListener >& xListener )
 {
+    if (officecfg::Office::Common::Security::Scripting::DisableMacrosExecution::get())
+        return;
+
     bool bSuccess = false;
     Any invokeResult;
     bool bCaughtException = false;


More information about the Libreoffice-commits mailing list