From ebd4986c3495239f09510f2c0c79b6e30acda83e Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Mon, 5 May 2014 23:24:25 +0200 Subject: Prefer cppu::UnoType::get() to ::getCppuType((T*)0) part2 Change-Id: Ibca921eff3647507ffb7e9011a84aeefbec58d7a --- sfx2/source/control/querystatus.cxx | 10 +++++----- sfx2/source/control/statcach.cxx | 6 +++--- sfx2/source/statbar/stbitem.cxx | 8 ++++---- sfx2/source/toolbox/tbxitem.cxx | 20 ++++++++++---------- 4 files changed, 22 insertions(+), 22 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/control/querystatus.cxx b/sfx2/source/control/querystatus.cxx index ef03199e3a22..f9fa48793531 100644 --- a/sfx2/source/control/querystatus.cxx +++ b/sfx2/source/control/querystatus.cxx @@ -117,32 +117,32 @@ throw( RuntimeException, std::exception ) rEvent.State >>= bTemp ; m_pItem = new SfxBoolItem( m_nSlotID, bTemp ); } - else if ( pType == ::getCppuType((const sal_uInt16*)0) ) + else if ( pType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get() ) { sal_uInt16 nTemp = 0; rEvent.State >>= nTemp ; m_pItem = new SfxUInt16Item( m_nSlotID, nTemp ); } - else if ( pType == ::getCppuType((const sal_uInt32*)0) ) + else if ( pType == cppu::UnoType::get() ) { sal_uInt32 nTemp = 0; rEvent.State >>= nTemp ; m_pItem = new SfxUInt32Item( m_nSlotID, nTemp ); } - else if ( pType == ::getCppuType((const OUString*)0) ) + else if ( pType == cppu::UnoType::get() ) { OUString sTemp ; rEvent.State >>= sTemp ; m_pItem = new SfxStringItem( m_nSlotID, sTemp ); } - else if ( pType == ::getCppuType((const ::com::sun::star::frame::status::ItemStatus*)0) ) + else if ( pType == cppu::UnoType<::com::sun::star::frame::status::ItemStatus>::get() ) { ItemStatus aItemStatus; rEvent.State >>= aItemStatus; m_eState = aItemStatus.State; m_pItem = new SfxVoidItem( m_nSlotID ); } - else if ( pType == ::getCppuType((const ::com::sun::star::frame::status::Visibility*)0) ) + else if ( pType == cppu::UnoType<::com::sun::star::frame::status::Visibility>::get() ) { Visibility aVisibilityStatus; rEvent.State >>= aVisibilityStatus; diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx index fcc7e7f65d92..6b5b5098de61 100644 --- a/sfx2/source/control/statcach.cxx +++ b/sfx2/source/control/statcach.cxx @@ -102,19 +102,19 @@ void SAL_CALL BindDispatch_Impl::statusChanged( const ::com::sun::star::frame:: aAny >>= bTemp ; pItem = new SfxBoolItem( nId, bTemp ); } - else if ( pType == ::getCppuType((const sal_uInt16*)0) ) + else if ( pType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get() ) { sal_uInt16 nTemp = 0; aAny >>= nTemp ; pItem = new SfxUInt16Item( nId, nTemp ); } - else if ( pType == ::getCppuType((const sal_uInt32*)0) ) + else if ( pType == cppu::UnoType::get() ) { sal_uInt32 nTemp = 0; aAny >>= nTemp ; pItem = new SfxUInt32Item( nId, nTemp ); } - else if ( pType == ::getCppuType((const OUString*)0) ) + else if ( pType == cppu::UnoType::get() ) { OUString sTemp ; aAny >>= sTemp ; diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx index 9805c80fe45b..549b46f37d38 100644 --- a/sfx2/source/statbar/stbitem.cxx +++ b/sfx2/source/statbar/stbitem.cxx @@ -268,25 +268,25 @@ throw ( ::com::sun::star::uno::RuntimeException, std::exception ) rEvent.State >>= bTemp ; pItem = new SfxBoolItem( nSlotID, bTemp ); } - else if ( pType == ::getCppuType((const sal_uInt16*)0) ) + else if ( pType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get() ) { sal_uInt16 nTemp = 0; rEvent.State >>= nTemp ; pItem = new SfxUInt16Item( nSlotID, nTemp ); } - else if ( pType == ::getCppuType((const sal_uInt32*)0) ) + else if ( pType == cppu::UnoType::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::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<::com::sun::star::frame::status::ItemStatus>::get() ) { frame::status::ItemStatus aItemStatus; rEvent.State >>= aItemStatus; diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index 8f87dae0a75d..bb1be33546a4 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -547,32 +547,32 @@ throw ( ::com::sun::star::uno::RuntimeException, std::exception ) rEvent.State >>= bTemp ; pItem = new SfxBoolItem( nSlotId, bTemp ); } - else if ( pType == ::getCppuType((const sal_uInt16*)0) ) + else if ( pType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get()) { sal_uInt16 nTemp = 0; rEvent.State >>= nTemp ; pItem = new SfxUInt16Item( nSlotId, nTemp ); } - else if ( pType == cppu::UnoType::get() ) + else if ( pType == cppu::UnoType::get() ) { sal_uInt32 nTemp = 0; rEvent.State >>= nTemp ; pItem = new SfxUInt32Item( nSlotId, nTemp ); } - else if ( pType == cppu::UnoType::get() ) + else if ( pType == cppu::UnoType::get() ) { OUString sTemp ; rEvent.State >>= sTemp ; pItem = new SfxStringItem( nSlotId, sTemp ); } - else if ( pType == cppu::UnoType::get() ) + else if ( pType == cppu::UnoType<::com::sun::star::frame::status::ItemStatus>::get() ) { ItemStatus aItemStatus; rEvent.State >>= aItemStatus; eState = aItemStatus.State; pItem = new SfxVoidItem( nSlotId ); } - else if ( pType == cppu::UnoType::get() ) + else if ( pType == cppu::UnoType<::com::sun::star::frame::status::Visibility>::get() ) { Visibility aVisibilityStatus; rEvent.State >>= aVisibilityStatus; @@ -1093,32 +1093,32 @@ throw ( ::com::sun::star::uno::RuntimeException, std::exception ) rEvent.State >>= bTemp ; pItem = new SfxBoolItem( nSlotId, bTemp ); } - else if ( pType == ::getCppuType((const sal_uInt16*)0) ) + else if ( pType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get()) { sal_uInt16 nTemp = 0; rEvent.State >>= nTemp ; pItem = new SfxUInt16Item( nSlotId, nTemp ); } - else if ( pType == cppu::UnoType::get() ) + else if ( pType == cppu::UnoType::get() ) { sal_uInt32 nTemp = 0; rEvent.State >>= nTemp ; pItem = new SfxUInt32Item( nSlotId, nTemp ); } - else if ( pType == cppu::UnoType::get() ) + else if ( pType == cppu::UnoType::get() ) { OUString sTemp ; rEvent.State >>= sTemp ; pItem = new SfxStringItem( nSlotId, sTemp ); } - else if ( pType == cppu::UnoType::get() ) + else if ( pType == cppu::UnoType<::com::sun::star::frame::status::ItemStatus>::get() ) { ItemStatus aItemStatus; rEvent.State >>= aItemStatus; eState = aItemStatus.State; pItem = new SfxVoidItem( nSlotId ); } - else if ( pType == cppu::UnoType::get() ) + else if ( pType == cppu::UnoType<::com::sun::star::frame::status::Visibility>::get() ) { Visibility aVisibilityStatus; rEvent.State >>= aVisibilityStatus; -- cgit