summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-11-29 21:19:06 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-11-30 11:16:47 +0100
commit64ed0dcf6dbd9567ec33cd07ca8a15c63e86b9df (patch)
tree3a0442ba4aca5f186245f178f8987aae9ab3bc13 /framework
parent93b04984518dbfed9e39d093b844113e81fda735 (diff)
use more XPopupMenu methods over PopupMenu ones
Change-Id: Ib60ae5db7097cd92cc7971fd8227b8753391da26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126073 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uielement/popuptoolbarcontroller.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx
index 078022c6ac85..a061d6d60754 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -693,11 +693,11 @@ void SAL_CALL NewToolbarController::execute( sal_Int16 /*KeyModifier*/ )
OUString aURL, aTarget;
if ( m_xPopupMenu.is() && m_nMenuId )
{
- // TODO investigate how to wrap Get/SetUserValue in css::awt::XMenu
SolarMutexGuard aSolarMutexGuard;
- Menu* pVclMenu = comphelper::getFromUnoTunnel<VCLXMenu>( m_xPopupMenu )->GetMenu();
- aURL = pVclMenu->GetItemCommand( m_nMenuId );
+ aURL = m_xPopupMenu->getCommand(m_nMenuId);
+ // TODO investigate how to wrap Get/SetUserValue in css::awt::XMenu
+ Menu* pVclMenu = comphelper::getFromUnoTunnel<VCLXMenu>( m_xPopupMenu )->GetMenu();
MenuAttributes* pMenuAttributes( static_cast<MenuAttributes*>( pVclMenu->GetUserValue( m_nMenuId ) ) );
if ( pMenuAttributes )
aTarget = pMenuAttributes->aTargetFrame;
@@ -723,12 +723,11 @@ sal_uInt16 NewToolbarController::getMenuIdForCommand( std::u16string_view rComma
{
if ( m_xPopupMenu.is() && !rCommand.empty() )
{
- Menu* pVclMenu( comphelper::getFromUnoTunnel<VCLXMenu>( m_xPopupMenu )->GetMenu() );
- sal_uInt16 nCount = pVclMenu->GetItemCount();
+ sal_uInt16 nCount = m_xPopupMenu->getItemCount();
for ( sal_uInt16 n = 0; n < nCount; ++n )
{
- sal_uInt16 nId = pVclMenu->GetItemId( n );
- OUString aCmd( pVclMenu->GetItemCommand( nId ) );
+ sal_uInt16 nId = m_xPopupMenu->getItemId(n);
+ OUString aCmd(m_xPopupMenu->getCommand(nId));
// match even if the menu command is more detailed
// (maybe an additional query) #i28667#
@@ -750,9 +749,8 @@ void SAL_CALL NewToolbarController::updateImage()
OUString aURL, aImageId;
if ( m_xPopupMenu.is() && m_nMenuId )
{
+ aURL = m_xPopupMenu->getCommand(m_nMenuId);
Menu* pVclMenu = comphelper::getFromUnoTunnel<VCLXMenu>( m_xPopupMenu )->GetMenu();
- aURL = pVclMenu->GetItemCommand( m_nMenuId );
-
MenuAttributes* pMenuAttributes( static_cast<MenuAttributes*>( pVclMenu->GetUserValue( m_nMenuId ) ) );
if ( pMenuAttributes )
aImageId = pMenuAttributes->aImageId;