diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2014-05-06 22:51:07 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2014-05-06 22:51:42 +0200 |
commit | db3b1dd86ed467889d595e080b00fc957eb155ff (patch) | |
tree | 75a3d77e016aae6605e97d94f71a2d3918873b68 /toolkit/source | |
parent | 3ed4078ad2e1bb35829b118a5067ad3a43365bbc (diff) |
Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part3
Change-Id: Ibabd6d2d5e84fe007364bd1a4182a01ea2352b7a
Diffstat (limited to 'toolkit/source')
-rw-r--r-- | toolkit/source/controls/unocontrolmodel.cxx | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx index 3b2c0363da46..6f64bf978824 100644 --- a/toolkit/source/controls/unocontrolmodel.cxx +++ b/toolkit/source/controls/unocontrolmodel.cxx @@ -564,49 +564,49 @@ void UnoControlModel::write( const ::com::sun::star::uno::Reference< ::com::sun: const ::com::sun::star::uno::Any& rValue = *pProp; const ::com::sun::star::uno::Type& rType = rValue.getValueType(); - if ( rType == ::getBooleanCppuType() ) + if ( rType == cppu::UnoType< bool >::get() ) { bool b = false; rValue >>= b; OutStream->writeBoolean( b ); } - else if ( rType == ::getCppuType((const OUString*)0) ) + else if ( rType == ::cppu::UnoType< OUString >::get() ) { OUString aUString; rValue >>= aUString; OutStream->writeUTF( aUString ); } - else if ( rType == ::getCppuType((const sal_uInt16*)0) ) + else if ( rType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get() ) { sal_uInt16 n = 0; rValue >>= n; OutStream->writeShort( n ); } - else if ( rType == ::getCppuType((const sal_Int16*)0) ) + else if ( rType == cppu::UnoType<sal_Int16>::get() ) { sal_Int16 n = 0; rValue >>= n; OutStream->writeShort( n ); } - else if ( rType == ::getCppuType((const sal_uInt32*)0) ) + else if ( rType == cppu::UnoType<sal_uInt32>::get() ) { sal_uInt32 n = 0; rValue >>= n; OutStream->writeLong( n ); } - else if ( rType == ::getCppuType((const sal_Int32*)0) ) + else if ( rType == cppu::UnoType<sal_Int32>::get() ) { sal_Int32 n = 0; rValue >>= n; OutStream->writeLong( n ); } - else if ( rType == ::getCppuType((const double*)0) ) + else if ( rType == cppu::UnoType<double>::get() ) { double n = 0; rValue >>= n; OutStream->writeDouble( n ); } - else if ( rType == ::getCppuType((const ::com::sun::star::awt::FontDescriptor*)0) ) + else if ( rType == cppu::UnoType< ::com::sun::star::awt::FontDescriptor >::get() ) { ::com::sun::star::awt::FontDescriptor aFD; rValue >>= aFD; @@ -643,7 +643,7 @@ void UnoControlModel::write( const ::com::sun::star::uno::Reference< ::com::sun: t.NanoSeconds / 1000000 + 100 * t.Seconds + 10000 * t.Minutes + 1000000 * t.Hours); // HHMMSShh } - else if ( rType == ::getCppuType((const ::com::sun::star::uno::Sequence< OUString>*)0 ) ) + else if ( rType == cppu::UnoType< ::com::sun::star::uno::Sequence< OUString> >::get() ) { ::com::sun::star::uno::Sequence< OUString> aSeq; rValue >>= aSeq; @@ -652,7 +652,7 @@ void UnoControlModel::write( const ::com::sun::star::uno::Reference< ::com::sun: for ( long n = 0; n < nEntries; n++ ) OutStream->writeUTF( aSeq.getConstArray()[n] ); } - else if ( rType == ::getCppuType((const ::com::sun::star::uno::Sequence<sal_uInt16>*)0 ) ) + else if ( rType == cppu::UnoType< ::com::sun::star::uno::Sequence< ::cppu::UnoUnsignedShortType > >::get() ) { ::com::sun::star::uno::Sequence<sal_uInt16> aSeq; rValue >>= aSeq; @@ -661,7 +661,7 @@ void UnoControlModel::write( const ::com::sun::star::uno::Reference< ::com::sun: for ( long n = 0; n < nEntries; n++ ) OutStream->writeShort( aSeq.getConstArray()[n] ); } - else if ( rType == ::getCppuType((const ::com::sun::star::uno::Sequence<sal_Int16>*)0 ) ) + else if ( rType == cppu::UnoType< ::com::sun::star::uno::Sequence<sal_Int16> >::get() ) { ::com::sun::star::uno::Sequence<sal_Int16> aSeq; rValue >>= aSeq; @@ -794,37 +794,37 @@ void UnoControlModel::read( const ::com::sun::star::uno::Reference< ::com::sun:: bool b = InStream->readBoolean(); aValue <<= b; } - else if ( *pType == ::getCppuType((const OUString*)0) ) + else if ( *pType == cppu::UnoType<OUString>::get() ) { OUString aUTF = InStream->readUTF(); aValue <<= aUTF; } - else if ( *pType == ::getCppuType((const sal_uInt16*)0) ) + else if ( *pType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get() ) { sal_uInt16 n = InStream->readShort(); aValue <<= n; } - else if ( *pType == ::getCppuType((const sal_Int16*)0) ) + else if ( *pType == cppu::UnoType<sal_Int16>::get() ) { sal_Int16 n = InStream->readShort(); aValue <<= n; } - else if ( *pType == ::getCppuType((const sal_uInt32*)0) ) + else if ( *pType == cppu::UnoType<sal_uInt32>::get() ) { sal_uInt32 n = InStream->readLong(); aValue <<= n; } - else if ( *pType == ::getCppuType((const sal_Int32*)0) ) + else if ( *pType == cppu::UnoType<sal_Int32>::get() ) { sal_Int32 n = InStream->readLong(); aValue <<= n; } - else if ( *pType == ::getCppuType((const double*)0) ) + else if ( *pType == cppu::UnoType<double>::get() ) { double n = InStream->readDouble(); aValue <<= n; } - else if ( *pType == ::getCppuType((const ::com::sun::star::awt::FontDescriptor*)0) ) + else if ( *pType == cppu::UnoType< ::com::sun::star::awt::FontDescriptor >::get() ) { ::com::sun::star::awt::FontDescriptor aFD; aFD.Name = InStream->readUTF(); @@ -858,7 +858,7 @@ void UnoControlModel::read( const ::com::sun::star::uno::Reference< ::com::sun:: (n % 100) * 1000000, (n / 100) % 100, (n / 10000) % 100, n / 1000000, false); } - else if ( *pType == ::getCppuType((const ::com::sun::star::uno::Sequence< OUString>*)0 ) ) + else if ( *pType == cppu::UnoType< ::com::sun::star::uno::Sequence< OUString> >::get() ) { long nEntries = InStream->readLong(); ::com::sun::star::uno::Sequence< OUString> aSeq( nEntries ); @@ -867,7 +867,7 @@ void UnoControlModel::read( const ::com::sun::star::uno::Reference< ::com::sun:: aValue <<= aSeq; } - else if ( *pType == ::getCppuType((const ::com::sun::star::uno::Sequence<sal_uInt16>*)0 ) ) + else if ( *pType == cppu::UnoType< ::com::sun::star::uno::Sequence< ::cppu::UnoUnsignedShortType > >::get() ) { long nEntries = InStream->readLong(); @@ -876,7 +876,7 @@ void UnoControlModel::read( const ::com::sun::star::uno::Reference< ::com::sun:: aSeq.getArray()[n] = (sal_uInt16)InStream->readShort(); aValue <<= aSeq; } - else if ( *pType == ::getCppuType((const ::com::sun::star::uno::Sequence<sal_Int16>*)0 ) ) + else if ( *pType == cppu::UnoType< ::com::sun::star::uno::Sequence<sal_Int16> >::get() ) { long nEntries = InStream->readLong(); ::com::sun::star::uno::Sequence<sal_Int16> aSeq( nEntries ); |