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 /extensions | |
parent | 83a88b942134314e86ac612d0ef70a8e4919e4af (diff) |
Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part8
Change-Id: Ie16923d17541e84e0d7424fffe37caf410786abf
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/bibliography/general.cxx | 2 | ||||
-rw-r--r-- | extensions/source/ole/oleobjw.cxx | 22 | ||||
-rw-r--r-- | extensions/source/ole/servprov.cxx | 8 | ||||
-rw-r--r-- | extensions/source/ole/unoconversionutilities.hxx | 28 | ||||
-rw-r--r-- | extensions/test/ole/OleClient/funcs.cxx | 2 | ||||
-rw-r--r-- | extensions/test/ole/OleConverterVar1/convTest.cxx | 2 |
6 files changed, 32 insertions, 32 deletions
diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index bd27749e7dcb..2babb133beb3 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -490,7 +490,7 @@ uno::Reference< awt::XControlModel > BibGeneralPage::AddXControl( aAny <<= (sal_Int16)1; xPropSet->setPropertyValue("BoundColumn", aAny); ListSourceType eSet = ListSourceType_VALUELIST; - aAny.setValue( &eSet, ::getCppuType((const ListSourceType*)0) ); + aAny.setValue( &eSet, ::cppu::UnoType<ListSourceType>::get() ); xPropSet->setPropertyValue("ListSourceType", aAny); uno::Sequence<OUString> aListSource(TYPE_COUNT); diff --git a/extensions/source/ole/oleobjw.cxx b/extensions/source/ole/oleobjw.cxx index f7070bfe6eb1..ca0c8156be96 100644 --- a/extensions/source/ole/oleobjw.cxx +++ b/extensions/source/ole/oleobjw.cxx @@ -774,7 +774,7 @@ Any SAL_CALL IUnknownWrapper_Impl::createBridge( const Any& modelDepObject, pVariant->punkVal->AddRef(); } - ret.setValue((void*)&pVariant, getCppuType( (sal_uInt32*) 0)); + ret.setValue((void*)&pVariant, cppu::UnoType<sal_uInt32>::get()); } } @@ -1354,7 +1354,7 @@ uno::Any SAL_CALL IUnknownWrapper_Impl::directInvoke( const OUString& aName, con // Determine the number of named arguments for ( sal_Int32 nInd = 0; nInd < aParams.getLength(); nInd++ ) - if ( aParams[nInd].getValueType() == getCppuType((NamedArgument*) 0) ) + if ( aParams[nInd].getValueType() == cppu::UnoType<NamedArgument>::get() ) dispparams.cNamedArgs ++; // fill the named arguments @@ -1372,7 +1372,7 @@ uno::Any SAL_CALL IUnknownWrapper_Impl::directInvoke( const OUString& aName, con int cNamedArg = 0; for ( size_t nInd = 0; nInd < dispparams.cArgs; nInd++ ) { - if ( aParams[nInd].getValueType() == getCppuType((NamedArgument*) 0)) + if ( aParams[nInd].getValueType() == cppu::UnoType<NamedArgument>::get()) { const NamedArgument& arg = *(NamedArgument const*)aParams[nInd].getValue(); @@ -1435,14 +1435,14 @@ uno::Any SAL_CALL IUnknownWrapper_Impl::directInvoke( const OUString& aName, con anyArg = aParams.getConstArray()[nInd]; // Property Put arguments - if ( anyArg.getValueType() == getCppuType((PropertyPutArgument*)0) ) + if ( anyArg.getValueType() == cppu::UnoType<PropertyPutArgument>::get() ) { PropertyPutArgument arg; anyArg >>= arg; anyArg <<= arg.Value; } // named argument - if (anyArg.getValueType() == getCppuType((NamedArgument*) 0)) + if (anyArg.getValueType() == cppu::UnoType<NamedArgument>::get()) { NamedArgument aNamedArgument; anyArg >>= aNamedArgument; @@ -1751,7 +1751,7 @@ Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(FuncDesc& aFuncDesc, for (int iParam = 0; iParam < nUnoArgs; iParam ++) { const Any & curArg = Params[iParam]; - if (curArg.getValueType() == getCppuType((NamedArgument*) 0)) + if (curArg.getValueType() == cppu::UnoType<NamedArgument>::get()) dispparams.cNamedArgs ++; } //In a property put operation a property value is a named argument (DISPID_PROPERTYPUT). @@ -1817,7 +1817,7 @@ Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(FuncDesc& aFuncDesc, for (size_t iParams = 0; iParams < dispparams.cArgs; iParams ++) { const Any & curArg = Params[iParams]; - if (curArg.getValueType() == getCppuType((NamedArgument*) 0)) + if (curArg.getValueType() == cppu::UnoType<NamedArgument>::get()) { const NamedArgument& arg = *(NamedArgument const*) curArg.getValue(); //We put the parameter names in reverse order into the array, @@ -1910,14 +1910,14 @@ Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(FuncDesc& aFuncDesc, } // Property Put arguments - if (anyArg.getValueType() == getCppuType((PropertyPutArgument*)0)) + if (anyArg.getValueType() == cppu::UnoType<PropertyPutArgument>::get()) { PropertyPutArgument arg; anyArg >>= arg; anyArg <<= arg.Value; } // named argument - if (anyArg.getValueType() == getCppuType((NamedArgument*) 0)) + if (anyArg.getValueType() == cppu::UnoType<NamedArgument>::get()) { NamedArgument aNamedArgument; anyArg >>= aNamedArgument; @@ -2080,7 +2080,7 @@ Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(FuncDesc& aFuncDesc, int realParamIndex = paramIndex; int revParamIndex = dispparams.cArgs - paramIndex - 1; if (Params[paramIndex].getValueType() - == getCppuType((NamedArgument*) 0)) + == cppu::UnoType<NamedArgument>::get()) { //dispparams.rgdispidNamedArgs contains the mapping from index //of named args list to index of parameter list @@ -2206,7 +2206,7 @@ void IUnknownWrapper_Impl::getFuncDescForInvoke(const OUString & sFuncName, //or in a list of named arguments. A PropertyPutArgument is actually a named argument //hence it must not be put in an extra NamedArgument structure if (nUnoArgs > 0 && - arArgs[nUnoArgs - 1].getValueType() == getCppuType((PropertyPutArgument*) 0)) + arArgs[nUnoArgs - 1].getValueType() == cppu::UnoType<PropertyPutArgument>::get()) { // DISPATCH_PROPERTYPUT FuncDesc aDescGet(pInfo); diff --git a/extensions/source/ole/servprov.cxx b/extensions/source/ole/servprov.cxx index e650b2ed7c36..77006bf6432c 100644 --- a/extensions/source/ole/servprov.cxx +++ b/extensions/source/ole/servprov.cxx @@ -159,7 +159,7 @@ STDMETHODIMP ProviderOleWrapper_Impl::CreateInstance(IUnknown FAR* punkOuter, OLE); - if (oleAny.getValueTypeClass() == getCppuType( (sal_uInt32 *)0).getTypeClass()) + if (oleAny.getValueTypeClass() == cppu::UnoType<sal_uInt32>::get().getTypeClass()) { VARIANT* pVariant = *(VARIANT**)oleAny.getValue(); @@ -374,14 +374,14 @@ Any SAL_CALL OleConverter_Impl2::createBridge(const Any& modelDepObject, CoTaskMemFree(pVariant); throw IllegalArgumentException(); } - ret.setValue((void*) &pVariant, getCppuType((sal_uInt32*)0)); + ret.setValue((void*) &pVariant, cppu::UnoType<sal_uInt32>::get()); } else throw IllegalArgumentException(); } else if (sourceModelType == OLE) { - if (modelDepObject.getValueType() != getCppuType((sal_uInt32*)0)) + if (modelDepObject.getValueType() != cppu::UnoType<sal_uInt32>::get()) { throw IllegalArgumentException(); } @@ -397,7 +397,7 @@ Any SAL_CALL OleConverter_Impl2::createBridge(const Any& modelDepObject, } else { - ret.setValue((void*) &pVariant, getCppuType((sal_uInt32*)0)); + ret.setValue((void*) &pVariant, cppu::UnoType<sal_uInt32>::get()); } } else if (destModelType == UNO) diff --git a/extensions/source/ole/unoconversionutilities.hxx b/extensions/source/ole/unoconversionutilities.hxx index 4d3059dbb220..bdbe761c15b6 100644 --- a/extensions/source/ole/unoconversionutilities.hxx +++ b/extensions/source/ole/unoconversionutilities.hxx @@ -423,13 +423,13 @@ void UnoConversionUtilities<T>::variantToAny( const VARIANTARG* pArg, Any& rAny, if (var.decVal.sign == 0) { // positive value - variantToAny( & var, rAny, getCppuType( (sal_uInt64*) 0), + variantToAny( & var, rAny, cppu::UnoType<sal_uInt64>::get(), bReduceValueRange); } else { //negative value - variantToAny( & var, rAny, getCppuType( (sal_Int64*) 0), + variantToAny( & var, rAny, cppu::UnoType<sal_Int64>::get(), bReduceValueRange); } } @@ -719,7 +719,7 @@ void UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& rAny) bIllegal = true; } } - else if(rAny.getValueType() == getCppuType((Decimal*)0)) + else if(rAny.getValueType() == cppu::UnoType<Decimal>::get()) { Decimal d; if (rAny >>= d) @@ -736,7 +736,7 @@ void UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& rAny) bIllegal = true; } } - else if (rAny.getValueType() == getCppuType((Currency*)0)) + else if (rAny.getValueType() == cppu::UnoType<Currency>::get()) { Currency c; if (rAny >>= c) @@ -749,7 +749,7 @@ void UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& rAny) bIllegal = true; } } - else if(rAny.getValueType() == getCppuType((SCode*)0)) + else if(rAny.getValueType() == cppu::UnoType<SCode>::get()) { SCode s; if (rAny >>= s) @@ -1491,16 +1491,16 @@ void UnoConversionUtilities<T>::variantToAny( const VARIANT* pVariant, Any& rAny rAny.setValue( & var.iVal, getCppuType( (sal_Int16*)0)); break; case VT_I4: - rAny.setValue( & var.lVal, getCppuType( (sal_Int32*)0)); + rAny.setValue( & var.lVal, cppu::UnoType<sal_Int32>::get()); // necessary for use in JavaScript ( see "reduceRange") if( bReduceValueRange) reduceRange(rAny); break; case VT_R4: - rAny.setValue( & var.fltVal, getCppuType( (float*)0)); + rAny.setValue( & var.fltVal, cppu::UnoType<float>::get()); break; case VT_R8: - rAny.setValue(& var.dblVal, getCppuType( (double*)0)); + rAny.setValue(& var.dblVal, cppu::UnoType<double>::get()); break; case VT_CY: { @@ -1566,22 +1566,22 @@ void UnoConversionUtilities<T>::variantToAny( const VARIANT* pVariant, Any& rAny break; } case VT_I1: - rAny.setValue( & var.cVal, getCppuType((sal_Int8*)0)); + rAny.setValue( & var.cVal, cppu::UnoType<sal_Int8>::get()); break; case VT_UI1: // there is no unsigned char in UNO - rAny.setValue( & var.bVal, getCppuType( (sal_Int8*)0)); + rAny.setValue( & var.bVal, cppu::UnoType<sal_Int8>::get()); break; case VT_UI2: rAny.setValue( & var.uiVal, getCppuType( (sal_uInt16*)0)); break; case VT_UI4: - rAny.setValue( & var.ulVal, getCppuType( (sal_uInt32*)0)); + rAny.setValue( & var.ulVal, cppu::UnoType<sal_uInt32>::get()); break; case VT_INT: - rAny.setValue( & var.intVal, getCppuType( (sal_Int32*)0)); + rAny.setValue( & var.intVal, cppu::UnoType<sal_Int32>::get()); break; case VT_UINT: - rAny.setValue( & var.uintVal, getCppuType( (sal_uInt32*)0)); + rAny.setValue( & var.uintVal, cppu::UnoType<sal_uInt32>::get()); break; case VT_VOID: rAny.setValue( NULL, Type()); @@ -2398,7 +2398,7 @@ inline void reduceRange( Any& any) if( value <= 0x7f && value >= -0x80) {// -128 bis 127 sal_Int8 charVal= static_cast<sal_Int8>( value); - any.setValue( &charVal, getCppuType( (sal_Int8*)0)); + any.setValue( &charVal, cppu::UnoType<sal_Int8>::get()); } else if( value <= 0x7fff && value >= -0x8000) {// -32768 bis 32767 diff --git a/extensions/test/ole/OleClient/funcs.cxx b/extensions/test/ole/OleClient/funcs.cxx index c4846440bac3..68c3700c81f0 100644 --- a/extensions/test/ole/OleClient/funcs.cxx +++ b/extensions/test/ole/OleClient/funcs.cxx @@ -146,7 +146,7 @@ bool checkOutArgs(const Sequence<Any> & outArgs, NamedArgument naOut; value >>= naVal; out >>= naOut; - if (values[i].getValueType() == getCppuType((NamedArgument *) 0)) + if (values[i].getValueType() == cppu::UnoType<NamedArgument>::get()) { NamedArgument inNamed; values[i] >>= inNamed; diff --git a/extensions/test/ole/OleConverterVar1/convTest.cxx b/extensions/test/ole/OleConverterVar1/convTest.cxx index 726a17c78c8d..1b949cee8e08 100644 --- a/extensions/test/ole/OleConverterVar1/convTest.cxx +++ b/extensions/test/ole/OleConverterVar1/convTest.cxx @@ -131,7 +131,7 @@ HRESULT doTest() rtl_getGlobalProcessId( arId); Any target= xSuppl->createBridge( any, Sequence<sal_Int8>( (sal_Int8*)arId, 16), UNO, OLE); CComDispatchDriver oletest; - if (target.getValueTypeClass() == getCppuType((sal_uInt32*) 0).getTypeClass()) + if (target.getValueTypeClass() == cppu::UnoType<sal_uInt32>::get().getTypeClass()) { VARIANT* pVariant = *(VARIANT**)target.getValue(); |