From 5ec7a589bed7991ffe8ad9a2f544a6699d159765 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sat, 10 May 2014 00:14:44 +0200 Subject: Prefer cppu::UnoType::get() to ::getCppuType((T*)0) part8 Change-Id: Ie16923d17541e84e0d7424fffe37caf410786abf --- basic/source/classes/sbunoobj.cxx | 32 ++++++++++++++++---------------- basic/source/uno/scriptcont.cxx | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) (limited to 'basic') 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::get(); break; + case SbxLONG: aRetType = ::cppu::UnoType::get(); break; + case SbxSINGLE: aRetType = ::cppu::UnoType::get(); break; + case SbxDOUBLE: aRetType = ::cppu::UnoType::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::get(); else aRetType = ::getCppuType( (oleautomation::Date*)0 ); } break; - case SbxSTRING: aRetType = ::getCppuType( (OUString*)0 ); break; + case SbxSTRING: aRetType = ::cppu::UnoType::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::get(); break; case SbxUSHORT: aRetType = ::getCppuType( (sal_uInt16*)0 ); break; - case SbxULONG: aRetType = ::getCppuType( (sal_uInt32*)0 ); break; + case SbxULONG: aRetType = ::cppu::UnoType::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::get(); break; + case SbxUINT: aRetType = ::cppu::UnoType::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::get(); else if( d >= SbxMININT && d <= SbxMAXINT ) - aType = ::getCppuType( (sal_Int16*)0 ); + aType = ::cppu::UnoType::get(); else if( d >= -SbxMAXLNG && d <= SbxMAXLNG ) - aType = ::getCppuType( (sal_Int32*)0 ); + aType = ::cppu::UnoType::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::get(); break; } case TypeClass_LONG: { sal_Int32 n = pVar->GetLong(); if( n >= -128 && n <= 127 ) - aType = ::getCppuType( (sal_Int8*)0 ); + aType = ::cppu::UnoType::get(); else if( n >= SbxMININT && n <= SbxMAXINT ) - aType = ::getCppuType( (sal_Int16*)0 ); + aType = ::cppu::UnoType::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::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::get(), xContext, xSFI, aLibInfoFileURL, aStorageURL, ReadOnly) , mbLoadedSource( false ) , mbLoadedBinary( false ) -- cgit