summaryrefslogtreecommitdiff
path: root/stoc/test
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2014-05-23 22:11:27 +0200
committerJulien Nabet <serval2412@yahoo.fr>2014-05-23 22:11:52 +0200
commitac76cc7e605b1bc9c0ff8e24d0b9995a8247074e (patch)
tree797df8cc9387fa70a0c09e574f49714ce4dc6710 /stoc/test
parent3191d7d1302dbde2445b9f300b3eb853120ede65 (diff)
Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part20
Change-Id: If87cdfb2c605254f6d69baa4ca5aec09091caa68
Diffstat (limited to 'stoc/test')
-rw-r--r--stoc/test/testconv.cxx36
-rw-r--r--stoc/test/testcorefl.cxx2
-rw-r--r--stoc/test/testiadapter.cxx18
-rw-r--r--stoc/test/testintrosp.cxx10
4 files changed, 33 insertions, 33 deletions
diff --git a/stoc/test/testconv.cxx b/stoc/test/testconv.cxx
index ee588b4bd1c4..3f897294a697 100644
--- a/stoc/test/testconv.cxx
+++ b/stoc/test/testconv.cxx
@@ -562,10 +562,10 @@ static sal_Int32 initBlocks( ConvBlock * pTestBlocks )
pTestBlocks[nElems++] = ConvBlock( aVal, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 );
// st,do,fl,u3,i3,u1,i1,by,bo,ch,tc,si,sa
int e = 1;
- aVal.setValue( &e, ::getCppuType( (const TypeClass *)0 ) );
+ aVal.setValue( &e, cppu::UnoType<TypeClass>::get());
pTestBlocks[nElems++] = ConvBlock( aVal, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0 );
// st,do,fl,u3,i3,u1,i1,by,bo,ch,tc,si,sa
- aVal.setValue( &e, ::getCppuType( (const FieldAccessMode *)0 ) );
+ aVal.setValue( &e, cppu::UnoType<FieldAccessMode>::get());
pTestBlocks[nElems++] = ConvBlock( aVal, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 );
// st,do,fl,u3,i3,u1,i1,by,bo,ch,tc,si,sa
// ==SEQ of INT==
@@ -618,17 +618,17 @@ static void test_Conversion( const Reference< XMultiServiceFactory > & xMgr )
const ConvBlock& rBlock = pTestBlocks[nPos];
const Any & rVal = rBlock._value;
- convertTo( ::getCppuType( (const OUString *)0 ), rVal, rBlock._toString );
- convertTo( ::getCppuType( (const float *)0 ), rVal, rBlock._toFloat );
- convertTo( ::getCppuType( (const double *)0 ), rVal, rBlock._toDouble );
- convertTo( ::getCppuType( (const sal_uInt32 *)0 ), rVal, rBlock._toUINT32 );
- convertTo( ::getCppuType( (const sal_Int32 *)0 ), rVal, rBlock._toINT32 );
- convertTo( ::getCppuType( (const sal_uInt16 *)0 ), rVal, rBlock._toUINT16 );
- convertTo( ::getCppuType( (const sal_Int16 *)0 ), rVal, rBlock._toINT16 );
- convertTo( ::getCppuType( (const sal_Int8 *)0 ), rVal, rBlock._toBYTE );
+ convertTo( cppu::UnoType<OUString>::get(), rVal, rBlock._toString );
+ convertTo( cppu::UnoType<float>::get(), rVal, rBlock._toFloat );
+ convertTo( cppu::UnoType<double>::get(), rVal, rBlock._toDouble );
+ convertTo( cppu::UnoType<sal_uInt32>::get(), rVal, rBlock._toUINT32 );
+ convertTo( cppu::UnoType<sal_Int32>::get(), rVal, rBlock._toINT32 );
+ convertTo( cppu::UnoType<cppu::UnoUnsignedShortType>::get(), rVal, rBlock._toUINT16 );
+ convertTo( cppu::UnoType<sal_Int16>::get(), rVal, rBlock._toINT16 );
+ convertTo( cppu::UnoType<sal_Int8>::get(), rVal, rBlock._toBYTE );
convertTo( ::getBooleanCppuType(), rVal, rBlock._toBOOL );
convertTo( ::getCharCppuType(), rVal, rBlock._toChar );
- convertTo( ::getCppuType( (const TypeClass *)0 ), rVal, rBlock._toTypeClass );
+ convertTo( cppu::UnoType<TypeClass>::get(), rVal, rBlock._toTypeClass );
convertTo( ::getCppuType( (const Sequence< sal_Int16 > *)0 ), rVal, rBlock._toSeqINT16 );
convertTo( ::getCppuType( (const Sequence< Any > *)0 ), rVal, rBlock._toSeqAny );
@@ -639,18 +639,18 @@ static void test_Conversion( const Reference< XMultiServiceFactory > & xMgr )
delete [] pTestBlocks;
Any aRet;
- aRet = xConverter->convertTo( Any( &xMgr, ::getCppuType( (const Reference< XMultiServiceFactory > *)0 ) ),
- ::getCppuType( (const Reference< XServiceInfo > *)0 ) );
- aRet = xConverter->convertTo( aRet, ::getCppuType( (const Reference< XMultiServiceFactory > *)0 ) );
- aRet = xConverter->convertTo( aRet, ::getCppuType( (const Reference< XServiceInfo > *)0 ) );
+ aRet = xConverter->convertTo( Any( &xMgr, cppu::UnoType<XMultiServiceFactory>::get()),
+ cppu::UnoType<XServiceInfo>::get());
+ aRet = xConverter->convertTo( aRet, cppu::UnoType<XMultiServiceFactory>::get());
+ aRet = xConverter->convertTo( aRet, cppu::UnoType<XServiceInfo>::get());
aRet <<= SAL_CONST_INT64(0x7fffffffffffffff);
- aRet = xConverter->convertTo( aRet, ::getCppuType( (const sal_uInt64 *)0 ) );
+ aRet = xConverter->convertTo( aRet, cppu::UnoType<sal_uInt64>::get());
OSL_ASSERT( *(const sal_uInt64 *)aRet.getValue() == SAL_CONST_UINT64(0x7fffffffffffffff) );
aRet <<= SAL_CONST_UINT64(0xffffffffffffffff);
- aRet = xConverter->convertTo( aRet, ::getCppuType( (const sal_uInt64 *)0 ) );
+ aRet = xConverter->convertTo( aRet, cppu::UnoType<sal_uInt64>::get());
OSL_ASSERT( *(const sal_uInt64 *)aRet.getValue() == SAL_CONST_UINT64(0xffffffffffffffff) );
aRet <<= SAL_CONST_INT64(-1);
- aRet = xConverter->convertTo( aRet, ::getCppuType( (const sal_Int8 *)0 ) );
+ aRet = xConverter->convertTo( aRet, cppu::UnoType<sal_Int8>::get());
OSL_ASSERT( *(const sal_Int8 *)aRet.getValue() == (-1) );
printf( "test_Conversion(): end.\n" );
}
diff --git a/stoc/test/testcorefl.cxx b/stoc/test/testcorefl.cxx
index d958301beaf7..e5d8b01a0c68 100644
--- a/stoc/test/testcorefl.cxx
+++ b/stoc/test/testcorefl.cxx
@@ -208,7 +208,7 @@ static sal_Bool test_corefl( const Reference< XIdlReflection > & xRefl )
Any aStructAny(&aStructC, ::getCppuType( (const StructC *) 0 ));
sal_Int32 nLong = aConstLong * 2;
- aAny.setValue( &nLong, ::getCppuType( (const sal_Int32 *)0 ) );
+ aAny.setValue( &nLong, cppu::UnoType<sal_Int32>::get());
OSL_ENSURE(*(sal_Int32*)xRefl->forName("ModuleA.StructA")->getField(OUString( "aLong" ))->get(
Any(&aStructC, ::getCppuType( (const StructC *)0 ))).getValue() == aConstLong, "test_RegCoreReflection(): error 52");
diff --git a/stoc/test/testiadapter.cxx b/stoc/test/testiadapter.cxx
index d69836683b84..097597f927e2 100644
--- a/stoc/test/testiadapter.cxx
+++ b/stoc/test/testiadapter.cxx
@@ -753,7 +753,7 @@ sal_Bool performTest( const Reference<XLanguageBindingTest > & xLBT )
SAL_CONST_INT64(0x123456789abcdef0),
SAL_CONST_UINT64(0xfedcba9876543210),
(float)17.0815, 3.1415926359, TestEnum_LOLA, OUString("dumdidum"), xI,
- Any( &xI, ::getCppuType( (const Reference<XInterface > *)0 ) ) );
+ Any( &xI, cppu::UnoType<XInterface>::get()) );
OSL_ENSURE( aData.Any == xI, "### unexpected any!" );
OSL_ENSURE( !(aData.Any != xI), "### unexpected any!" );
@@ -769,7 +769,7 @@ sal_Bool performTest( const Reference<XLanguageBindingTest > & xLBT )
aData.Bool, aData.Char, aData.Byte, aData.Short, aData.UShort,
aData.Long, aData.ULong, aData.Hyper, aData.UHyper, aData.Float, aData.Double,
aData.Enum, aData.String, xI,
- Any( &xI, ::getCppuType( (const Reference<XInterface > *)0 ) ) );
+ Any( &xI, cppu::UnoType<XInterface>::get()) );
aSetData.Sequence = Sequence<test::TestElement >( (const test::TestElement *)&aSetData, 1 );
@@ -942,27 +942,27 @@ static sal_Bool test_adapter( const Reference< XMultiServiceFactory > & xMgr )
Reference< XLanguageBindingTest > xOriginal( (XLanguageBindingTest *)new Test_Impl() );
Reference< XInvocation > xInvok( new XLB_Invocation( xMgr, xOriginal ) );
Reference< XLanguageBindingTest > xLBT( xAdapFac->createAdapter(
- xInvok, ::getCppuType( (const Reference< XLanguageBindingTest > *)0 ) ), UNO_QUERY );
+ xInvok, cppu::UnoType<XLanguageBindingTest>::get()), UNO_QUERY );
Reference< XLanguageBindingTest > xLBT2(
xAdapFac->createAdapter(
- xInvok, ::getCppuType( (const Reference< XLanguageBindingTest > *)0 ) ), UNO_QUERY );
+ xInvok, cppu::UnoType<XLanguageBindingTest>::get()), UNO_QUERY );
if (xLBT != xLBT2)
return sal_False;
Reference< XInterface > xLBT3(
xAdapFac->createAdapter(
- xInvok, ::getCppuType( (const Reference< XInterface > *)0 ) ), UNO_QUERY );
+ xInvok, cppu::UnoType<XInterface>::get()), UNO_QUERY );
if (xLBT != xLBT3)
return sal_False;
Type ar[ 2 ] = {
- ::getCppuType( (const Reference< XLBTestBase > *)0 ),
- ::getCppuType( (const Reference< XInterface > *)0 ) };
+ cppu::UnoType<XLBTestBase>::get(),
+ cppu::UnoType<XInterface>::get()};
Reference< XInterface > xLBT4(
xAdapFac2->createAdapter( xInvok, Sequence< Type >( ar, 2 ) ), UNO_QUERY );
if (xLBT != xLBT4)
return sal_False;
Reference< XSimpleRegistry > xInvalidAdapter(
xAdapFac->createAdapter(
- xInvok, ::getCppuType( (const Reference< XSimpleRegistry > *)0 ) ), UNO_QUERY );
+ xInvok, cppu::UnoType<XSimpleRegistry>::get()), UNO_QUERY );
if (xLBT == xInvalidAdapter)
return sal_False;
@@ -991,7 +991,7 @@ static sal_Bool test_invocation( const Reference< XMultiServiceFactory > & xMgr
xInvocFac->createInstanceWithArguments( Sequence< Any >( &aOriginal, 1 ) ), UNO_QUERY );
Reference< XLanguageBindingTest > xLBT( xAdapFac->createAdapter(
- xInvok, ::getCppuType( (const Reference< XLanguageBindingTest > *)0 ) ), UNO_QUERY );
+ xInvok, cppu::UnoType<XLanguageBindingTest>::get()), UNO_QUERY );
return (performTest( xLBT ) && raiseException( xLBT ));
}
diff --git a/stoc/test/testintrosp.cxx b/stoc/test/testintrosp.cxx
index 54da3eb3ff43..b3908eb7e771 100644
--- a/stoc/test/testintrosp.cxx
+++ b/stoc/test/testintrosp.cxx
@@ -209,17 +209,17 @@ Sequence< Property > ImplPropertySetInfo::getProperties(void)
pAry[0].Name = "Factor";
pAry[0].Handle = -1;
- pAry[0].Type = getCppuType( (double*) NULL );
+ pAry[0].Type = cppu::UnoType<double>::get();
pAry[0].Attributes = BOUND | TRANSIENT;
pAry[1].Name = "MyCount";
pAry[1].Handle = -1;
- pAry[1].Type = getCppuType( (sal_Int32*) NULL );
+ pAry[1].Type = cppu::UnoType<sal_Int32>::get();
pAry[1].Attributes = BOUND | TRANSIENT;
pAry[2].Name = "Info";
pAry[2].Handle = -1;
- pAry[2].Type = getCppuType( (OUString*) NULL );
+ pAry[2].Type = cppu::UnoType<OUString>::get();
pAry[2].Attributes = TRANSIENT;
}
// Return information about all three properties
@@ -681,7 +681,7 @@ Any getIntrospectionTestObject( const Reference< XMultiServiceFactory > & xMgr )
{
Any aObjAny;
Reference< XIntroTest > xTestObj = new ImplIntroTest( xMgr );
- aObjAny.setValue( &xTestObj, ::getCppuType( (const Reference< XIntroTest > *)0 ) );
+ aObjAny.setValue( &xTestObj, cppu::UnoType<XIntroTest>::get());
return aObjAny;
}
@@ -860,7 +860,7 @@ static sal_Bool test_introsp( Reference< XMultiServiceFactory > xMgr,
// check result of introspection
// determine XPropertySet-UIK
- Type aType = getCppuType( (Reference< XPropertySet >*) NULL );
+ Type aType = cppu::UnoType<XPropertySet>::get();
Reference< XInterface > xPropSetIface = xAccess->queryAdapter( aType );
Reference< XPropertySet > xPropSet( xPropSetIface, UNO_QUERY );