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>
This commit is contained in:
Samuel Mehrbrodt
2019-11-05 15:06:25 +01:00
committed by Serge Krot (CIB)
parent 79d31b8dc8
commit 730e588b5e
3 changed files with 7 additions and 1 deletions
@@ -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 ;
}