summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-12-14 10:22:00 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-01-08 15:32:56 +0100
commit326351e2b342eae5ca0154b2ba303b937a696577 (patch)
tree342662f5d5bf7468a0f86fa8c8cca7f313cfc7db /framework
parent5f6aed6016c33c3d2dae26789ac3b6b69f5edbba (diff)
move UserData bodge into VCLXMenu
Change-Id: I20c303788e576a29574a696cb20c9e8a235233b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126804 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uielement/newmenucontroller.cxx7
-rw-r--r--framework/source/uielement/popuptoolbarcontroller.cxx8
2 files changed, 7 insertions, 8 deletions
diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx
index 9b70d5821682..d282509d93f5 100644
--- a/framework/source/uielement/newmenucontroller.cxx
+++ b/framework/source/uielement/newmenucontroller.cxx
@@ -346,7 +346,7 @@ void NewMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > const &
rPopupMenu->setCommand(nItemId, aDynamicMenuEntry.sURL);
void* nAttributePtr = MenuAttributes::CreateAttribute( aDynamicMenuEntry.sTargetName, aDynamicMenuEntry.sImageIdentifier );
- pVCLPopupMenu->SetUserValue( nItemId, nAttributePtr, MenuAttributes::ReleaseAttribute );
+ pPopupMenu->setUserValue(nItemId, nAttributePtr, MenuAttributes::ReleaseAttribute);
nItemId++;
}
@@ -400,9 +400,8 @@ void SAL_CALL NewMenuController::itemSelected( const css::awt::MenuEvent& rEvent
{
SolarMutexGuard aSolarMutexGuard;
- PopupMenu* pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu());
- aURL = pVCLPopupMenu->GetItemCommand(rEvent.MenuId);
- void* nAttributePtr = pVCLPopupMenu->GetUserValue(rEvent.MenuId);
+ aURL = pPopupMenu->getCommand(rEvent.MenuId);
+ void* nAttributePtr = pPopupMenu->getUserValue(rEvent.MenuId);
MenuAttributes* pAttributes = static_cast<MenuAttributes *>(nAttributePtr);
if (pAttributes)
aTargetFrame = pAttributes->aTargetFrame;
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx
index 0e1811f8bcd7..62ac260f6c77 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -696,8 +696,8 @@ void SAL_CALL NewToolbarController::execute( sal_Int16 /*KeyModifier*/ )
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 ) ) );
+ VCLXMenu* pMenu = comphelper::getFromUnoTunnel<VCLXMenu>(m_xPopupMenu);
+ MenuAttributes* pMenuAttributes(static_cast<MenuAttributes*>(pMenu->getUserValue(m_nMenuId)));
if ( pMenuAttributes )
aTarget = pMenuAttributes->aTargetFrame;
else
@@ -749,8 +749,8 @@ void SAL_CALL NewToolbarController::updateImage()
if ( m_xPopupMenu.is() && m_nMenuId )
{
aURL = m_xPopupMenu->getCommand(m_nMenuId);
- Menu* pVclMenu = comphelper::getFromUnoTunnel<VCLXMenu>( m_xPopupMenu )->GetMenu();
- MenuAttributes* pMenuAttributes( static_cast<MenuAttributes*>( pVclMenu->GetUserValue( m_nMenuId ) ) );
+ VCLXMenu* pMenu = comphelper::getFromUnoTunnel<VCLXMenu>(m_xPopupMenu);
+ MenuAttributes* pMenuAttributes(static_cast<MenuAttributes*>(pMenu->getUserValue(m_nMenuId)));
if ( pMenuAttributes )
aImageId = pMenuAttributes->aImageId;
}