[Libreoffice-commits] core.git: Branch 'feature/cib_contract3756' - basctl/source
Samuel Mehrbrodt (via logerrit)
logerrit at kemper.freedesktop.org
Tue Nov 12 21:00:12 UTC 2019
basctl/source/basicide/baside2.cxx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit f3a2876ab1f8d6ab95f3bcdc493aa0bee0223db3
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Mon Nov 11 14:53:51 2019 +0100
Commit: Serge Krot (CIB) <Serge.Krot at cib.de>
CommitDate: Tue Nov 12 21:59:11 2019 +0100
Fix macro disabling in Basic IDE
After 8d69ca60f3c8f53699986f924291a2acda5694a1 macros were always disabled
as ScriptDocument::allowMacros always returned false when called from
non-document context.
Change-Id: Ibef4c7d561f4ee01cd44f5327e4ab948282bb07d
Reviewed-on: https://gerrit.libreoffice.org/82445
Reviewed-by: Serge Krot (CIB) <Serge.Krot at cib.de>
Tested-by: Serge Krot (CIB) <Serge.Krot at cib.de>
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index af35a3a3dc7b..5cb16f8f1f58 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -62,6 +62,7 @@
#include <toolkit/helper/vclunohelper.hxx>
#include <cassert>
#include <osl/diagnose.h>
+#include <officecfg/Office/Common.hxx>
namespace basctl
{
@@ -308,7 +309,8 @@ void ModulWindow::BasicExecute()
{
// #116444# check security settings before macro execution
ScriptDocument aDocument( GetDocument() );
- if (!aDocument.allowMacros())
+ bool bMacrosDisabled = officecfg::Office::Common::Security::Scripting::DisableMacrosExecution::get();
+ if (bMacrosDisabled || (aDocument.isDocument() && !aDocument.allowMacros()))
{
std::unique_ptr<weld::MessageDialog> xBox(
Application::CreateMessageDialog(GetFrameWeld(), VclMessageType::Warning,
More information about the Libreoffice-commits
mailing list