desktop/source/lib/init.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+)
New commits: commit 91aaa36286208791327aaa28460374942a237dc6 Author: Henry Castro <[email protected]> AuthorDate: Fri Mar 5 19:53:51 2021 -0400 Commit: Szymon Kłos <[email protected]> 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 <[email protected]> Reviewed-by: Szymon Kłos <[email protected]> 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; _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
