Replace remaining getCppuType et al with cppu::UnoType
Change-Id: I02c70b26b82d2d0357111a127aefc57d3be21320
This commit is contained in:
@@ -69,7 +69,7 @@ using namespace test::testtools::bridgetest;
|
|||||||
|
|
||||||
namespace bridge_test
|
namespace bridge_test
|
||||||
{
|
{
|
||||||
template< class T>
|
template<typename T, typename U = T>
|
||||||
Sequence<T> cloneSequence(const Sequence<T>& val);
|
Sequence<T> cloneSequence(const Sequence<T>& val);
|
||||||
|
|
||||||
|
|
||||||
@@ -270,12 +270,12 @@ static bool performAnyTest( const Reference< XBridgeTest > &xLBT, const TestData
|
|||||||
|
|
||||||
Any a;
|
Any a;
|
||||||
{
|
{
|
||||||
a.setValue( &(data.Bool) , getCppuBooleanType() );
|
a.setValue( &(data.Bool) , cppu::UnoType<bool>::get() );
|
||||||
OSL_ASSERT( xLBT->transportAny( a ) == a );
|
OSL_ASSERT( xLBT->transportAny( a ) == a );
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
a.setValue( &(data.Char) , getCppuCharType() );
|
a.setValue( &(data.Char) , cppu::UnoType<cppu::UnoCharType>::get() );
|
||||||
OSL_ASSERT( xLBT->transportAny( a ) == a );
|
OSL_ASSERT( xLBT->transportAny( a ) == a );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -381,7 +381,7 @@ static bool performTest(
|
|||||||
0xFEDCBA98, SAL_CONST_INT64(0x123456789ABCDEF0),
|
0xFEDCBA98, SAL_CONST_INT64(0x123456789ABCDEF0),
|
||||||
SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, 3.1415926359,
|
SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, 3.1415926359,
|
||||||
TestEnum_LOLA, STRING_TEST_CONSTANT, xI,
|
TestEnum_LOLA, STRING_TEST_CONSTANT, xI,
|
||||||
Any(&xI, getCppuType((Reference< XInterface > const *) 0)));
|
Any(&xI, cppu::UnoType<XInterface>::get()));
|
||||||
bRet &= check(aData.Any == xI, "### unexpected any!");
|
bRet &= check(aData.Any == xI, "### unexpected any!");
|
||||||
bRet &= check(!(aData.Any != xI), "### unexpected any!");
|
bRet &= check(!(aData.Any != xI), "### unexpected any!");
|
||||||
aData.Sequence.realloc(2);
|
aData.Sequence.realloc(2);
|
||||||
@@ -393,7 +393,7 @@ static bool performTest(
|
|||||||
(TestElement &) aSetData, aData.Bool, aData.Char, aData.Byte,
|
(TestElement &) aSetData, aData.Bool, aData.Char, aData.Byte,
|
||||||
aData.Short, aData.UShort, aData.Long, aData.ULong, aData.Hyper,
|
aData.Short, aData.UShort, aData.Long, aData.ULong, aData.Hyper,
|
||||||
aData.UHyper, aData.Float, aData.Double, aData.Enum, aData.String,
|
aData.UHyper, aData.Float, aData.Double, aData.Enum, aData.String,
|
||||||
xI, Any(&xI, getCppuType((Reference< XInterface > const *) 0)));
|
xI, Any(&xI, cppu::UnoType<XInterface>::get()));
|
||||||
aSetData.Sequence.realloc(2);
|
aSetData.Sequence.realloc(2);
|
||||||
aSetData.Sequence[0] = *(TestElement const *) &aSetData;
|
aSetData.Sequence[0] = *(TestElement const *) &aSetData;
|
||||||
// aSetData.Sequence[1] is empty
|
// aSetData.Sequence[1] is empty
|
||||||
@@ -659,9 +659,9 @@ static bool performTest(
|
|||||||
sal_Bool _aBool = true;
|
sal_Bool _aBool = true;
|
||||||
sal_Int32 _aInt = 0xBABEBABE;
|
sal_Int32 _aInt = 0xBABEBABE;
|
||||||
float _aFloat = 3.14f;
|
float _aFloat = 3.14f;
|
||||||
Any _any1(&_aBool, getCppuBooleanType());
|
Any _any1(&_aBool, cppu::UnoType<bool>::get());
|
||||||
Any _any2(&_aInt, getCppuType((sal_Int32 *) 0));
|
Any _any2(&_aInt, cppu::UnoType<sal_Int32>::get());
|
||||||
Any _any3(&_aFloat, getCppuType((float *) 0));
|
Any _any3(&_aFloat, cppu::UnoType<float>::get());
|
||||||
Any _arAny[] = { _any1, _any2, _any3 };
|
Any _arAny[] = { _any1, _any2, _any3 };
|
||||||
Reference< XInterface > _arObj[3];
|
Reference< XInterface > _arObj[3];
|
||||||
_arObj[0] = new OWeakObject();
|
_arObj[0] = new OWeakObject();
|
||||||
@@ -674,19 +674,19 @@ static bool performTest(
|
|||||||
SAL_CONST_INT64(0x123456789ABCDEF0),
|
SAL_CONST_INT64(0x123456789ABCDEF0),
|
||||||
SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, 3.1415926359,
|
SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, 3.1415926359,
|
||||||
TestEnum_LOLA, STRING_TEST_CONSTANT, _arObj[0],
|
TestEnum_LOLA, STRING_TEST_CONSTANT, _arObj[0],
|
||||||
Any(&_arObj[0], getCppuType((Reference< XInterface > const *) 0)));
|
Any(&_arObj[0], cppu::UnoType<XInterface>::get()));
|
||||||
assign(
|
assign(
|
||||||
_arStruct[1], true, 'A', 17, 0x1234, 0xFEDC, 0x12345678, 0xFEDCBA98,
|
_arStruct[1], true, 'A', 17, 0x1234, 0xFEDC, 0x12345678, 0xFEDCBA98,
|
||||||
SAL_CONST_INT64(0x123456789ABCDEF0),
|
SAL_CONST_INT64(0x123456789ABCDEF0),
|
||||||
SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, 3.1415926359,
|
SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, 3.1415926359,
|
||||||
TestEnum_TWO, STRING_TEST_CONSTANT, _arObj[1],
|
TestEnum_TWO, STRING_TEST_CONSTANT, _arObj[1],
|
||||||
Any(&_arObj[1], getCppuType((Reference< XInterface > const *) 0)));
|
Any(&_arObj[1], cppu::UnoType<XInterface>::get()));
|
||||||
assign(
|
assign(
|
||||||
_arStruct[2], true, 'B', 17, 0x1234, 0xFEDC, 0x12345678, 0xFEDCBA98,
|
_arStruct[2], true, 'B', 17, 0x1234, 0xFEDC, 0x12345678, 0xFEDCBA98,
|
||||||
SAL_CONST_INT64(0x123456789ABCDEF0),
|
SAL_CONST_INT64(0x123456789ABCDEF0),
|
||||||
SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, 3.1415926359,
|
SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, 3.1415926359,
|
||||||
TestEnum_CHECK, STRING_TEST_CONSTANT, _arObj[2],
|
TestEnum_CHECK, STRING_TEST_CONSTANT, _arObj[2],
|
||||||
Any(&_arObj[2], getCppuType((Reference< XInterface > const *) 0)));
|
Any(&_arObj[2], cppu::UnoType<XInterface>::get()));
|
||||||
{
|
{
|
||||||
Sequence<sal_Bool> arBool(_arBool, 3);
|
Sequence<sal_Bool> arBool(_arBool, 3);
|
||||||
Sequence<sal_Unicode> arChar( _arChar, 3);
|
Sequence<sal_Unicode> arChar( _arChar, 3);
|
||||||
@@ -759,10 +759,10 @@ static bool performTest(
|
|||||||
xBT2->setSequenceStruct(arStruct));
|
xBT2->setSequenceStruct(arStruct));
|
||||||
bRet &= check(seqStructRet == arStruct, "sequence test");
|
bRet &= check(seqStructRet == arStruct, "sequence test");
|
||||||
Sequence< sal_Bool > arBoolTemp(cloneSequence(arBool));
|
Sequence< sal_Bool > arBoolTemp(cloneSequence(arBool));
|
||||||
Sequence< sal_Unicode > arCharTemp(cloneSequence(arChar));
|
Sequence< sal_Unicode > arCharTemp(cloneSequence<sal_Unicode, cppu::UnoCharType>(arChar));
|
||||||
Sequence< sal_Int8 > arByteTemp(cloneSequence(arByte));
|
Sequence< sal_Int8 > arByteTemp(cloneSequence(arByte));
|
||||||
Sequence< sal_Int16 > arShortTemp(cloneSequence(arShort));
|
Sequence< sal_Int16 > arShortTemp(cloneSequence(arShort));
|
||||||
Sequence< sal_uInt16 > arUShortTemp(cloneSequence(arUShort));
|
Sequence< sal_uInt16 > arUShortTemp(cloneSequence<sal_uInt16, cppu::UnoUnsignedShortType>(arUShort));
|
||||||
Sequence< sal_Int32 > arLongTemp(cloneSequence(arLong));
|
Sequence< sal_Int32 > arLongTemp(cloneSequence(arLong));
|
||||||
Sequence< sal_uInt32 > arULongTemp(cloneSequence(arULong));
|
Sequence< sal_uInt32 > arULongTemp(cloneSequence(arULong));
|
||||||
Sequence< sal_Int64 > arHyperTemp(cloneSequence(arHyper));
|
Sequence< sal_Int64 > arHyperTemp(cloneSequence(arHyper));
|
||||||
@@ -1071,10 +1071,10 @@ uno_Sequence* cloneSequence(const uno_Sequence* val, const Type& type)
|
|||||||
return retSeq;
|
return retSeq;
|
||||||
}
|
}
|
||||||
|
|
||||||
template< class T>
|
template<typename T, typename U>
|
||||||
Sequence<T> cloneSequence(const Sequence<T>& val)
|
Sequence<T> cloneSequence(const Sequence<T>& val)
|
||||||
{
|
{
|
||||||
Sequence<T> seq( cloneSequence(val.get(), getCppuType(&val)), SAL_NO_ACQUIRE);
|
Sequence<T> seq( cloneSequence(val.get(), cppu::UnoType<cppu::UnoSequenceType<U>>::get()), SAL_NO_ACQUIRE);
|
||||||
return seq;
|
return seq;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1115,7 +1115,7 @@ inline bool makeSurrogate(
|
|||||||
}
|
}
|
||||||
cpp2uno.mapInterface(
|
cpp2uno.mapInterface(
|
||||||
reinterpret_cast< void ** >( &unoI.m_pUnoI ),
|
reinterpret_cast< void ** >( &unoI.m_pUnoI ),
|
||||||
rOriginal.get(), ::getCppuType( &rOriginal ) );
|
rOriginal.get(), cppu::UnoType<decltype(rOriginal)>::get() );
|
||||||
if (! unoI.is())
|
if (! unoI.is())
|
||||||
{
|
{
|
||||||
throw RuntimeException(
|
throw RuntimeException(
|
||||||
@@ -1123,7 +1123,7 @@ inline bool makeSurrogate(
|
|||||||
}
|
}
|
||||||
uno2cpp.mapInterface(
|
uno2cpp.mapInterface(
|
||||||
reinterpret_cast< void ** >( &rOut ),
|
reinterpret_cast< void ** >( &rOut ),
|
||||||
unoI.get(), ::getCppuType( &rOriginal ) );
|
unoI.get(), cppu::UnoType<decltype(rOriginal)>::get() );
|
||||||
if (! rOut.is())
|
if (! rOut.is())
|
||||||
{
|
{
|
||||||
throw RuntimeException(
|
throw RuntimeException(
|
||||||
|
@@ -77,20 +77,20 @@ public:
|
|||||||
{
|
{
|
||||||
// execution time remains appr. constant any time
|
// execution time remains appr. constant any time
|
||||||
Any aRet;
|
Any aRet;
|
||||||
if (aType == ::getCppuType( (const Reference< XInterface > *)0 ))
|
if (aType == cppu::UnoType<XInterface>::get())
|
||||||
{
|
{
|
||||||
void * p = (XInterface *)(XPerformanceTest *)this;
|
void * p = (XInterface *)(XPerformanceTest *)this;
|
||||||
aRet.setValue( &p, ::getCppuType( (const Reference< XInterface > *)0 ) );
|
aRet.setValue( &p, cppu::UnoType<XInterface>::get() );
|
||||||
}
|
}
|
||||||
if (aType == ::getCppuType( (const Reference< XPerformanceTest > *)0 ))
|
if (aType == cppu::UnoType<XPerformanceTest>::get())
|
||||||
{
|
{
|
||||||
void * p = (XPerformanceTest *)this;
|
void * p = (XPerformanceTest *)this;
|
||||||
aRet.setValue( &p, ::getCppuType( (const Reference< XPerformanceTest > *)0 ) );
|
aRet.setValue( &p, cppu::UnoType<XPerformanceTest>::get() );
|
||||||
}
|
}
|
||||||
if (! aRet.hasValue())
|
if (! aRet.hasValue())
|
||||||
{
|
{
|
||||||
void * p = (XPerformanceTest *)this;
|
void * p = (XPerformanceTest *)this;
|
||||||
Any aDummy( &p, ::getCppuType( (const Reference< XPerformanceTest > *)0 ) );
|
Any aDummy( &p, cppu::UnoType<XPerformanceTest>::get() );
|
||||||
}
|
}
|
||||||
return aRet;
|
return aRet;
|
||||||
}
|
}
|
||||||
|
@@ -219,9 +219,9 @@ Reference< XSingleServiceFactory > loadLibComponentFactory(
|
|||||||
if (aCurrent2Env.is() && aEnv2Current.is())
|
if (aCurrent2Env.is() && aEnv2Current.is())
|
||||||
{
|
{
|
||||||
void * pSMgr = aCurrent2Env.mapInterface(
|
void * pSMgr = aCurrent2Env.mapInterface(
|
||||||
xSF.get(), ::getCppuType( (const Reference< XMultiServiceFactory > *)0 ) );
|
xSF.get(), cppu::UnoType<XMultiServiceFactory>::get() );
|
||||||
void * pKey = aCurrent2Env.mapInterface(
|
void * pKey = aCurrent2Env.mapInterface(
|
||||||
xKey.get(), ::getCppuType( (const Reference< XRegistryKey > *)0 ) );
|
xKey.get(), cppu::UnoType<XRegistryKey>::get() );
|
||||||
|
|
||||||
void * pSSF = (*((component_getFactoryFunc)pSym))(
|
void * pSSF = (*((component_getFactoryFunc)pSym))(
|
||||||
aImplName.getStr(), pSMgr, pKey );
|
aImplName.getStr(), pSMgr, pKey );
|
||||||
@@ -235,7 +235,7 @@ Reference< XSingleServiceFactory > loadLibComponentFactory(
|
|||||||
{
|
{
|
||||||
aEnv2Current.mapInterface(
|
aEnv2Current.mapInterface(
|
||||||
reinterpret_cast< void ** >( &xRet ),
|
reinterpret_cast< void ** >( &xRet ),
|
||||||
pSSF, ::getCppuType( (const Reference< XSingleServiceFactory > *)0 ) );
|
pSSF, cppu::UnoType<XSingleServiceFactory>::get() );
|
||||||
(*pEnv->pExtEnv->releaseInterface)( pEnv->pExtEnv, pSSF );
|
(*pEnv->pExtEnv->releaseInterface)( pEnv->pExtEnv, pSSF );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -277,9 +277,9 @@ Reference< XSingleServiceFactory > loadLibComponentFactory(
|
|||||||
uno_Interface * pUComponentFactory = 0;
|
uno_Interface * pUComponentFactory = 0;
|
||||||
|
|
||||||
uno_Interface * pUSFactory = (uno_Interface *)aCpp2Uno.mapInterface(
|
uno_Interface * pUSFactory = (uno_Interface *)aCpp2Uno.mapInterface(
|
||||||
xSF.get(), ::getCppuType( (const Reference< XMultiServiceFactory > *)0 ) );
|
xSF.get(), cppu::UnoType<XMultiServiceFactory>::get() );
|
||||||
uno_Interface * pUKey = (uno_Interface *)aCpp2Uno.mapInterface(
|
uno_Interface * pUKey = (uno_Interface *)aCpp2Uno.mapInterface(
|
||||||
xKey.get(), ::getCppuType( (const Reference< XRegistryKey > *)0 ) );
|
xKey.get(), cppu::UnoType<XRegistryKey>::get() );
|
||||||
|
|
||||||
pUComponentFactory = (*((CreateComponentFactoryFunc)pSym))(
|
pUComponentFactory = (*((CreateComponentFactoryFunc)pSym))(
|
||||||
rImplName.getStr(), pUSFactory, pUKey );
|
rImplName.getStr(), pUSFactory, pUKey );
|
||||||
@@ -293,7 +293,7 @@ Reference< XSingleServiceFactory > loadLibComponentFactory(
|
|||||||
{
|
{
|
||||||
XSingleServiceFactory * pXFactory =
|
XSingleServiceFactory * pXFactory =
|
||||||
(XSingleServiceFactory *)aUno2Cpp.mapInterface(
|
(XSingleServiceFactory *)aUno2Cpp.mapInterface(
|
||||||
pUComponentFactory, ::getCppuType( (const Reference< XSingleServiceFactory > *)0 ) );
|
pUComponentFactory, cppu::UnoType<XSingleServiceFactory>::get() );
|
||||||
(*pUComponentFactory->release)( pUComponentFactory );
|
(*pUComponentFactory->release)( pUComponentFactory );
|
||||||
|
|
||||||
if (pXFactory)
|
if (pXFactory)
|
||||||
@@ -385,7 +385,7 @@ static void createInstance( Reference< T > & rxOut,
|
|||||||
buf.append( "service instance \"" );
|
buf.append( "service instance \"" );
|
||||||
buf.append( rServiceName );
|
buf.append( rServiceName );
|
||||||
buf.append( "\" does not support demanded interface \"" );
|
buf.append( "\" does not support demanded interface \"" );
|
||||||
const Type & rType = ::getCppuType( (const Reference< T > *)0 );
|
const Type & rType = cppu::UnoType<T>::get();
|
||||||
buf.append( rType.getTypeName() );
|
buf.append( rType.getTypeName() );
|
||||||
buf.append( "\"!" );
|
buf.append( "\"!" );
|
||||||
throw RuntimeException( buf.makeStringAndClear() );
|
throw RuntimeException( buf.makeStringAndClear() );
|
||||||
@@ -563,8 +563,8 @@ static void benchmark(
|
|||||||
sal_Int64 i;
|
sal_Int64 i;
|
||||||
sal_uInt32 tStart, tEnd;
|
sal_uInt32 tStart, tEnd;
|
||||||
|
|
||||||
const Type & rKnownType = ::getCppuType( (const Reference< XPerformanceTest > *)0 );
|
const Type & rKnownType = cppu::UnoType<XPerformanceTest>::get();
|
||||||
const Type & rUnKnownType = ::getCppuType( (const Reference< XSet > *)0 );
|
const Type & rUnKnownType = cppu::UnoType<XSet>::get();
|
||||||
|
|
||||||
ComplexTypes aDummyStruct;
|
ComplexTypes aDummyStruct;
|
||||||
|
|
||||||
@@ -1057,7 +1057,7 @@ sal_Int32 TestImpl::run( const Sequence< OUString > & rArgs )
|
|||||||
Reference< XInterface > xMapped;
|
Reference< XInterface > xMapped;
|
||||||
Reference< XInterface > xDirect( getDirect() );
|
Reference< XInterface > xDirect( getDirect() );
|
||||||
aMapping.mapInterface( reinterpret_cast< void ** >( &xMapped ), xDirect.get(),
|
aMapping.mapInterface( reinterpret_cast< void ** >( &xMapped ), xDirect.get(),
|
||||||
::getCppuType( &xDirect ) );
|
cppu::UnoType<decltype(xDirect)>::get() );
|
||||||
if (! xMapped.is())
|
if (! xMapped.is())
|
||||||
throw RuntimeException("mapping object failed!" );
|
throw RuntimeException("mapping object failed!" );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user