summaryrefslogtreecommitdiffstats
path: root/framework
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
parent[API CHANGE] Remove SAL_CALL_ELLIPSE (diff)
downloadcore-6847deb1f7c68cf0402ccbc61c42ca5d285d3a61.tar.gz
core-6847deb1f7c68cf0402ccbc61c42ca5d285d3a61.zip
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')
-rw-r--r--framework/source/fwe/classes/addonmenu.cxx2
-rw-r--r--framework/source/fwe/xml/menuconfiguration.cxx12
-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
6 files changed, 18 insertions, 18 deletions
diff --git a/framework/source/fwe/classes/addonmenu.cxx b/framework/source/fwe/classes/addonmenu.cxx
index a044870378a8..2fddbebe1aee 100644
--- a/framework/source/fwe/classes/addonmenu.cxx
+++ b/framework/source/fwe/classes/addonmenu.cxx
@@ -255,7 +255,7 @@ void AddonMenuManager::BuildMenu( PopupMenu* pCurrent
// Store values from configuration to the New and Wizard menu entries to enable
// sfx2 based code to support high contrast mode correctly!
- sal_uIntPtr nAttributePtr = MenuAttributes::CreateAttribute(aTarget, aImageId);
+ void* nAttributePtr = MenuAttributes::CreateAttribute(aTarget, aImageId);
pCurrentMenu->SetUserValue(nId, nAttributePtr, MenuAttributes::ReleaseAttribute);
pCurrentMenu->SetItemCommand( nId, aURL );
diff --git a/framework/source/fwe/xml/menuconfiguration.cxx b/framework/source/fwe/xml/menuconfiguration.cxx
index d64a9793663d..dead1239926f 100644
--- a/framework/source/fwe/xml/menuconfiguration.cxx
+++ b/framework/source/fwe/xml/menuconfiguration.cxx
@@ -124,25 +124,25 @@ void MenuConfiguration::StoreMenuBarConfigurationToXML(
}
}
-sal_uIntPtr MenuAttributes::CreateAttribute(const OUString& rFrame, const OUString& rImageIdStr)
+void* MenuAttributes::CreateAttribute(const OUString& rFrame, const OUString& rImageIdStr)
{
MenuAttributes* pAttributes = new MenuAttributes(rFrame, rImageIdStr);
pAttributes->acquire();
- return reinterpret_cast<sal_uIntPtr>(pAttributes);
+ return pAttributes;
}
-sal_uIntPtr MenuAttributes::CreateAttribute(const css::uno::WeakReference<css::frame::XDispatchProvider>& rDispatchProvider)
+void* MenuAttributes::CreateAttribute(const css::uno::WeakReference<css::frame::XDispatchProvider>& rDispatchProvider)
{
MenuAttributes* pAttributes = new MenuAttributes(rDispatchProvider);
pAttributes->acquire();
- return reinterpret_cast<sal_uIntPtr>(pAttributes);
+ return pAttributes;
}
-void MenuAttributes::ReleaseAttribute(sal_uIntPtr nAttributePtr)
+void MenuAttributes::ReleaseAttribute(void* nAttributePtr)
{
if (!nAttributePtr)
return;
- MenuAttributes* pAttributes = reinterpret_cast<MenuAttributes*>(nAttributePtr);
+ MenuAttributes* pAttributes = static_cast<MenuAttributes*>(nAttributePtr);
pAttributes->release();
}
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