[Libreoffice-commits] core.git: framework/source

Takeshi Abe tabe at fixedpoint.jp
Mon Feb 6 10:33:01 UTC 2017


 framework/source/uielement/newmenucontroller.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8e53f220ff7c13cccc388f1de3a92f82079c227f
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Mon Feb 6 11:44:59 2017 +0900

    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 at libreoffice.org>
    Reviewed-by: Maxim Monastirsky <momonasmon at gmail.com>
    Tested-by: Maxim Monastirsky <momonasmon at gmail.com>

diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx
index b371e26..7ee1e56 100644
--- a/framework/source/uielement/newmenucontroller.cxx
+++ b/framework/source/uielement/newmenucontroller.cxx
@@ -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;


More information about the Libreoffice-commits mailing list