summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-04-01 08:41:10 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-04-01 08:41:10 +0200
commite1f3391a749873875e2e65bf9f36d242702b8006 (patch)
tree3b4df0931cb7f1540471e1dafa51a4a18e98eea3 /stoc
parent72a11e4544c900f0b83fbdcae11eb247d65e9666 (diff)
Replace remaining getCppuType et al with cppu::UnoType
Change-Id: I14b923990a012e8e85ca9170cdffd6b8e3626d89
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/defaultregistry/defaultregistry.cxx2
-rw-r--r--stoc/source/implementationregistration/implreg.cxx4
-rw-r--r--stoc/source/invocation_adapterfactory/iafactory.cxx12
-rw-r--r--stoc/source/proxy_factory/proxyfac.cxx8
-rw-r--r--stoc/source/servicemanager/servicemanager.cxx6
-rw-r--r--stoc/source/typeconv/convert.cxx10
-rw-r--r--stoc/test/testconv.cxx14
-rw-r--r--stoc/test/testcorefl.cxx20
-rw-r--r--stoc/test/testiadapter.cxx18
9 files changed, 47 insertions, 47 deletions
diff --git a/stoc/source/defaultregistry/defaultregistry.cxx b/stoc/source/defaultregistry/defaultregistry.cxx
index aff3f149edff..477a76ccb7d9 100644
--- a/stoc/source/defaultregistry/defaultregistry.cxx
+++ b/stoc/source/defaultregistry/defaultregistry.cxx
@@ -1170,7 +1170,7 @@ Reference< XEnumeration > NestedRegistryImpl::createEnumeration( ) throw (Runti
Type NestedRegistryImpl::getElementType( ) throw (RuntimeException, std::exception)
{
- return getCppuType( &m_localReg );
+ return cppu::UnoType<decltype(m_localReg)>::get();
}
sal_Bool SAL_CALL NestedRegistryImpl::hasElements( ) throw (RuntimeException, std::exception)
diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx
index 90d3ce20f684..b78c1f4925bf 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -1361,7 +1361,7 @@ void ImplementationRegistration::initialize(
OUStringBuffer buf;
buf.append( "ImplementationRegistration::initialize() invalid first parameter,"
"expected " );
- buf.append( getCppuType( &rLoader ).getTypeName() );
+ buf.append( cppu::UnoType<decltype(rLoader)>::get().getTypeName() );
buf.append( ", got " );
buf.append( aArgs.getConstArray()[0].getValueTypeName() );
throw IllegalArgumentException( buf.makeStringAndClear(),
@@ -1408,7 +1408,7 @@ void ImplementationRegistration::initialize(
OUStringBuffer buf;
buf.append( "ImplementationRegistration::initialize() invalid fourth parameter,"
"expected " );
- buf.append( getCppuType( &rReg ).getTypeName() );
+ buf.append( cppu::UnoType<decltype(rReg)>::get().getTypeName() );
buf.append( ", got " );
buf.append( aArgs.getConstArray()[3].getValueTypeName() );
throw IllegalArgumentException( buf.makeStringAndClear(),
diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx b/stoc/source/invocation_adapterfactory/iafactory.cxx
index 6fb7c6fd5a73..8bd1b3d98106 100644
--- a/stoc/source/invocation_adapterfactory/iafactory.cxx
+++ b/stoc/source/invocation_adapterfactory/iafactory.cxx
@@ -215,7 +215,7 @@ static inline void constructRuntimeException(
RuntimeException exc( rMsg );
// no conversion needed due to binary compatibility + no convertible type
::uno_type_any_construct(
- pExc, &exc, ::getCppuType( &exc ).getTypeLibType(), 0 );
+ pExc, &exc, cppu::UnoType<decltype(exc)>::get().getTypeLibType(), 0 );
}
@@ -665,7 +665,7 @@ AdapterImpl::AdapterImpl(
// map receiver
m_pReceiver = static_cast<uno_Interface *>(m_pFactory->m_aCpp2Uno.mapInterface(
- xReceiver.get(), ::getCppuType( &xReceiver ) ));
+ xReceiver.get(), cppu::UnoType<decltype(xReceiver)>::get() ));
OSL_ASSERT( 0 != m_pReceiver );
if (! m_pReceiver)
{
@@ -699,16 +699,16 @@ FactoryImpl::FactoryImpl( Reference< XComponentContext > const & xContext )
xContext ),
UNO_QUERY_THROW );
m_pConverter = static_cast<uno_Interface *>(m_aCpp2Uno.mapInterface(
- xConverter.get(), ::getCppuType( &xConverter ) ));
+ xConverter.get(), cppu::UnoType<decltype(xConverter)>::get() ));
OSL_ASSERT( 0 != m_pConverter );
// some type info:
// sequence< any >
- Type const & rAnySeqType = ::getCppuType( (const Sequence< Any > *)0 );
+ Type const & rAnySeqType = cppu::UnoType<Sequence< Any >>::get();
rAnySeqType.getDescription( &m_pAnySeqTD );
// sequence< short >
const Type & rShortSeqType =
- ::getCppuType( (const Sequence< sal_Int16 > *)0 );
+ cppu::UnoType<Sequence< sal_Int16 >>::get();
rShortSeqType.getDescription( &m_pShortSeqTD );
// script.XInvocation
typelib_TypeDescription * pTD = 0;
@@ -851,7 +851,7 @@ Reference< XInterface > FactoryImpl::createAdapter(
// map one interface to C++
uno_Interface * pUnoI = &that->m_pInterfaces[ 0 ];
m_aUno2Cpp.mapInterface(
- reinterpret_cast<void **>(&xRet), pUnoI, ::getCppuType( &xRet ) );
+ reinterpret_cast<void **>(&xRet), pUnoI, cppu::UnoType<decltype(xRet)>::get() );
that->release();
OSL_ASSERT( xRet.is() );
if (! xRet.is())
diff --git a/stoc/source/proxy_factory/proxyfac.cxx b/stoc/source/proxy_factory/proxyfac.cxx
index 85f11f6670cc..0530ef5570f0 100644
--- a/stoc/source/proxy_factory/proxyfac.cxx
+++ b/stoc/source/proxy_factory/proxyfac.cxx
@@ -153,7 +153,7 @@ UnoInterfaceReference FactoryImpl::binuno_queryInterface(
"### RuntimeException expected!" );
Any cpp_exc;
uno_type_copyAndConvertData(
- &cpp_exc, exc, ::getCppuType( &cpp_exc ).getTypeLibType(),
+ &cpp_exc, exc, cppu::UnoType<decltype(cpp_exc)>::get().getTypeLibType(),
m_uno2cpp.get() );
uno_any_destruct( exc, 0 );
::cppu::throwException( cpp_exc );
@@ -257,7 +257,7 @@ static void SAL_CALL binuno_proxy_dispatch(
*static_cast< Type const * >( pArgs[ 0 ] );
Any ret( that->m_root->queryInterface( rType ) );
uno_type_copyAndConvertData(
- pReturn, &ret, ::getCppuType( &ret ).getTypeLibType(),
+ pReturn, &ret, cppu::UnoType<decltype(ret)>::get().getTypeLibType(),
that->m_root->m_factory->m_cpp2uno.get() );
*ppException = 0; // no exc
}
@@ -316,7 +316,7 @@ inline ProxyRoot::ProxyRoot(
{
m_factory->m_cpp2uno.mapInterface(
reinterpret_cast< void ** >( &m_target.m_pUnoI ), xTarget.get(),
- ::getCppuType( &xTarget ) );
+ cppu::UnoType<decltype(xTarget)>::get() );
OSL_ENSURE( m_target.is(), "### mapping interface failed!" );
}
@@ -359,7 +359,7 @@ Any ProxyRoot::queryAggregation( Type const & rType )
UnoInterfaceReference root;
m_factory->m_cpp2uno.mapInterface(
reinterpret_cast< void ** >( &root.m_pUnoI ),
- xRoot.get(), ::getCppuType( &xRoot ) );
+ xRoot.get(), cppu::UnoType<decltype(xRoot)>::get() );
UnoInterfaceReference proxy(
// ref count initially 1:
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx
index a543da9f9735..33a35578e0e1 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -742,7 +742,7 @@ Reference<XPropertySetInfo > OServiceManager::getPropertySetInfo()
{
Sequence< beans::Property > seq( 1 );
seq[ 0 ] = beans::Property(
- "DefaultContext", -1, ::getCppuType( &m_xContext ), 0 );
+ "DefaultContext", -1, cppu::UnoType<decltype(m_xContext)>::get(), 0 );
Reference< beans::XPropertySetInfo > xInfo( new PropertySetInfo_Impl( seq ) );
MutexGuard aGuard( m_mutex );
@@ -1615,9 +1615,9 @@ Reference<XPropertySetInfo > ORegistryServiceManager::getPropertySetInfo()
{
Sequence< beans::Property > seq( 2 );
seq[ 0 ] = beans::Property(
- "DefaultContext", -1, ::getCppuType( &m_xContext ), 0 );
+ "DefaultContext", -1, cppu::UnoType<decltype(m_xContext)>::get(), 0 );
seq[ 1 ] = beans::Property(
- "Registry", -1, ::getCppuType( &m_xRegistry ),
+ "Registry", -1, cppu::UnoType<decltype(m_xRegistry)>::get(),
beans::PropertyAttribute::READONLY );
Reference< beans::XPropertySetInfo > xInfo( new PropertySetInfo_Impl( seq ) );
diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx
index 184a434c0083..426cc0525441 100644
--- a/stoc/source/typeconv/convert.cxx
+++ b/stoc/source/typeconv/convert.cxx
@@ -732,7 +732,7 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina
default:
{
sal_Bool bTmp = (toDouble( rVal ) != 0.0);
- aRet.setValue( &bTmp, getBooleanCppuType() );
+ aRet.setValue( &bTmp, cppu::UnoType<bool>::get() );
}
case TypeClass_ENUM: // exclude enums
break;
@@ -743,12 +743,12 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina
if ( aStr == "0" || aStr.equalsIgnoreAsciiCase( "false" ))
{
sal_Bool bFalse = sal_False;
- aRet.setValue( &bFalse, getCppuBooleanType() );
+ aRet.setValue( &bFalse, cppu::UnoType<bool>::get() );
}
else if ( aStr == "1" || aStr.equalsIgnoreAsciiCase( "true" ))
{
sal_Bool bTrue = sal_True;
- aRet.setValue( &bTrue, getCppuBooleanType() );
+ aRet.setValue( &bTrue, cppu::UnoType<bool>::get() );
}
else
{
@@ -766,13 +766,13 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina
if (aSourceClass==TypeClass_STRING)
{
if ((*static_cast<const OUString *>(rVal.getValue())).getLength() == 1) // single char
- aRet.setValue( (*static_cast<const OUString *>(rVal.getValue())).getStr(), ::getCharCppuType() );
+ aRet.setValue( (*static_cast<const OUString *>(rVal.getValue())).getStr(), cppu::UnoType<cppu::UnoCharType>::get() );
}
else if (aSourceClass!=TypeClass_ENUM && // exclude enums, chars
aSourceClass!=TypeClass_CHAR)
{
sal_Unicode cRet = (sal_Unicode)toHyper( rVal, 0, 0xffff ); // range
- aRet.setValue( &cRet, ::getCharCppuType() );
+ aRet.setValue( &cRet, cppu::UnoType<cppu::UnoCharType>::get() );
}
break;
}
diff --git a/stoc/test/testconv.cxx b/stoc/test/testconv.cxx
index 3f897294a697..66ecd6473600 100644
--- a/stoc/test/testconv.cxx
+++ b/stoc/test/testconv.cxx
@@ -520,7 +520,7 @@ static sal_Int32 initBlocks( ConvBlock * pTestBlocks )
// st,do,fl,u3,i3,u1,i1,by,bo,ch,tc,si,sa
// ==CHAR==
sal_Unicode c = 'A';
- aVal.setValue( &c, ::getCharCppuType() );
+ aVal.setValue( &c, cppu::UnoType<cppu::UnoCharType>::get() );
pTestBlocks[nElems++] = ConvBlock( aVal, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 );
// st,do,fl,u3,i3,u1,i1,by,bo,ch,tc,si,sa
aVal <<= OUString("A");
@@ -541,7 +541,7 @@ static sal_Int32 initBlocks( ConvBlock * pTestBlocks )
// st,do,fl,u3,i3,u1,i1,by,bo,ch,tc,si,sa
sal_Bool bTmp = sal_True;
- aVal.setValue( &bTmp, getBooleanCppuType() );
+ aVal.setValue( &bTmp, cppu::UnoType<bool>::get() );
pTestBlocks[nElems++] = ConvBlock( aVal, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 );
// st,do,fl,u3,i3,u1,i1,by,bo,ch,tc,si,sa
// ==ZERO STRINGS==
@@ -626,13 +626,13 @@ static void test_Conversion( const Reference< XMultiServiceFactory > & xMgr )
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( cppu::UnoType<bool>::get(), rVal, rBlock._toBOOL );
+ convertTo( cppu::UnoType<cppu::UnoCharType>::get(), rVal, rBlock._toChar );
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 );
+ convertTo( cppu::UnoType<Sequence< sal_Int16 >>::get(), rVal, rBlock._toSeqINT16 );
+ convertTo( cppu::UnoType<Sequence< Any >>::get(), rVal, rBlock._toSeqAny );
- convertTo( ::getVoidCppuType(), rVal, sal_True ); // anything converts to void
+ convertTo( cppu::UnoType<cppu::UnoVoidType>::get(), rVal, sal_True ); // anything converts to void
}
s_xConverter.clear();
diff --git a/stoc/test/testcorefl.cxx b/stoc/test/testcorefl.cxx
index e5d8b01a0c68..aa3719abbc85 100644
--- a/stoc/test/testcorefl.cxx
+++ b/stoc/test/testcorefl.cxx
@@ -203,15 +203,15 @@ static sal_Bool test_corefl( const Reference< XIdlReflection > & xRefl )
xRefl->forName("ModuleA.StructC")->getField(OUString("aInterfaceSeq"))->getType()->createObject(aAny);
- OSL_ENSURE(aAny.getValueType() == ::getCppuType( (const Sequence<Reference< XInterface > > *)0 ), "test_RegCoreReflection(): error 51a");
+ OSL_ENSURE(aAny.getValueType() == cppu::UnoType<Sequence<Reference< XInterface > >>::get(), "test_RegCoreReflection(): error 51a");
- Any aStructAny(&aStructC, ::getCppuType( (const StructC *) 0 ));
+ Any aStructAny(&aStructC, cppu::UnoType<StructC>::get());
sal_Int32 nLong = aConstLong * 2;
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");
+ Any(&aStructC, cppu::UnoType<StructC>::get())).getValue() == aConstLong, "test_RegCoreReflection(): error 52");
OSL_ENSURE(xRefl->forName("ModuleA.StructA")->getField(OUString( "aLong" ))->getAccessMode() == FieldAccessMode_READWRITE, "test_RegCoreReflection(): error 52a");
Reference< XIdlField2 > rField ( xRefl->forName("ModuleA.StructC")->getField(OUString( "aLong" )) , UNO_QUERY );
rField->set(aStructAny, aAny);
@@ -297,8 +297,8 @@ static sal_Bool test_corefl( const Reference< XIdlReflection > & xRefl )
{
Sequence< Any > params(2);
- params.getArray()[0].setValue(&aStructC, ::getCppuType( (const StructC *)0 ));
- params.getArray()[1].setValue(&aStructC, ::getCppuType( (const StructC *)0 ));
+ params.getArray()[0].setValue(&aStructC, cppu::UnoType<StructC>::get());
+ params.getArray()[1].setValue(&aStructC, cppu::UnoType<StructC>::get());
Any a;
a <<= xAI;
@@ -308,8 +308,8 @@ static sal_Bool test_corefl( const Reference< XIdlReflection > & xRefl )
{
Sequence< Any > params(2);
- params.getArray()[0].setValue(&aStructA, ::getCppuType( (const StructA *)0 ));
- params.getArray()[1].setValue(&aStructA, ::getCppuType( (const StructA *)0 ));
+ params.getArray()[0].setValue(&aStructA, cppu::UnoType<StructA>::get());
+ params.getArray()[1].setValue(&aStructA, cppu::UnoType<StructA>::get());
Any a;
a <<= xAI;
@@ -323,13 +323,13 @@ static sal_Bool test_corefl( const Reference< XIdlReflection > & xRefl )
Sequence< Any > params(2);
- params.getArray()[0].setValue(&aStructC, ::getCppuType( (const StructC *)0 ));
- params.getArray()[1].setValue(&aStructA, ::getCppuType( (const StructA *)0 ));
+ params.getArray()[0].setValue(&aStructC, cppu::UnoType<StructC>::get());
+ params.getArray()[1].setValue(&aStructA, cppu::UnoType<StructA>::get());
Any a;
a <<= xAI;
bool result = (xRefl->forName("ModuleC.XInterfaceA")->getMethod(OUString("methodC"))->invoke(a, params).getValueType()
- == ::getCppuType( (const Sequence<StructB> *)0 )); (void)result;
+ == cppu::UnoType<Sequence<StructB>>::get()); (void)result;
OSL_ENSURE(result, "test_RegCoreReflection(): error 68");
return sal_True;
diff --git a/stoc/test/testiadapter.cxx b/stoc/test/testiadapter.cxx
index 097597f927e2..5099f886aa75 100644
--- a/stoc/test/testiadapter.cxx
+++ b/stoc/test/testiadapter.cxx
@@ -406,8 +406,8 @@ Any XLB_Invocation::invoke( const OUString & rFunctionName,
rOutParamIndex[16] = 16;
rOutParam.realloc( 17 );
- rOutParam[0].setValue( &aBool, ::getCppuBooleanType() );
- rOutParam[1].setValue( &aChar, ::getCppuCharType() );
+ rOutParam[0].setValue( &aBool, cppu::UnoType<bool>::get() );
+ rOutParam[1].setValue( &aChar, cppu::UnoType<cppu::UnoCharType>::get() );
rOutParam[2] <<= nByte;
rOutParam[3] <<= nShort;
rOutParam[4] <<= nUShort;
@@ -450,8 +450,8 @@ Any XLB_Invocation::invoke( const OUString & rFunctionName,
rOutParamIndex[16] = 16;
rOutParam.realloc( 17 );
- rOutParam[0].setValue( &aBool, ::getCppuBooleanType() );
- rOutParam[1].setValue( &aChar, ::getCppuCharType() );
+ rOutParam[0].setValue( &aBool, cppu::UnoType<bool>::get() );
+ rOutParam[1].setValue( &aChar, cppu::UnoType<cppu::UnoCharType>::get() );
rOutParam[2] <<= nByte;
rOutParam[3] <<= nShort;
rOutParam[4] <<= nUShort;
@@ -494,8 +494,8 @@ Any XLB_Invocation::invoke( const OUString & rFunctionName,
rOutParamIndex[16] = 16;
rOutParam.realloc( 17 );
- rOutParam[0].setValue( &aBool, ::getCppuBooleanType() );
- rOutParam[1].setValue( &aChar, ::getCppuCharType() );
+ rOutParam[0].setValue( &aBool, cppu::UnoType<bool>::get() );
+ rOutParam[1].setValue( &aChar, cppu::UnoType<cppu::UnoCharType>::get() );
rOutParam[2] <<= nByte;
rOutParam[3] <<= nShort;
rOutParam[4] <<= nUShort;
@@ -588,14 +588,14 @@ Any XLB_Invocation::getValue( const OUString & rName )
if ( rName == "Bool" )
{
sal_Bool aBool = _xLBT->getBool();
- aRet.setValue( &aBool, ::getCppuBooleanType() );
+ aRet.setValue( &aBool, cppu::UnoType<bool>::get() );
}
else if ( rName == "Byte" )
aRet <<= _xLBT->getByte();
else if ( rName == "Char" )
{
sal_Unicode aChar = _xLBT->getChar();
- aRet.setValue( &aChar, ::getCppuCharType() );
+ aRet.setValue( &aChar, cppu::UnoType<cppu::UnoCharType>::get() );
}
else if ( rName == "Short" )
aRet <<= _xLBT->getShort();
@@ -986,7 +986,7 @@ static sal_Bool test_invocation( const Reference< XMultiServiceFactory > & xMgr
xMgr->createInstance("com.sun.star.script.Invocation"), UNO_QUERY );
Reference< XLanguageBindingTest > xOriginal( (XLanguageBindingTest *)new Test_Impl() );
- Any aOriginal( &xOriginal, ::getCppuType( &xOriginal ) );
+ Any aOriginal( &xOriginal, cppu::UnoType<decltype(xOriginal)>::get() );
Reference< XInvocation > xInvok(
xInvocFac->createInstanceWithArguments( Sequence< Any >( &aOriginal, 1 ) ), UNO_QUERY );