summaryrefslogtreecommitdiff
path: root/framework/source/uielement
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-12-12 15:33:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-12-13 12:20:07 +0100
commit6847deb1f7c68cf0402ccbc61c42ca5d285d3a61 (patch)
tree6ec482608dc101cb911d9a93c7cb41149eb4af2d /framework/source/uielement
parent6cbbe3a6c35cde186351315ddb189366bcca1deb (diff)
sal_uLong->void* for userdata in Menu
Change-Id: I58fb10136a23c445edfd63a1f86ace3995524704 Reviewed-on: https://gerrit.libreoffice.org/46350 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework/source/uielement')
-rw-r--r--framework/source/uielement/menubarmanager.cxx8
-rw-r--r--framework/source/uielement/newmenucontroller.cxx10
-rw-r--r--framework/source/uielement/popuptoolbarcontroller.cxx2
-rw-r--r--framework/source/uielement/toolbarsmenucontroller.cxx2
4 files changed, 11 insertions, 11 deletions
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<MenuAttributes *>(pMenu->GetUserValue( nItemId ));
+ MenuAttributes* pAttributes = static_cast<MenuAttributes *>(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<MenuAttributes *>(pAddonMenu->GetUserValue( nItemId ));
+ MenuAttributes* pAddonAttributes = static_cast<MenuAttributes *>(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<MenuAttributes *>(nAttributePtr);
+ void* nAttributePtr = pPopupMenu->GetUserValue( nItemId );
+ MenuAttributes* pAttributes = static_cast<MenuAttributes *>(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<PopupMenu *>(pPopupMenu->GetMenu());
aURL = pVCLPopupMenu->GetItemCommand(rEvent.MenuId);
- sal_uLong nAttributePtr = pVCLPopupMenu->GetUserValue(rEvent.MenuId);
- MenuAttributes* pAttributes = reinterpret_cast<MenuAttributes *>(nAttributePtr);
+ void* nAttributePtr = pVCLPopupMenu->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 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<PopupMenu *>(pXPopupMenu->GetMenu()) : nullptr;
assert(pVCLPopupMenu);
if (pVCLPopupMenu)
- pVCLPopupMenu->SetUserValue( nIndex, sal_uLong( aSortedTbs[i].bContextSensitive ? 1 : 0 ));
+ pVCLPopupMenu->SetUserValue( nIndex, reinterpret_cast<void*>( aSortedTbs[i].bContextSensitive ? 1 : 0 ));
}
// use VCL popup menu pointer to set vital information that are not part of the awt implementation