From 1c32970c0d9bbe6ba5778416b6d08c57bcffd3ea Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Wed, 11 Dec 2024 06:24:54 +0100 Subject: [PATCH] Disable macros in Viewer Mode Prevents "This document contains macros" dialog on file open. Change-Id: I92cbd6b5f919ccfa5812b4a90ec72ad4378d009a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178273 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- unotools/source/config/securityoptions.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx index 263a32808aec..19fa71b3beba 100644 --- a/unotools/source/config/securityoptions.cxx +++ b/unotools/source/config/securityoptions.cxx @@ -205,7 +205,9 @@ void SetMacroSecurityLevel( sal_Int32 _nLevel ) bool IsMacroDisabled() { - return comphelper::IsFuzzing() || officecfg::Office::Common::Security::Scripting::DisableMacrosExecution::get(); + return comphelper::IsFuzzing() + || officecfg::Office::Common::Security::Scripting::DisableMacrosExecution::get() + || officecfg::Office::Common::Misc::ViewerAppMode::get(); } std::vector< SvtSecurityOptions::Certificate > GetTrustedAuthors()