summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-12-02 15:54:13 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-12-03 09:33:15 +0100
commite5c258b5422f9c98dcddc102b323c00f99a48a5f (patch)
tree89c4f9efa10e46d012abb30c5e4b343864a43198 /framework
parent926b39e6c7acbaace8e311dba0a2527ac8c20b09 (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> (cherry picked from commit e58eda7df5b384c0f054fcbd4a8dc4a47bed2080) Reviewed-on: https://gerrit.libreoffice.org/84293 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@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 c9beceba63f7..001fafacd4d5 100644
--- a/framework/source/uielement/macrosmenucontroller.cxx
+++ b/framework/source/uielement/macrosmenucontroller.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#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/i18nhelp.hxx>
@@ -65,6 +66,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;