diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2014-05-15 22:51:43 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2014-05-15 22:52:22 +0200 |
commit | 68741d0055f3b76f88ca225b0ebe4991d6cb2f7f (patch) | |
tree | 88cfb046b14c5617a83ba77fc61ceeadfd12aab7 /basic | |
parent | a470fe1ea0ff3c9ecfb7664accb50e8ee424b660 (diff) |
Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part13
Change-Id: Ieecfd7ccb10c75ac639d0ba8e7cb588607097c2a
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/basmgr/basmgr.cxx | 10 | ||||
-rw-r--r-- | basic/source/classes/sbunoobj.cxx | 48 | ||||
-rw-r--r-- | basic/source/runtime/methods.cxx | 6 |
3 files changed, 32 insertions, 32 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 3a53c0c9cba8..df5c3610b3c5 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -1931,7 +1931,7 @@ public: uno::Type ModuleContainer_Impl::getElementType() throw(uno::RuntimeException, std::exception) { - uno::Type aModuleType = ::getCppuType( (const uno::Reference< script::XStarBasicModuleInfo > *)0 ); + uno::Type aModuleType = cppu::UnoType<script::XStarBasicModuleInfo>::get(); return aModuleType; } @@ -1993,7 +1993,7 @@ void ModuleContainer_Impl::replaceByName( const OUString& aName, const uno::Any& void ModuleContainer_Impl::insertByName( const OUString& aName, const uno::Any& aElement ) throw(lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException, std::exception) { - uno::Type aModuleType = ::getCppuType( (const uno::Reference< script::XStarBasicModuleInfo > *)0 ); + uno::Type aModuleType = cppu::UnoType<script::XStarBasicModuleInfo>::get(); uno::Type aAnyType = aElement.getValueType(); if( aModuleType != aAnyType ) { @@ -2080,7 +2080,7 @@ public: uno::Type DialogContainer_Impl::getElementType() throw(uno::RuntimeException, std::exception) { - uno::Type aModuleType = ::getCppuType( (const uno::Reference< script::XStarBasicDialogInfo > *)0 ); + uno::Type aModuleType = cppu::UnoType<script::XStarBasicDialogInfo>::get(); return aModuleType; } @@ -2173,7 +2173,7 @@ void DialogContainer_Impl::insertByName( const OUString& aName, const uno::Any& throw(lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException, std::exception) { (void)aName; - uno::Type aModuleType = ::getCppuType( (const uno::Reference< script::XStarBasicDialogInfo > *)0 ); + uno::Type aModuleType = cppu::UnoType<script::XStarBasicDialogInfo>::get(); uno::Type aAnyType = aElement.getValueType(); if( aModuleType != aAnyType ) { @@ -2240,7 +2240,7 @@ public: uno::Type LibraryContainer_Impl::getElementType() throw(uno::RuntimeException, std::exception) { - uno::Type aType = ::getCppuType( (const uno::Reference< script::XStarBasicLibraryInfo > *)0 ); + uno::Type aType = cppu::UnoType<script::XStarBasicLibraryInfo>::get(); return aType; } diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 102fe6c52a4d..85343b2dc4ae 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -848,26 +848,26 @@ Type getUnoTypeForSbxBaseType( SbxDataType eType ) switch( eType ) { case SbxNULL: aRetType = ::getCppuType( (const Reference< XInterface > *)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 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 = cppu::UnoType<oleautomation::Currency>::get(); break; + case SbxDECIMAL: aRetType = cppu::UnoType<oleautomation::Decimal>::get(); break; case SbxDATE: { SbiInstance* pInst = GetSbData()->pInst; if( pInst && pInst->IsCompatibility() ) - aRetType = ::cppu::UnoType<double>::get(); + aRetType = cppu::UnoType<double>::get(); else - aRetType = ::getCppuType( (oleautomation::Date*)0 ); + aRetType = cppu::UnoType<oleautomation::Date>::get(); } 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 = ::cppu::UnoType<sal_Int8>::get(); break; - case SbxUSHORT: aRetType = ::getCppuType( (sal_uInt16*)0 ); break; + case SbxSTRING: aRetType = cppu::UnoType<OUString>::get(); break; + case SbxBOOL: aRetType = cppu::UnoType<sal_Bool>::get(); break; + case SbxVARIANT: aRetType = cppu::UnoType<Any>::get(); break; + case SbxCHAR: aRetType = cppu::UnoType<cppu::UnoCharType>::get(); break; + case SbxBYTE: aRetType = cppu::UnoType<sal_Int8>::get(); break; + case SbxUSHORT: aRetType = cppu::UnoType<cppu::UnoUnsignedShortType>::get(); break; case SbxULONG: aRetType = ::cppu::UnoType<sal_uInt32>::get(); break; // map machine-dependent ones to long for consistency case SbxINT: aRetType = ::cppu::UnoType<sal_Int32>::get(); break; @@ -926,7 +926,7 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal ) { // if only first element is void: different types -> []any // if all elements are void: []void is not allowed -> []any - aElementType = getCppuType( (Any*)0 ); + aElementType = cppu::UnoType<Any>::get(); break; } aElementType = aType; @@ -935,7 +935,7 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal ) else if( aElementType != aType ) { // different types -> AnySequence - aElementType = getCppuType( (Any*)0 ); + aElementType = cppu::UnoType<Any>::get(); break; } } @@ -963,7 +963,7 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal ) { // if only first element is void: different types -> []any // if all elements are void: []void is not allowed -> []any - aElementType = getCppuType( (Any*)0 ); + aElementType = cppu::UnoType<Any>::get(); break; } aElementType = aType; @@ -972,7 +972,7 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal ) else if( aElementType != aType ) { // different types -> AnySequence - aElementType = getCppuType( (Any*)0 ); + aElementType = cppu::UnoType<Any>::get(); break; } } @@ -1087,16 +1087,16 @@ Any sbxToUnoValueImpl( const SbxValue* pVar, bool bBlockConversionToSmallestType { sal_uInt16 n = pVar->GetUShort(); if( n <= 255 ) - aType = ::getCppuType( (sal_uInt8*)0 ); + aType = cppu::UnoType<sal_uInt8>::get(); break; } case TypeClass_UNSIGNED_LONG: { sal_uInt32 n = pVar->GetLong(); if( n <= 255 ) - aType = ::getCppuType( (sal_uInt8*)0 ); + aType = cppu::UnoType<sal_uInt8>::get(); else if( n <= SbxMAXUINT ) - aType = ::getCppuType( (sal_uInt16*)0 ); + aType = cppu::UnoType<cppu::UnoUnsignedShortType>::get(); break; } // TODO: need to add hyper types ? @@ -1247,20 +1247,20 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper SbiInstance* pInst = GetSbData()->pInst; if( pInst && pInst->IsCompatibility() ) { - if( rType == ::getCppuType( (oleautomation::Decimal*)0 ) ) + if( rType == cppu::UnoType<oleautomation::Decimal>::get()) { oleautomation::Decimal aDecimal; pVar->fillAutomationDecimal( aDecimal ); aRetVal <<= aDecimal; break; } - else if( rType == ::getCppuType( (oleautomation::Currency*)0 ) ) + else if( rType == cppu::UnoType<oleautomation::Currency>::get()) { // assumes per previous code that ole Currency is Int64 aRetVal <<= (sal_Int64)( pVar->GetInt64() ); break; } - else if( rType == ::getCppuType( (oleautomation::Date*)0 ) ) + else if( rType == cppu::UnoType<oleautomation::Date>::get()) { oleautomation::Date aDate; aDate.Value = pVar->GetDate(); diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 1dfeb8f2406a..fe2f00d3a178 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -1887,7 +1887,7 @@ RTLFUNC(CDateFromUnoDate) return; } - Any aAny (sbxToUnoValue(rPar.Get(1), ::getCppuType( (com::sun::star::util::Date*)0 ))); + Any aAny (sbxToUnoValue(rPar.Get(1), cppu::UnoType<com::sun::star::util::Date>::get())); com::sun::star::util::Date aUnoDate; if(aAny >>= aUnoDate) SbxDateFromUNODate(rPar.Get(0), aUnoDate); @@ -1940,7 +1940,7 @@ RTLFUNC(CDateFromUnoTime) return; } - Any aAny (sbxToUnoValue(rPar.Get(1), ::getCppuType( (com::sun::star::util::Time*)0 ))); + Any aAny (sbxToUnoValue(rPar.Get(1), cppu::UnoType<com::sun::star::util::Time>::get())); com::sun::star::util::Time aUnoTime; if(aAny >>= aUnoTime) SbxDateFromUNOTime(rPar.Get(0), aUnoTime); @@ -2002,7 +2002,7 @@ RTLFUNC(CDateFromUnoDateTime) return; } - Any aAny (sbxToUnoValue(rPar.Get(1), ::getCppuType( (com::sun::star::util::DateTime*)0 ))); + Any aAny (sbxToUnoValue(rPar.Get(1), cppu::UnoType<com::sun::star::util::DateTime>::get())); com::sun::star::util::DateTime aUnoDT; if(aAny >>= aUnoDT) SbxDateFromUNODateTime(rPar.Get(0), aUnoDT); |