summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-11-05 09:17:41 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2019-12-04 13:42:21 +0100
commite002fdebef78236ae1299678bf7cb2b90a487eff (patch)
tree5e53b7d98dee0aee7599b0e76f569e79f7df7408
parentaf00f283c05bb282bfcc217369b3c752126b6d1e (diff)
Fix option to disable macros
so that it indeeds disables any macro execution. Before, you could still add macros to the toolbar and execute them from there (and probably many more places). Now, if this option is set, any macro will no longer be executed. This includes Javascript, Beanshell and Python scripts Change-Id: Icfa845e836782c8e1b670a67694f79a60ad74fad Reviewed-on: https://gerrit.libreoffice.org/82052 Reviewed-by: Serge Krot (CIB) <Serge.Krot@cib.de> Tested-by: Serge Krot (CIB) <Serge.Krot@cib.de>
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs1
-rw-r--r--scripting/Library_protocolhandler.mk4
-rw-r--r--scripting/source/protocolhandler/scripthandler.cxx3
3 files changed, 7 insertions, 1 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 246bcd71ad48..0832e17cd66e 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2700,6 +2700,7 @@
<prop oor:name="DisableMacrosExecution" oor:type="xs:boolean" oor:nillable="false">
<info>
<desc>Specifies whether the macro execution is disabled in general.
+ This will disable Basic, Beanshell, Javascript and Python scripts.
If it is set to true, the "MacroSecurityLevel" is ignored. If it is
set to false, the mentioned entry specified the level of macro
security.</desc>
diff --git a/scripting/Library_protocolhandler.mk b/scripting/Library_protocolhandler.mk
index e140bb322008..ce9b77ca2f63 100644
--- a/scripting/Library_protocolhandler.mk
+++ b/scripting/Library_protocolhandler.mk
@@ -20,6 +20,10 @@ $(eval $(call gb_Library_use_external,protocolhandler,boost_headers))
$(eval $(call gb_Library_use_sdk_api,protocolhandler))
+$(eval $(call gb_Library_use_custom_headers,protocolhandler,\
+ officecfg/registry \
+))
+
$(eval $(call gb_Library_use_libraries,protocolhandler,\
comphelper \
cppu \
diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index 3340ff498170..c69ac3b5f27d 100644
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -46,6 +46,7 @@
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <framework/documentundoguard.hxx>
+#include <officecfg/Office/Common.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/uri/XUriReference.hpp>
@@ -70,7 +71,7 @@ namespace scripting_protocolhandler
void SAL_CALL ScriptProtocolHandler::initialize(
const css::uno::Sequence < css::uno::Any >& aArguments )
{
- if ( m_bInitialised )
+ if ( m_bInitialised || officecfg::Office::Common::Security::Scripting::DisableMacrosExecution::get() )
{
return ;
}