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

Julien Nabet serval2412 at yahoo.fr
Fri Apr 25 14:49:59 PDT 2014


 sfx2/source/toolbox/tbxitem.cxx |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 05cd0965487ad631d84bfb89e3c29cc342577195
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Fri Apr 25 23:47:15 2014 +0200

    Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0)
    
    There's still a case with const sal_uInt16 which couldn't be converted
    See http://nabble.documentfoundation.org/Questions-about-getCppuType-td4106361.html for more details
    
    Change-Id: Iddc31168dba88d3ca0454fc76d31cda5f70eb5d1

diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index 81cae6c..8f87dae 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -553,26 +553,26 @@ throw ( ::com::sun::star::uno::RuntimeException, std::exception )
                     rEvent.State >>= nTemp ;
                     pItem = new SfxUInt16Item( nSlotId, nTemp );
                 }
-                else if ( pType == ::getCppuType((const sal_uInt32*)0) )
+                else if ( pType == cppu::UnoType<const sal_uInt32>::get() )
                 {
                     sal_uInt32 nTemp = 0;
                     rEvent.State >>= nTemp ;
                     pItem = new SfxUInt32Item( nSlotId, nTemp );
                 }
-                else if ( pType == ::getCppuType((const OUString*)0) )
+                else if ( pType == cppu::UnoType<const OUString>::get() )
                 {
                     OUString sTemp ;
                     rEvent.State >>= sTemp ;
                     pItem = new SfxStringItem( nSlotId, sTemp );
                 }
-                else if ( pType == ::getCppuType((const ::com::sun::star::frame::status::ItemStatus*)0) )
+                else if ( pType == cppu::UnoType<const ::com::sun::star::frame::status::ItemStatus>::get() )
                 {
                     ItemStatus aItemStatus;
                     rEvent.State >>= aItemStatus;
                     eState = aItemStatus.State;
                     pItem = new SfxVoidItem( nSlotId );
                 }
-                else if ( pType == ::getCppuType((const ::com::sun::star::frame::status::Visibility*)0) )
+                else if ( pType == cppu::UnoType<const ::com::sun::star::frame::status::Visibility>::get() )
                 {
                     Visibility aVisibilityStatus;
                     rEvent.State >>= aVisibilityStatus;
@@ -1099,26 +1099,26 @@ throw ( ::com::sun::star::uno::RuntimeException, std::exception )
                     rEvent.State >>= nTemp ;
                     pItem = new SfxUInt16Item( nSlotId, nTemp );
                 }
-                else if ( pType == ::getCppuType((const sal_uInt32*)0) )
+                else if ( pType == cppu::UnoType<const sal_uInt32>::get() )
                 {
                     sal_uInt32 nTemp = 0;
                     rEvent.State >>= nTemp ;
                     pItem = new SfxUInt32Item( nSlotId, nTemp );
                 }
-                else if ( pType == ::getCppuType((const OUString*)0) )
+                else if ( pType == cppu::UnoType<const OUString>::get() )
                 {
                     OUString sTemp ;
                     rEvent.State >>= sTemp ;
                     pItem = new SfxStringItem( nSlotId, sTemp );
                 }
-                else if ( pType == ::getCppuType((const ::com::sun::star::frame::status::ItemStatus*)0) )
+                else if ( pType == cppu::UnoType<const ::com::sun::star::frame::status::ItemStatus>::get() )
                 {
                     ItemStatus aItemStatus;
                     rEvent.State >>= aItemStatus;
                     eState = aItemStatus.State;
                     pItem = new SfxVoidItem( nSlotId );
                 }
-                else if ( pType == ::getCppuType((const ::com::sun::star::frame::status::Visibility*)0) )
+                else if ( pType == cppu::UnoType<const ::com::sun::star::frame::status::Visibility>::get() )
                 {
                     Visibility aVisibilityStatus;
                     rEvent.State >>= aVisibilityStatus;


More information about the Libreoffice-commits mailing list