summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-12-02 15:54:13 +0100
committerSerge Krot (CIB) <Serge.Krot@cib.de>2019-12-02 18:28:31 +0100
commite58eda7df5b384c0f054fcbd4a8dc4a47bed2080 (patch)
treed0953de4d96fefe708882cb5641c2f6d1f9029b1 /framework
parenta322e61b51a04e189618e1d0c8c17f9c080a3d1d (diff)
Disable macro menu entries when DisableMacrosExecution is set
Change-Id: Ica9a4f4a6510717dcd9fe53676e5a6f261f005ce Reviewed-on: https://gerrit.libreoffice.org/84231 Reviewed-by: Serge Krot (CIB) <Serge.Krot@cib.de> Tested-by: Serge Krot (CIB) <Serge.Krot@cib.de>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uielement/macrosmenucontroller.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/framework/source/uielement/macrosmenucontroller.cxx b/framework/source/uielement/macrosmenucontroller.cxx
index 8ab6958f39eb..03dba963af7d 100644
--- a/framework/source/uielement/macrosmenucontroller.cxx
+++ b/framework/source/uielement/macrosmenucontroller.cxx
@@ -21,6 +21,7 @@
#include <services.h>
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
+#include <officecfg/Office/Common.hxx>
#include <toolkit/awt/vclxmenu.hxx>
#include <vcl/svapp.hxx>
#include <vcl/commandinfoprovider.hxx>
@@ -58,6 +59,10 @@ MacrosMenuController::~MacrosMenuController()
// private function
void MacrosMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > const & rPopupMenu )
{
+ bool bMacrosDisabled = officecfg::Office::Common::Security::Scripting::DisableMacrosExecution::get();
+ if (bMacrosDisabled)
+ return;
+
VCLXPopupMenu* pVCLPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getUnoTunnelImplementation<VCLXMenu>( rPopupMenu ));
PopupMenu* pPopupMenu = nullptr;