summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--desktop/source/lib/init.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 056a48caa68d..087474487b97 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -137,6 +137,8 @@
#include <vcl/ITiledRenderable.hxx>
#include <vcl/dialoghelper.hxx>
#include <unicode/uchar.h>
+#include <unotools/securityoptions.hxx>
+#include <unotools/configmgr.hxx>
#include <unotools/confignode.hxx>
#include <unotools/syslocaleoptions.hxx>
#include <unotools/mediadescriptor.hxx>
@@ -2265,6 +2267,18 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis,
aFilterOptions[1].Name = "InteractionHandler";
aFilterOptions[1].Value <<= xInteraction;
+ int nMacroSecurityLevel = 1;
+ const OUString aMacroSecurityLevel = extractParameter(aOptions, u"MacroSecurityLevel");
+ if (!aMacroSecurityLevel.isEmpty())
+ {
+ double nNumber;
+ sal_uInt32 nFormat = 1;
+ SvNumberFormatter aFormatter(::comphelper::getProcessComponentContext(), LANGUAGE_ENGLISH_US);
+ if (aFormatter.IsNumberFormat(aMacroSecurityLevel, nFormat, nNumber))
+ nMacroSecurityLevel = static_cast<int>(nNumber);
+ }
+ SvtSecurityOptions().SetMacroSecurityLevel(nMacroSecurityLevel);
+
const OUString aEnableMacrosExecution = extractParameter(aOptions, u"EnableMacrosExecution");
sal_Int16 nMacroExecMode = aEnableMacrosExecution == "true" ? document::MacroExecMode::USE_CONFIG :
document::MacroExecMode::NEVER_EXECUTE;