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:
committed by
Maxim Monastirsky
parent
d8662a6950
commit
8e53f220ff
@@ -76,14 +76,14 @@ void NewMenuController::setMenuImages( PopupMenu* pPopupMenu, bool bSetImages )
|
|||||||
|
|
||||||
for ( sal_uInt16 i = 0; i < nItemCount; i++ )
|
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 ( nItemId != 0 )
|
||||||
{
|
{
|
||||||
if ( bSetImages )
|
if ( bSetImages )
|
||||||
{
|
{
|
||||||
OUString aImageId;
|
OUString aImageId;
|
||||||
OUString aCmd( pPopupMenu->GetItemCommand( nItemId ) );
|
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);
|
MenuAttributes* pAttributes = reinterpret_cast<MenuAttributes *>(nAttributePtr);
|
||||||
if (pAttributes)
|
if (pAttributes)
|
||||||
aImageId = pAttributes->aImageId;
|
aImageId = pAttributes->aImageId;
|
||||||
|
Reference in New Issue
Block a user