From 6847deb1f7c68cf0402ccbc61c42ca5d285d3a61 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 12 Dec 2017 15:33:40 +0200 Subject: sal_uLong->void* for userdata in Menu Change-Id: I58fb10136a23c445edfd63a1f86ace3995524704 Reviewed-on: https://gerrit.libreoffice.org/46350 Tested-by: Jenkins Reviewed-by: Noel Grandin --- framework/source/uielement/menubarmanager.cxx | 8 ++++---- framework/source/uielement/newmenucontroller.cxx | 10 +++++----- framework/source/uielement/popuptoolbarcontroller.cxx | 2 +- framework/source/uielement/toolbarsmenucontroller.cxx | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'framework/source/uielement') diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 3d336f00bf53..fa5215f80213 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -1125,7 +1125,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF Reference< XDispatchProvider > xPopupMenuDispatchProvider( rDispatchProvider ); // Retrieve possible attributes struct - MenuAttributes* pAttributes = reinterpret_cast(pMenu->GetUserValue( nItemId )); + MenuAttributes* pAttributes = static_cast(pMenu->GetUserValue( nItemId )); if ( pAttributes ) xPopupMenuDispatchProvider = pAttributes->xDispatchProvider; @@ -1513,7 +1513,7 @@ void MenuBarManager::FillMenu( if ( xDispatchProvider.is() ) { // Use attributes struct to transport special dispatch provider - sal_uIntPtr nAttributePtr = MenuAttributes::CreateAttribute(xDispatchProvider); + void* nAttributePtr = MenuAttributes::CreateAttribute(xDispatchProvider); pMenu->SetUserValue(nId, nAttributePtr, MenuAttributes::ReleaseAttribute); } @@ -1766,7 +1766,7 @@ void MenuBarManager::Init(const Reference< XFrame >& rFrame, Menu* pAddonMenu, b { if ( pAddonMenu->GetItemType( i ) != MenuItemType::SEPARATOR ) { - MenuAttributes* pAddonAttributes = reinterpret_cast(pAddonMenu->GetUserValue( nItemId )); + MenuAttributes* pAddonAttributes = static_cast(pAddonMenu->GetUserValue( nItemId )); MenuItemHandler* pMenuItemHandler = new MenuItemHandler( nItemId, xStatusListener, xDispatch ); if ( pAddonAttributes ) @@ -1905,7 +1905,7 @@ void MenuBarManager::FillMenuImages(Reference< XFrame > const & _xFrame, Menu* _ OUString aImageId; ::framework::MenuAttributes* pMenuAttributes = - reinterpret_cast< ::framework::MenuAttributes*>(_pMenu->GetUserValue( nId )); + static_cast< ::framework::MenuAttributes*>(_pMenu->GetUserValue( nId )); if ( pMenuAttributes ) aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx index ec5d85dc4fde..55fefaad9368 100644 --- a/framework/source/uielement/newmenucontroller.cxx +++ b/framework/source/uielement/newmenucontroller.cxx @@ -83,8 +83,8 @@ void NewMenuController::setMenuImages( PopupMenu* pPopupMenu, bool bSetImages ) { OUString aImageId; OUString aCmd( pPopupMenu->GetItemCommand( nItemId ) ); - sal_uLong nAttributePtr = pPopupMenu->GetUserValue( nItemId ); - MenuAttributes* pAttributes = reinterpret_cast(nAttributePtr); + void* nAttributePtr = pPopupMenu->GetUserValue( nItemId ); + MenuAttributes* pAttributes = static_cast(nAttributePtr); if (pAttributes) aImageId = pAttributes->aImageId; @@ -354,7 +354,7 @@ void NewMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > const & pVCLPopupMenu->InsertItem( nItemId, aTitle ); pVCLPopupMenu->SetItemCommand( nItemId, aURL ); - sal_uIntPtr nAttributePtr = MenuAttributes::CreateAttribute( aTargetFrame, aImageId ); + void* nAttributePtr = MenuAttributes::CreateAttribute( aTargetFrame, aImageId ); pVCLPopupMenu->SetUserValue( nItemId, nAttributePtr, MenuAttributes::ReleaseAttribute ); nItemId++; @@ -409,8 +409,8 @@ void SAL_CALL NewMenuController::itemSelected( const css::awt::MenuEvent& rEvent SolarMutexGuard aSolarMutexGuard; PopupMenu* pVCLPopupMenu = static_cast(pPopupMenu->GetMenu()); aURL = pVCLPopupMenu->GetItemCommand(rEvent.MenuId); - sal_uLong nAttributePtr = pVCLPopupMenu->GetUserValue(rEvent.MenuId); - MenuAttributes* pAttributes = reinterpret_cast(nAttributePtr); + void* nAttributePtr = pVCLPopupMenu->GetUserValue(rEvent.MenuId); + MenuAttributes* pAttributes = static_cast(nAttributePtr); if (pAttributes) aTargetFrame = pAttributes->aTargetFrame; } diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index 3a2065fa6578..cb41c774fc10 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -671,7 +671,7 @@ void SAL_CALL NewToolbarController::execute( sal_Int16 /*KeyModifier*/ ) dynamic_cast< PopupMenu * >( pTkPopupMenu->GetMenu() ) : nullptr; if ( pVCLPopupMenu ) - pMenuAttributes = reinterpret_cast< MenuAttributes* >( + pMenuAttributes = static_cast< MenuAttributes* >( pVCLPopupMenu->GetUserValue( pVCLPopupMenu->GetCurItemId() ) ); if ( pMenuAttributes ) diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index 7dab218d25c6..ba4b27744056 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -385,7 +385,7 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > co PopupMenu* pVCLPopupMenu = pXPopupMenu ? static_cast(pXPopupMenu->GetMenu()) : nullptr; assert(pVCLPopupMenu); if (pVCLPopupMenu) - pVCLPopupMenu->SetUserValue( nIndex, sal_uLong( aSortedTbs[i].bContextSensitive ? 1 : 0 )); + pVCLPopupMenu->SetUserValue( nIndex, reinterpret_cast( aSortedTbs[i].bContextSensitive ? 1 : 0 )); } // use VCL popup menu pointer to set vital information that are not part of the awt implementation -- cgit v1.2.3