framework: Pass Item ID to Menu::GetUserValue() instead of index

This also avoids needless cast.

Change-Id: I3fd1517657b489115f20e26f4f75f3e3a5b7c9b7
Reviewed-on: https://gerrit.libreoffice.org/33944
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Tested-by: Maxim Monastirsky <momonasmon@gmail.com>
This commit is contained in:
Takeshi Abe
2017-02-06 11:44:59 +09:00
committed by Maxim Monastirsky
parent d8662a6950
commit 8e53f220ff

View File

@@ -76,14 +76,14 @@ void NewMenuController::setMenuImages( PopupMenu* pPopupMenu, bool bSetImages )
for ( sal_uInt16 i = 0; i < nItemCount; i++ )
{
sal_uInt16 nItemId = pPopupMenu->GetItemId( sal::static_int_cast<sal_uInt16>( i ));
sal_uInt16 nItemId = pPopupMenu->GetItemId( i );
if ( nItemId != 0 )
{
if ( bSetImages )
{
OUString aImageId;
OUString aCmd( pPopupMenu->GetItemCommand( nItemId ) );
sal_uLong nAttributePtr = pPopupMenu->GetUserValue(sal::static_int_cast<sal_uInt16>(i));
sal_uLong nAttributePtr = pPopupMenu->GetUserValue( nItemId );
MenuAttributes* pAttributes = reinterpret_cast<MenuAttributes *>(nAttributePtr);
if (pAttributes)
aImageId = pAttributes->aImageId;