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

Julien Nabet serval2412 at yahoo.fr
Tue May 6 14:26:37 PDT 2014


 connectivity/source/commontools/dbtools.cxx          |   20 +++++++++----------
 extensions/source/propctrlr/stringrepresentation.cxx |   12 +++++------
 sd/source/core/CustomAnimationCloner.cxx             |    8 +++----
 sd/source/filter/ppt/pptinanimations.cxx             |   12 +++++------
 sfx2/source/control/unoctitm.cxx                     |    8 +++----
 5 files changed, 30 insertions(+), 30 deletions(-)

New commits:
commit 21010f3ea76a98ba8349b7ab3ffd7dcadd6a2d1c
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Tue May 6 23:25:13 2014 +0200

    Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part4
    
    Change-Id: I8e52c2fd66f8f3291434ee82a745431e11b12caf

diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index 3ce8bf2..7ebf4a1 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -1508,24 +1508,24 @@ bool implUpdateObject(const Reference< XRowUpdate >& _rxUpdatedObject,
             break;
 
         case TypeClass_SEQUENCE:
-            if (_rValue.getValueType() == ::getCppuType((const Sequence< sal_Int8 > *)0))
+            if (_rValue.getValueType() == cppu::UnoType< Sequence< sal_Int8 > >::get())
                 _rxUpdatedObject->updateBytes(_nColumnIndex, *(Sequence<sal_Int8>*)_rValue.getValue());
             else
                 bSuccessfullyReRouted = false;
             break;
         case TypeClass_STRUCT:
-            if (_rValue.getValueType() == ::getCppuType((const DateTime*)0))
+            if (_rValue.getValueType() == cppu::UnoType<DateTime>::get())
                 _rxUpdatedObject->updateTimestamp(_nColumnIndex, *(DateTime*)_rValue.getValue());
-            else if (_rValue.getValueType() == ::getCppuType((const Date*)0))
+            else if (_rValue.getValueType() == cppu::UnoType<Date>::get())
                 _rxUpdatedObject->updateDate(_nColumnIndex, *(Date*)_rValue.getValue());
-            else if (_rValue.getValueType() == ::getCppuType((const Time*)0))
+            else if (_rValue.getValueType() == cppu::UnoType<Time>::get())
                 _rxUpdatedObject->updateTime(_nColumnIndex, *(Time*)_rValue.getValue());
             else
                 bSuccessfullyReRouted = false;
             break;
 
         case TypeClass_INTERFACE:
-            if (_rValue.getValueType() == ::getCppuType(static_cast<Reference< XInputStream>*>(NULL)))
+            if (_rValue.getValueType() == cppu::UnoType<Reference< XInputStream> >::get())
             {
                 Reference< XInputStream >  xStream;
                 _rValue >>= xStream;
@@ -1613,7 +1613,7 @@ bool implSetObject( const Reference< XParameters >& _rxParameters,
             break;
 
         case TypeClass_SEQUENCE:
-            if (_rValue.getValueType() == ::getCppuType((const Sequence< sal_Int8 > *)0))
+            if (_rValue.getValueType() == cppu::UnoType< Sequence< sal_Int8 > >::get())
             {
                 _rxParameters->setBytes(_nColumnIndex, *(Sequence<sal_Int8>*)_rValue.getValue());
             }
@@ -1621,18 +1621,18 @@ bool implSetObject( const Reference< XParameters >& _rxParameters,
                 bSuccessfullyReRouted = false;
             break;
         case TypeClass_STRUCT:
-            if (_rValue.getValueType() == ::getCppuType((const DateTime*)0))
+            if (_rValue.getValueType() == cppu::UnoType<DateTime>::get())
                 _rxParameters->setTimestamp(_nColumnIndex, *(DateTime*)_rValue.getValue());
-            else if (_rValue.getValueType() == ::getCppuType((const Date*)0))
+            else if (_rValue.getValueType() == cppu::UnoType<Date>::get())
                 _rxParameters->setDate(_nColumnIndex, *(Date*)_rValue.getValue());
-            else if (_rValue.getValueType() == ::getCppuType((const Time*)0))
+            else if (_rValue.getValueType() == cppu::UnoType<Time>::get())
                 _rxParameters->setTime(_nColumnIndex, *(Time*)_rValue.getValue());
             else
                 bSuccessfullyReRouted = false;
             break;
 
         case TypeClass_INTERFACE:
-            if (_rValue.getValueType() == ::getCppuType(static_cast<Reference< XInputStream>*>(NULL)))
+            if (_rValue.getValueType() == cppu::UnoType<Reference< XInputStream> >::get())
             {
                 Reference< XInputStream >  xStream;
                 _rValue >>= xStream;
diff --git a/extensions/source/propctrlr/stringrepresentation.cxx b/extensions/source/propctrlr/stringrepresentation.cxx
index 10d20fd..25fe129 100644
--- a/extensions/source/propctrlr/stringrepresentation.cxx
+++ b/extensions/source/propctrlr/stringrepresentation.cxx
@@ -441,7 +441,7 @@ bool StringRepresentation::convertGenericValueToString( const uno::Any& _rValue,
     // some structs
     case uno::TypeClass_STRUCT:
         OSL_FAIL( "StringRepresentation::convertGenericValueToString(STRUCT): this is dead code - isn't it?" );
-        if ( _rValue.getValueType().equals( ::getCppuType( static_cast< util::Date* >( NULL ) ) ) )
+        if ( _rValue.getValueType().equals( cppu::UnoType< util::Date >::get() ))
         {
             // weird enough, the string representation of dates, as used
             // by the control displaying dates, and thus as passed through the layers,
@@ -450,14 +450,14 @@ bool StringRepresentation::convertGenericValueToString( const uno::Any& _rValue,
             _rValue >>= aUnoDate;
             _rStringRep = ::dbtools::DBTypeConversion::toDateString(aUnoDate);
         }
-        else if ( _rValue.getValueType().equals( ::getCppuType( static_cast< util::Time* >( NULL ) ) ) )
+        else if ( _rValue.getValueType().equals( cppu::UnoType< util::Time >::get() ))
         {
             // similar for time (HHMMSSHH)
             util::Time aUnoTime;
             _rValue >>= aUnoTime;
             _rStringRep = ::dbtools::DBTypeConversion::toTimeString(aUnoTime);
         }
-        else if ( _rValue.getValueType().equals( ::getCppuType( static_cast< util::DateTime* >( NULL ) ) ) )
+        else if ( _rValue.getValueType().equals( cppu::UnoType< util::DateTime >::get() ))
         {
             util::DateTime aUnoDateTime;
             _rValue >>= aUnoDateTime;
@@ -582,7 +582,7 @@ bool StringRepresentation::convertStringToGenericValue( const OUString& _rString
 
     case uno::TypeClass_STRUCT:
         OSL_FAIL( "StringRepresentation::convertStringToGenericValue(STRUCT): this is dead code - isn't it?" );
-        if ( _rTargetType.equals( ::getCppuType( static_cast< util::Date* >( NULL ) ) ) )
+        if ( _rTargetType.equals( cppu::UnoType< util::Date >::get() ))
         {
             // weird enough, the string representation of dates, as used
             // by the control displaying dates, and thus as passed through the layers,
@@ -590,12 +590,12 @@ bool StringRepresentation::convertStringToGenericValue( const OUString& _rString
 
             _rValue <<= ::dbtools::DBTypeConversion::toDate(_rStringRep);
         }
-        else if ( _rTargetType.equals( ::getCppuType( static_cast< util::Time* >( NULL ) ) ) )
+        else if ( _rTargetType.equals( cppu::UnoType< util::Time >::get() ))
         {
             // similar for time (HHMMSSHH)
             _rValue <<= ::dbtools::DBTypeConversion::toTime(_rStringRep);
         }
-        else if ( _rTargetType.equals( ::getCppuType( static_cast< util::DateTime* >( NULL ) ) ) )
+        else if ( _rTargetType.equals( cppu::UnoType< util::DateTime >::get() ))
         {
             _rValue <<= ::dbtools::DBTypeConversion::toDateTime(_rStringRep);
         }
diff --git a/sd/source/core/CustomAnimationCloner.cxx b/sd/source/core/CustomAnimationCloner.cxx
index f4971f6..6bd2308 100644
--- a/sd/source/core/CustomAnimationCloner.cxx
+++ b/sd/source/core/CustomAnimationCloner.cxx
@@ -223,7 +223,7 @@ namespace sd
     {
         if( rValue.hasValue() ) try
         {
-            if( rValue.getValueType() == ::getCppuType((const ValuePair*)0) )
+            if( rValue.getValueType() == cppu::UnoType<ValuePair>::get() )
             {
                 ValuePair aValuePair;
                 rValue >>= aValuePair;
@@ -233,7 +233,7 @@ namespace sd
 
                 return makeAny( aValuePair );
             }
-            else if( rValue.getValueType() == ::getCppuType((Sequence<Any>*)0) )
+            else if( rValue.getValueType() == cppu::UnoType< Sequence<Any> >::get() )
             {
                 Sequence<Any> aSequence;
                 rValue >>= aSequence;
@@ -263,7 +263,7 @@ namespace sd
                         return makeAny( getClonedNode( xNode ) );
                 }
             }
-            else if( rValue.getValueType() == ::getCppuType((const ParagraphTarget*)0) )
+            else if( rValue.getValueType() == cppu::UnoType<ParagraphTarget>::get() )
             {
                 ParagraphTarget aParaTarget;
                 rValue >>= aParaTarget;
@@ -272,7 +272,7 @@ namespace sd
 
                 return makeAny( aParaTarget );
             }
-            else if( rValue.getValueType() == ::getCppuType((const Event*)0) )
+            else if( rValue.getValueType() == cppu::UnoType<Event>::get() )
             {
                 Event aEvent;
                 rValue >>= aEvent;
diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx
index 3f1e141..be60d65 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -839,7 +839,7 @@ bool AnimationImporter::convertAnimationValue( MS_AttributeNames eAttribute, Any
     {
         OUString aString;
 
-        if( rValue.getValueType() == ::getCppuType((const ValuePair*)0) )
+        if( rValue.getValueType() == cppu::UnoType<ValuePair>::get() )
         {
             ValuePair aValuePair;
             if( rValue >>= aValuePair )
@@ -863,7 +863,7 @@ bool AnimationImporter::convertAnimationValue( MS_AttributeNames eAttribute, Any
                 }
             }
         }
-        else if( rValue.getValueType() == ::getCppuType((const OUString*)0) )
+        else if( rValue.getValueType() == cppu::UnoType<OUString>::get() )
         {
             if( rValue >>= aString )
             {
@@ -890,14 +890,14 @@ bool AnimationImporter::convertAnimationValue( MS_AttributeNames eAttribute, Any
 
     case MS_STYLEROTATION:
     {
-        if( rValue.getValueType() == ::getCppuType((const OUString*)0) )
+        if( rValue.getValueType() == cppu::UnoType<OUString>::get() )
         {
             OUString aString;
             rValue >>= aString;
             rValue <<= (sal_Int16)aString.toDouble();
             bRet = true;
         }
-        else if( rValue.getValueType() == ::getCppuType((const double*)0) )
+        else if( rValue.getValueType() == cppu::UnoType<double>::get() )
         {
             double fValue = 0.0;
             rValue >>= fValue;
@@ -2683,7 +2683,7 @@ void AnimationImporter::importAnimateKeyPoints( const Atom* pAtom, const Referen
                         bool bHasValue = aValue2.hasValue();
                         if( bHasValue )
                         {
-                            if( aValue2.getValueType() == ::getCppuType((const OUString*)0) )
+                            if( aValue2.getValueType() == cppu::UnoType<OUString>::get() )
                             {
                                 OUString aTest;
                                 aValue2 >>= aTest;
@@ -2692,7 +2692,7 @@ void AnimationImporter::importAnimateKeyPoints( const Atom* pAtom, const Referen
                             }
                         }
 
-                        if( bHasValue && bCouldBeFormula && (aValue1.getValueType() == ::getCppuType((const double*)0)) )
+                        if( bHasValue && bCouldBeFormula && (aValue1.getValueType() == cppu::UnoType<double>::get() ))
                         {
                             aValue2 >>= aFormula;
                             bHasValue = false;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 618ad66..de2dff0 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -141,25 +141,25 @@ void SAL_CALL SfxUnoControllerItem::statusChanged(const ::com::sun::star::frame:
             eState = SFX_ITEM_AVAILABLE;
             ::com::sun::star::uno::Type pType = rEvent.State.getValueType();
 
-            if ( pType == ::getBooleanCppuType() )
+            if ( pType == cppu::UnoType< bool >::get() )
             {
                 bool bTemp = false;
                 rEvent.State >>= bTemp ;
                 pItem = new SfxBoolItem( pCtrlItem->GetId(), 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( pCtrlItem->GetId(), nTemp );
             }
-            else if ( pType == ::getCppuType((const sal_uInt32*)0) )
+            else if ( pType == cppu::UnoType<sal_uInt32>::get() )
             {
                 sal_uInt32 nTemp = 0;
                 rEvent.State >>= nTemp ;
                 pItem = new SfxUInt32Item( pCtrlItem->GetId(), nTemp );
             }
-            else if ( pType == ::getCppuType((const OUString*)0) )
+            else if ( pType == cppu::UnoType<OUString>::get() )
             {
                 OUString sTemp ;
                 rEvent.State >>= sTemp ;


More information about the Libreoffice-commits mailing list