diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-11-29 11:10:51 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-11-29 21:17:59 +0100 |
commit | d521438710cf977b21dcec71d78bbfac966a1061 (patch) | |
tree | c5e87f5cb25181a9617a3ded9618cbb8b7dd03ce /framework | |
parent | b2c5944d38f107d77d647bca114fae4e940edcbf (diff) |
can use css::awt::XPopupMenu::setCommand
instead of PopupMenu::SetItemCommand since...
commit 9aa4101c53e483be1d25c1e5aaad2cf542540a56
Date: Wed Feb 25 16:57:46 2004 +0000
INTEGRATION: CWS layoutmanager (1.3.146); FILE MERGED
2004/01/19 10:03:03 cd 1.3.146.2: #111899# Added new interface
to support set/get commands/help URL
Change-Id: I527d2ad2a12f7933d5e2cd892b26e96e284a0631
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126038
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/uielement/macrosmenucontroller.cxx | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/framework/source/uielement/macrosmenucontroller.cxx b/framework/source/uielement/macrosmenucontroller.cxx index cddfed74c693..a0745b1e4f6f 100644 --- a/framework/source/uielement/macrosmenucontroller.cxx +++ b/framework/source/uielement/macrosmenucontroller.cxx @@ -23,7 +23,6 @@ #include <com/sun/star/uno/XComponentContext.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> #include <osl/mutex.hxx> @@ -74,24 +73,17 @@ void MacrosMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > cons if (bMacrosDisabled) return; - VCLXPopupMenu* pVCLPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getFromUnoTunnel<VCLXMenu>( rPopupMenu )); - PopupMenu* pPopupMenu = nullptr; - SolarMutexGuard aSolarMutexGuard; - resetPopupMenu( rPopupMenu ); - if ( pVCLPopupMenu ) - pPopupMenu = static_cast<PopupMenu *>(pVCLPopupMenu->GetMenu()); - - if (!pPopupMenu) - return; + resetPopupMenu(rPopupMenu); + assert(rPopupMenu->getItemCount() == 0); // insert basic OUString aCommand(".uno:MacroDialog"); auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aCommand, m_aModuleName); OUString aDisplayName = vcl::CommandInfoProvider::GetMenuLabelForCommand(aProperties); - pPopupMenu->InsertItem( 2, aDisplayName ); - pPopupMenu->SetItemCommand( 2, aCommand ); + rPopupMenu->insertItem(2, aDisplayName, 0, 0); + rPopupMenu->setCommand(2, aCommand); // insert providers but not basic or java addScriptItems(rPopupMenu, 4); |