diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-11-29 11:18:39 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-11-29 21:19:21 +0100 |
commit | f416f480ebe13e33021c75bf13002e447d8dbde1 (patch) | |
tree | 01cd25ed18f6e38f3169d93a17ac6fbc645d2422 /framework | |
parent | b7d12aab92b919e3b8a68be2ce2c7599f1d9dc7f (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: I4e78ad66771562ab80b8aad91347c1b99dccb1a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126040
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/uielement/toolbarmodemenucontroller.cxx | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/framework/source/uielement/toolbarmodemenucontroller.cxx b/framework/source/uielement/toolbarmodemenucontroller.cxx index 653f0c5a6cca..0a52ac084ccb 100644 --- a/framework/source/uielement/toolbarmodemenucontroller.cxx +++ b/framework/source/uielement/toolbarmodemenucontroller.cxx @@ -27,8 +27,6 @@ #include <officecfg/Office/Common.hxx> -#include <toolkit/awt/vclxmenu.hxx> -#include <vcl/menu.hxx> #include <vcl/svapp.hxx> #include <vcl/EnumContext.hxx> #include <rtl/ustrbuf.hxx> @@ -183,39 +181,33 @@ void SAL_CALL ToolbarModeMenuController::statusChanged( const FeatureStateEvent& return; SolarMutexGuard aGuard; - VCLXPopupMenu* pXPopupMenu = static_cast<VCLXPopupMenu *>(comphelper::getFromUnoTunnel<VCLXMenu>( xPopupMenu )); - PopupMenu* pVCLPopupMenu = pXPopupMenu ? static_cast<PopupMenu *>(pXPopupMenu->GetMenu()) : nullptr; - - SAL_WARN_IF(!pVCLPopupMenu, "fwk.uielement", "worrying lack of popup menu"); - if (!pVCLPopupMenu) - return; bool bSetCheckmark = false; bool bCheckmark = false; - for ( sal_uInt16 i = 0; i < pVCLPopupMenu->GetItemCount(); i++ ) + for (sal_Int16 i = 0, nCount = xPopupMenu->getItemCount(); i < nCount; ++i) { - sal_uInt16 nId = pVCLPopupMenu->GetItemId( i ); + sal_Int16 nId = xPopupMenu->getItemId(i); if ( nId == 0 ) continue; - OUString aCmd = pVCLPopupMenu->GetItemCommand( nId ); + OUString aCmd = xPopupMenu->getCommand(nId); if ( aCmd == aFeatureURL ) { // Enable/disable item - pVCLPopupMenu->EnableItem( nId, Event.IsEnabled ); + xPopupMenu->enableItem(nId, Event.IsEnabled); // Checkmark if ( Event.State >>= bCheckmark ) bSetCheckmark = true; if ( bSetCheckmark ) - pVCLPopupMenu->CheckItem( nId, bCheckmark ); + xPopupMenu->checkItem(nId, bCheckmark); else { OUString aItemText; if ( Event.State >>= aItemText ) - pVCLPopupMenu->SetItemText( nId, aItemText ); + xPopupMenu->setItemText(nId, aItemText); } } } |