diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2014-05-10 00:14:44 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2014-05-10 06:19:42 +0200 |
commit | 5ec7a589bed7991ffe8ad9a2f544a6699d159765 (patch) | |
tree | f9020375a29477fe7e4d22970a4040c36abadbdf /basic/source | |
parent | 83a88b942134314e86ac612d0ef70a8e4919e4af (diff) |
Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part8
Change-Id: Ie16923d17541e84e0d7424fffe37caf410786abf
Diffstat (limited to 'basic/source')
-rw-r--r-- | basic/source/classes/sbunoobj.cxx | 32 | ||||
-rw-r--r-- | basic/source/uno/scriptcont.cxx | 4 |
2 files changed, 18 insertions, 18 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 296e70683b27..102fe6c52a4d 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -848,30 +848,30 @@ Type getUnoTypeForSbxBaseType( SbxDataType eType ) switch( eType ) { case SbxNULL: aRetType = ::getCppuType( (const Reference< XInterface > *)0 ); break; - case SbxINTEGER: aRetType = ::getCppuType( (sal_Int16*)0 ); break; - case SbxLONG: aRetType = ::getCppuType( (sal_Int32*)0 ); break; - case SbxSINGLE: aRetType = ::getCppuType( (float*)0 ); break; - case SbxDOUBLE: aRetType = ::getCppuType( (double*)0 ); break; + case SbxINTEGER: aRetType = ::cppu::UnoType<sal_Int16>::get(); break; + case SbxLONG: aRetType = ::cppu::UnoType<sal_Int32>::get(); break; + case SbxSINGLE: aRetType = ::cppu::UnoType<float>::get(); break; + case SbxDOUBLE: aRetType = ::cppu::UnoType<double>::get(); break; case SbxCURRENCY: aRetType = ::getCppuType( (oleautomation::Currency*)0 ); break; case SbxDECIMAL: aRetType = ::getCppuType( (oleautomation::Decimal*)0 ); break; case SbxDATE: { SbiInstance* pInst = GetSbData()->pInst; if( pInst && pInst->IsCompatibility() ) - aRetType = ::getCppuType( (double*)0 ); + aRetType = ::cppu::UnoType<double>::get(); else aRetType = ::getCppuType( (oleautomation::Date*)0 ); } break; - case SbxSTRING: aRetType = ::getCppuType( (OUString*)0 ); break; + case SbxSTRING: aRetType = ::cppu::UnoType<OUString>::get(); break; case SbxBOOL: aRetType = ::getCppuType( (sal_Bool*)0 ); break; case SbxVARIANT: aRetType = ::getCppuType( (Any*)0 ); break; case SbxCHAR: aRetType = ::getCppuType( (sal_Unicode*)0 ); break; - case SbxBYTE: aRetType = ::getCppuType( (sal_Int8*)0 ); break; + case SbxBYTE: aRetType = ::cppu::UnoType<sal_Int8>::get(); break; case SbxUSHORT: aRetType = ::getCppuType( (sal_uInt16*)0 ); break; - case SbxULONG: aRetType = ::getCppuType( (sal_uInt32*)0 ); break; + case SbxULONG: aRetType = ::cppu::UnoType<sal_uInt32>::get(); break; // map machine-dependent ones to long for consistency - case SbxINT: aRetType = ::getCppuType( (sal_Int32*)0 ); break; - case SbxUINT: aRetType = ::getCppuType( (sal_uInt32*)0 ); break; + case SbxINT: aRetType = ::cppu::UnoType<sal_Int32>::get(); break; + case SbxUINT: aRetType = ::cppu::UnoType<sal_uInt32>::get(); break; default: break; } return aRetType; @@ -1059,11 +1059,11 @@ Any sbxToUnoValueImpl( const SbxValue* pVar, bool bBlockConversionToSmallestType if( d == floor( d ) ) { if( d >= -128 && d <= 127 ) - aType = ::getCppuType( (sal_Int8*)0 ); + aType = ::cppu::UnoType<sal_Int8>::get(); else if( d >= SbxMININT && d <= SbxMAXINT ) - aType = ::getCppuType( (sal_Int16*)0 ); + aType = ::cppu::UnoType<sal_Int16>::get(); else if( d >= -SbxMAXLNG && d <= SbxMAXLNG ) - aType = ::getCppuType( (sal_Int32*)0 ); + aType = ::cppu::UnoType<sal_Int32>::get(); } break; } @@ -1071,16 +1071,16 @@ Any sbxToUnoValueImpl( const SbxValue* pVar, bool bBlockConversionToSmallestType { sal_Int16 n = pVar->GetInteger(); if( n >= -128 && n <= 127 ) - aType = ::getCppuType( (sal_Int8*)0 ); + aType = ::cppu::UnoType<sal_Int8>::get(); break; } case TypeClass_LONG: { sal_Int32 n = pVar->GetLong(); if( n >= -128 && n <= 127 ) - aType = ::getCppuType( (sal_Int8*)0 ); + aType = ::cppu::UnoType<sal_Int8>::get(); else if( n >= SbxMININT && n <= SbxMAXINT ) - aType = ::getCppuType( (sal_Int16*)0 ); + aType = ::cppu::UnoType<sal_Int16>::get(); break; } case TypeClass_UNSIGNED_SHORT: diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index 486eb96652c1..574af686555d 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -1240,7 +1240,7 @@ Reference< XInterface > SAL_CALL SfxScriptLibraryContainer::Create( const Refere SfxScriptLibrary::SfxScriptLibrary( ModifiableHelper& _rModifiable, const Reference< XComponentContext >& xContext, const Reference< XSimpleFileAccess3 >& xSFI ) - : SfxLibrary( _rModifiable, getCppuType( (const OUString *)0 ), xContext, xSFI ) + : SfxLibrary( _rModifiable, cppu::UnoType<OUString>::get(), xContext, xSFI ) , mbLoadedSource( false ) , mbLoadedBinary( false ) { @@ -1252,7 +1252,7 @@ SfxScriptLibrary::SfxScriptLibrary( ModifiableHelper& _rModifiable, const OUString& aLibInfoFileURL, const OUString& aStorageURL, bool ReadOnly ) - : SfxLibrary( _rModifiable, getCppuType( (const OUString *)0 ), xContext, xSFI, + : SfxLibrary( _rModifiable, cppu::UnoType<OUString>::get(), xContext, xSFI, aLibInfoFileURL, aStorageURL, ReadOnly) , mbLoadedSource( false ) , mbLoadedBinary( false ) |