[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - desktop/source
Henry Castro (via logerrit)
logerrit at kemper.freedesktop.org
Tue Mar 9 10:13:14 UTC 2021
desktop/source/lib/init.cxx | 13 +++++++++++++
1 file changed, 13 insertions(+)
New commits:
commit 91aaa36286208791327aaa28460374942a237dc6
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Fri Mar 5 19:53:51 2021 -0400
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Mar 9 11:12:25 2021 +0100
lok: add "MacroSecurityLevel" option
Change-Id: I1cf4e6d4495c552b94c6fe80333291fc4ab20936
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112043
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 81b15d4b4fa4..a3ea934e9ebf 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -143,6 +143,7 @@
#include <vcl/IDialogRenderable.hxx>
#include <vcl/dialog.hxx>
#include <unicode/uchar.h>
+#include <unotools/securityoptions.hxx>
#include <unotools/configmgr.hxx>
#include <unotools/confignode.hxx>
#include <unotools/syslocaleoptions.hxx>
@@ -2274,6 +2275,18 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis,
aFilterOptions[1].Name = "InteractionHandler";
aFilterOptions[1].Value <<= xInteraction;
+ int nMacroSecurityLevel = 1;
+ const OUString aMacroSecurityLevel = extractParameter(aOptions, "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, "EnableMacrosExecution");
sal_Int16 nMacroExecMode = aEnableMacrosExecution == "true" ? document::MacroExecMode::USE_CONFIG :
document::MacroExecMode::NEVER_EXECUTE;
More information about the Libreoffice-commits
mailing list