summaryrefslogtreecommitdiff
path: root/stoc
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
parent3191d7d1302dbde2445b9f300b3eb853120ede65 (diff)
Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part20
Change-Id: If87cdfb2c605254f6d69baa4ca5aec09091caa68
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/corereflection/crarray.cxx2
-rw-r--r--stoc/source/corereflection/crcomp.cxx4
-rw-r--r--stoc/source/corereflection/crefl.cxx10
-rw-r--r--stoc/source/corereflection/crenum.cxx4
-rw-r--r--stoc/source/corereflection/criface.cxx8
-rw-r--r--stoc/source/invocation/invocation.cxx54
-rw-r--r--stoc/source/invocation_adapterfactory/iafactory.cxx9
-rw-r--r--stoc/source/javaloader/javaloader.cxx2
-rw-r--r--stoc/source/proxy_factory/proxyfac.cxx7
-rw-r--r--stoc/source/security/permissions.cxx16
-rw-r--r--stoc/source/servicemanager/servicemanager.cxx8
-rw-r--r--stoc/source/typeconv/convert.cxx2
-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
16 files changed, 93 insertions, 99 deletions
diff --git a/stoc/source/corereflection/crarray.cxx b/stoc/source/corereflection/crarray.cxx
index 0a3ac3142b17..5bf6622bbf31 100644
--- a/stoc/source/corereflection/crarray.cxx
+++ b/stoc/source/corereflection/crarray.cxx
@@ -60,7 +60,7 @@ Sequence< Type > ArrayIdlClassImpl::getTypes()
if (! s_pTypes)
{
static ::cppu::OTypeCollection s_aTypes(
- ::getCppuType( (const Reference< XIdlArray > *)0 ),
+ cppu::UnoType<XIdlArray>::get(),
IdlClassImpl::getTypes() );
s_pTypes = &s_aTypes;
}
diff --git a/stoc/source/corereflection/crcomp.cxx b/stoc/source/corereflection/crcomp.cxx
index f56e4238f1f8..91442274bde5 100644
--- a/stoc/source/corereflection/crcomp.cxx
+++ b/stoc/source/corereflection/crcomp.cxx
@@ -102,8 +102,8 @@ Sequence< Type > IdlCompFieldImpl::getTypes()
if (! s_pTypes)
{
static ::cppu::OTypeCollection s_aTypes(
- ::getCppuType( (const Reference< XIdlField2 > *)0 ),
- ::getCppuType( (const Reference< XIdlField > *)0 ),
+ cppu::UnoType<XIdlField2>::get(),
+ cppu::UnoType<XIdlField>::get(),
IdlMemberImpl::getTypes() );
s_pTypes = &s_aTypes;
}
diff --git a/stoc/source/corereflection/crefl.cxx b/stoc/source/corereflection/crefl.cxx
index dcf74a4a3f8b..66ad8c703fcf 100644
--- a/stoc/source/corereflection/crefl.cxx
+++ b/stoc/source/corereflection/crefl.cxx
@@ -108,9 +108,9 @@ Sequence< Type > IdlReflectionServiceImpl::getTypes()
if (! s_pTypes)
{
static OTypeCollection s_aTypes(
- ::getCppuType( (const Reference< XIdlReflection > *)0 ),
- ::getCppuType( (const Reference< XHierarchicalNameAccess > *)0 ),
- ::getCppuType( (const Reference< XServiceInfo > *)0 ),
+ cppu::UnoType<XIdlReflection>::get(),
+ cppu::UnoType<XHierarchicalNameAccess>::get(),
+ cppu::UnoType<XServiceInfo>::get(),
OComponentHelper::getTypes() );
s_pTypes = &s_aTypes;
}
@@ -263,7 +263,7 @@ Any IdlReflectionServiceImpl::getByHierarchicalName( const OUString & rName )
{
// type retrieved from tdmgr
OSL_ASSERT( (*(Reference< XInterface > *)aRet.getValue())->queryInterface(
- ::getCppuType( (const Reference< XTypeDescription > *)0 ) ).hasValue() );
+ cppu::UnoType<XTypeDescription>::get()).hasValue() );
css::uno::Reference< css::reflection::XConstantTypeDescription >
ctd;
@@ -288,7 +288,7 @@ Any IdlReflectionServiceImpl::getByHierarchicalName( const OUString & rName )
if (pTD)
{
Reference< XIdlClass > xIdlClass( constructClass( pTD ) );
- aRet.setValue( &xIdlClass, ::getCppuType( (const Reference< XIdlClass > *)0 ) );
+ aRet.setValue( &xIdlClass, cppu::UnoType<XIdlClass>::get());
typelib_typedescription_release( pTD );
}
}
diff --git a/stoc/source/corereflection/crenum.cxx b/stoc/source/corereflection/crenum.cxx
index 9a9e86f8530c..d55893cdc3e9 100644
--- a/stoc/source/corereflection/crenum.cxx
+++ b/stoc/source/corereflection/crenum.cxx
@@ -100,8 +100,8 @@ Sequence< Type > IdlEnumFieldImpl::getTypes()
if (! s_pTypes)
{
static ::cppu::OTypeCollection s_aTypes(
- ::getCppuType( (const Reference< XIdlField2 > *)0 ),
- ::getCppuType( (const Reference< XIdlField > *)0 ),
+ cppu::UnoType<XIdlField2>::get(),
+ cppu::UnoType<XIdlField>::get(),
IdlMemberImpl::getTypes() );
s_pTypes = &s_aTypes;
}
diff --git a/stoc/source/corereflection/criface.cxx b/stoc/source/corereflection/criface.cxx
index d4f5ef03ce9a..b23fc2738fcf 100644
--- a/stoc/source/corereflection/criface.cxx
+++ b/stoc/source/corereflection/criface.cxx
@@ -114,8 +114,8 @@ Sequence< Type > IdlAttributeFieldImpl::getTypes()
if (! s_pTypes)
{
static ::cppu::OTypeCollection s_aTypes(
- ::getCppuType( (const Reference< XIdlField2 > *)0 ),
- ::getCppuType( (const Reference< XIdlField > *)0 ),
+ cppu::UnoType<XIdlField2>::get(),
+ cppu::UnoType<XIdlField>::get(),
IdlMemberImpl::getTypes() );
s_pTypes = &s_aTypes;
}
@@ -409,7 +409,7 @@ Sequence< Type > IdlInterfaceMethodImpl::getTypes()
if (! s_pTypes)
{
static ::cppu::OTypeCollection s_aTypes(
- ::getCppuType( (const Reference< XIdlMethod > *)0 ),
+ cppu::UnoType<XIdlMethod>::get(),
IdlMemberImpl::getTypes() );
s_pTypes = &s_aTypes;
}
@@ -725,7 +725,7 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > &
&aExc.TargetException,
reinterpret_cast< uno_ReleaseFunc >(cpp_release) );
uno_type_copyAndConvertData(
- &aExc.TargetException, pUnoExc, ::getCppuType( (const Any *)0 ).getTypeLibType(),
+ &aExc.TargetException, pUnoExc, cppu::UnoType<Any>::get().getTypeLibType(),
getReflection()->getUno2Cpp().get() );
uno_any_destruct( pUnoExc, 0 );
throw aExc;
diff --git a/stoc/source/invocation/invocation.cxx b/stoc/source/invocation/invocation.cxx
index 7d65f7df7269..8f0a543b7817 100644
--- a/stoc/source/invocation/invocation.cxx
+++ b/stoc/source/invocation/invocation.cxx
@@ -270,7 +270,7 @@ Any SAL_CALL Invocation_Impl::queryInterface( const Type & aType )
return a;
}
- if( aType == getCppuType( (Reference<XExactName>*) NULL ) )
+ if( aType == cppu::UnoType<XExactName>::get())
{
// Ivocation does not support XExactName, if direct object supports
// XInvocation, but not XExactName.
@@ -280,32 +280,32 @@ Any SAL_CALL Invocation_Impl::queryInterface( const Type & aType )
return makeAny( Reference< XExactName >( (static_cast< XExactName* >(this)) ) );
}
}
- else if ( aType == getCppuType( (Reference<XNameContainer>*) NULL ) )
+ else if ( aType == cppu::UnoType<XNameContainer>::get())
{
if( _xNameContainer.is() )
return makeAny( Reference< XNameContainer >( (static_cast< XNameContainer* >(this)) ) );
}
- else if ( aType == getCppuType( (Reference<XNameAccess>*) NULL ) )
+ else if ( aType == cppu::UnoType<XNameAccess>::get())
{
if( _xNameAccess.is() )
return makeAny( Reference< XNameAccess >( (static_cast< XNameAccess* >(this)) ) );
}
- else if ( aType == getCppuType( (Reference<XIndexContainer>*) NULL ) )
+ else if ( aType == cppu::UnoType<XIndexContainer>::get())
{
if (_xIndexContainer.is())
return makeAny( Reference< XIndexContainer >( (static_cast< XIndexContainer* >(this)) ) );
}
- else if ( aType == getCppuType( (Reference<XIndexAccess>*) NULL ) )
+ else if ( aType == cppu::UnoType<XIndexAccess>::get())
{
if (_xIndexAccess.is())
return makeAny( Reference< XIndexAccess >( (static_cast< XIndexAccess* >(this)) ) );
}
- else if ( aType == getCppuType( (Reference<XEnumerationAccess>*) NULL ) )
+ else if ( aType == cppu::UnoType<XEnumerationAccess>::get())
{
if (_xEnumerationAccess.is())
return makeAny( Reference< XEnumerationAccess >( (static_cast< XEnumerationAccess* >(this)) ) );
}
- else if ( aType == getCppuType( (Reference<XElementAccess>*) NULL ) )
+ else if ( aType == cppu::UnoType<XElementAccess>::get())
{
if (_xElementAccess.is())
{
@@ -313,7 +313,7 @@ Any SAL_CALL Invocation_Impl::queryInterface( const Type & aType )
(static_cast< XElementAccess* >((static_cast< XNameContainer* >(this))) ) ) );
}
}
- else if ( aType == getCppuType( (Reference<XInvocation2>*) NULL ) )
+ else if ( aType == cppu::UnoType<XInvocation2>::get())
{
// Invocation does not support XInvocation2, if direct object supports
// XInvocation, but not XInvocation2.
@@ -392,31 +392,31 @@ void Invocation_Impl::setMaterial( const Any& rMaterial )
_xElementAccess = Reference<XElementAccess>::query(
_xIntrospectionAccess->queryAdapter(
- getCppuType( (Reference<XElementAccess>*) NULL ) ) );
+ cppu::UnoType<XElementAccess>::get()) );
_xEnumerationAccess = Reference<XEnumerationAccess>::query(
_xIntrospectionAccess->queryAdapter(
- getCppuType( (Reference<XEnumerationAccess>*) NULL )) );
+ cppu::UnoType<XEnumerationAccess>::get()) );
_xIndexAccess = Reference<XIndexAccess>::query(
_xIntrospectionAccess->queryAdapter(
- getCppuType( (Reference<XIndexAccess>*) NULL ) ) );
+ cppu::UnoType<XIndexAccess>::get()) );
_xIndexContainer = Reference<XIndexContainer>::query(
_xIntrospectionAccess->queryAdapter(
- getCppuType( (Reference<XIndexContainer>*) NULL ) ) );
+ cppu::UnoType<XIndexContainer>::get()) );
_xNameAccess = Reference<XNameAccess>::query(
_xIntrospectionAccess->queryAdapter(
- getCppuType( (Reference<XNameAccess>*) NULL ) ) );
+ cppu::UnoType<XNameAccess>::get()) );
_xNameContainer = Reference<XNameContainer>::query(
_xIntrospectionAccess->queryAdapter(
- getCppuType( (Reference<XNameContainer>*) NULL ) ) );
+ cppu::UnoType<XNameContainer>::get()) );
_xPropertySet = Reference<XPropertySet>::query(
_xIntrospectionAccess->queryAdapter(
- getCppuType( (Reference<XPropertySet>*) NULL )) );
+ cppu::UnoType<XPropertySet>::get()) );
_xENIntrospection = Reference<XExactName>::query( _xIntrospectionAccess );
if (_xNameAccess.is())
@@ -983,48 +983,48 @@ Sequence< Type > SAL_CALL Invocation_Impl::getTypes(void) throw( RuntimeExceptio
Type * pTypes = types.getArray();
sal_Int32 n = 0;
- pTypes[ n++ ] = ::getCppuType( (Reference< XTypeProvider > const *)0 );
- pTypes[ n++ ] = ::getCppuType( (Reference< XWeak > const *)0 );
- pTypes[ n++ ] = ::getCppuType( (Reference< XInvocation > const *)0 );
- pTypes[ n++ ] = ::getCppuType( (Reference< XMaterialHolder > const *)0 );
+ pTypes[ n++ ] = cppu::UnoType<XTypeProvider>::get();
+ pTypes[ n++ ] = cppu::UnoType<XWeak>::get();
+ pTypes[ n++ ] = cppu::UnoType<XInvocation>::get();
+ pTypes[ n++ ] = cppu::UnoType<XMaterialHolder>::get();
// Ivocation does not support XExactName, if direct object supports
// XInvocation, but not XExactName.
if ((_xDirect.is() && _xENDirect.is()) ||
(!_xDirect.is() && (_xENIntrospection.is() || _xENNameAccess.is())))
{
- pTypes[ n++ ] = ::getCppuType( (Reference< XExactName > const *)0 );
+ pTypes[ n++ ] = cppu::UnoType<XExactName>::get();
}
if( _xNameContainer.is() )
{
- pTypes[ n++ ] = ::getCppuType( (Reference< XNameContainer > const *)0 );
+ pTypes[ n++ ] = cppu::UnoType<XNameContainer>::get();
}
if( _xNameAccess.is() )
{
- pTypes[ n++ ] = ::getCppuType( (Reference< XNameAccess > const *)0 );
+ pTypes[ n++ ] = cppu::UnoType<XNameAccess>::get();
}
if (_xIndexContainer.is())
{
- pTypes[ n++ ] = ::getCppuType( (Reference< XIndexContainer > const *)0 );
+ pTypes[ n++ ] = cppu::UnoType<XIndexContainer>::get();
}
if (_xIndexAccess.is())
{
- pTypes[ n++ ] = ::getCppuType( (Reference< XIndexAccess > const *)0 );
+ pTypes[ n++ ] = cppu::UnoType<XIndexAccess>::get();
}
if (_xEnumerationAccess.is())
{
- pTypes[ n++ ] = ::getCppuType( (Reference< XEnumerationAccess > const *)0 );
+ pTypes[ n++ ] = cppu::UnoType<XEnumerationAccess>::get();
}
if (_xElementAccess.is())
{
- pTypes[ n++ ] = ::getCppuType( (Reference< XElementAccess > const *)0 );
+ pTypes[ n++ ] = cppu::UnoType<XElementAccess>::get();
}
// Invocation does not support XInvocation2, if direct object supports
// XInvocation, but not XInvocation2.
if ( ( _xDirect.is() && _xDirect2.is()) ||
(!_xDirect.is() && _xIntrospectionAccess.is() ) )
{
- pTypes[ n++ ] = ::getCppuType( (Reference< XInvocation2 > const *)0 );
+ pTypes[ n++ ] = cppu::UnoType<XInvocation2>::get();
}
types.realloc( n );
diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx b/stoc/source/invocation_adapterfactory/iafactory.cxx
index 216ee96b8562..3c0951f0af21 100644
--- a/stoc/source/invocation_adapterfactory/iafactory.cxx
+++ b/stoc/source/invocation_adapterfactory/iafactory.cxx
@@ -276,9 +276,7 @@ bool AdapterImpl::coerce_assign(
{
OSL_ASSERT(
p_exc->pType->eTypeClass == typelib_TypeClass_EXCEPTION );
- if (typelib_typedescriptionreference_isAssignableFrom(
- ::getCppuType(
- (RuntimeException const *) 0 ).getTypeLibType(),
+ if (typelib_typedescriptionreference_isAssignableFrom( cppu::UnoType<RuntimeException>::get() ).getTypeLibType(),
p_exc->pType ))
{
// is RuntimeException or derived: rethrow
@@ -731,8 +729,7 @@ FactoryImpl::FactoryImpl( Reference< XComponentContext > const & xContext )
rShortSeqType.getDescription( &m_pShortSeqTD );
// script.XInvocation
typelib_TypeDescription * pTD = 0;
- const Type & rInvType = ::getCppuType(
- (const Reference< script::XInvocation > *)0 );
+ const Type & rInvType = cppu::UnoType<script::XInvocation>::get();
TYPELIB_DANGER_GET( &pTD, rInvType.getTypeLibType() );
typelib_InterfaceTypeDescription * pITD;
pITD = reinterpret_cast<typelib_InterfaceTypeDescription*>(pTD);
@@ -746,7 +743,7 @@ FactoryImpl::FactoryImpl( Reference< XComponentContext > const & xContext )
&m_pGetValueTD, pITD->ppMembers[ 3 ] ); // getValue()
// script.XTypeConverter
const Type & rTCType =
- ::getCppuType( (const Reference< script::XTypeConverter > *)0 );
+ cppu::UnoType<script::XTypeConverter>::get();
TYPELIB_DANGER_GET( &pTD, rTCType.getTypeLibType() );
pITD = reinterpret_cast<typelib_InterfaceTypeDescription*>(pTD);
::typelib_typedescriptionreference_getDescription(
diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx
index c985dbbe7948..3b33627f6fca 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -242,7 +242,7 @@ const css::uno::Reference<XImplementationLoader> & JavaComponentLoader::getJavaL
pUno_environment->release(pUno_environment);
pUno_environment = NULL;
- getCppuType((css::uno::Reference<XImplementationLoader> *) 0).
+ cppu::UnoType<XImplementationLoader>::get().
getDescription((typelib_TypeDescription **) & pType_XImplementationLoader);
if(!pType_XImplementationLoader)
throw RuntimeException(
diff --git a/stoc/source/proxy_factory/proxyfac.cxx b/stoc/source/proxy_factory/proxyfac.cxx
index 0ddc2a00391d..14f0df8d0c4f 100644
--- a/stoc/source/proxy_factory/proxyfac.cxx
+++ b/stoc/source/proxy_factory/proxyfac.cxx
@@ -106,8 +106,7 @@ UnoInterfaceReference FactoryImpl::binuno_queryInterface(
typelib_TypeDescription * pTXInterfaceDescr = 0;
TYPELIB_DANGER_GET(
&pTXInterfaceDescr,
- ::getCppuType( reinterpret_cast< Reference< XInterface >
- const * >(0) ).getTypeLibType() );
+ cppu::UnoType<XInterface>::get().getTypeLibType() );
typelib_TypeDescription * pQITD = 0;
typelib_typedescriptionreference_getDescription(
&pQITD, reinterpret_cast< typelib_InterfaceTypeDescription * >(
@@ -149,9 +148,7 @@ UnoInterfaceReference FactoryImpl::binuno_queryInterface(
{
// exception occurred:
OSL_ENSURE(
- typelib_typedescriptionreference_isAssignableFrom(
- ::getCppuType( reinterpret_cast<
- RuntimeException const * >(0) ).getTypeLibType(),
+ typelib_typedescriptionreference_isAssignableFrom( cppu::UnoType<RuntimeException>::get() ).getTypeLibType(),
exc->pType ),
"### RuntimeException expected!" );
Any cpp_exc;
diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx
index d39bb2283b3c..7b9994319b51 100644
--- a/stoc/source/security/permissions.cxx
+++ b/stoc/source/security/permissions.cxx
@@ -495,22 +495,22 @@ PermissionCollection::PermissionCollection(
Type const & perm_type = perm.getValueType();
// supported permission types
- if (perm_type.equals( ::getCppuType( (io::FilePermission const *)0 ) ))
+ if (perm_type.equals( cppu::UnoType<io::FilePermission>::get()))
{
m_head = new FilePermission(
*reinterpret_cast< io::FilePermission const * >( perm.pData ), m_head );
}
- else if (perm_type.equals( ::getCppuType( (connection::SocketPermission const *)0 ) ))
+ else if (perm_type.equals( cppu::UnoType<connection::SocketPermission>::get()))
{
m_head = new SocketPermission(
*reinterpret_cast< connection::SocketPermission const * >( perm.pData ), m_head );
}
- else if (perm_type.equals( ::getCppuType( (security::RuntimePermission const *)0 ) ))
+ else if (perm_type.equals( cppu::UnoType<security::RuntimePermission>::get()))
{
m_head = new RuntimePermission(
*reinterpret_cast< security::RuntimePermission const * >( perm.pData ), m_head );
}
- else if (perm_type.equals( ::getCppuType( (security::AllPermission const *)0 ) ))
+ else if (perm_type.equals( cppu::UnoType<security::AllPermission>::get()))
{
m_head = new AllPermission( m_head );
}
@@ -584,7 +584,7 @@ void PermissionCollection::checkPermission( Any const & perm ) const
// supported permission types
// stack object of SimpleReferenceObject are ok, as long as they are not
// assigned to a ::rtl::Reference<> (=> delete this)
- if (demanded_type.equals( ::getCppuType( (io::FilePermission const *)0 ) ))
+ if (demanded_type.equals( cppu::UnoType<io::FilePermission>::get()))
{
FilePermission demanded(
*reinterpret_cast< io::FilePermission const * >( perm.pData ) );
@@ -597,7 +597,7 @@ void PermissionCollection::checkPermission( Any const & perm ) const
}
throwAccessControlException( demanded, perm );
}
- else if (demanded_type.equals( ::getCppuType( (connection::SocketPermission const *)0 ) ))
+ else if (demanded_type.equals( cppu::UnoType<connection::SocketPermission>::get()))
{
SocketPermission demanded(
*reinterpret_cast< connection::SocketPermission const * >( perm.pData ) );
@@ -610,7 +610,7 @@ void PermissionCollection::checkPermission( Any const & perm ) const
}
throwAccessControlException( demanded, perm );
}
- else if (demanded_type.equals( ::getCppuType( (security::RuntimePermission const *)0 ) ))
+ else if (demanded_type.equals( cppu::UnoType<security::RuntimePermission>::get()))
{
RuntimePermission demanded(
*reinterpret_cast< security::RuntimePermission const * >( perm.pData ) );
@@ -623,7 +623,7 @@ void PermissionCollection::checkPermission( Any const & perm ) const
}
throwAccessControlException( demanded, perm );
}
- else if (demanded_type.equals( ::getCppuType( (security::AllPermission const *)0 ) ))
+ else if (demanded_type.equals( cppu::UnoType<security::AllPermission>::get()))
{
AllPermission demanded;
if (__implies( m_head, demanded ))
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx
index 80746280e0b2..a3aaee6f7eaf 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -185,7 +185,7 @@ Any ServiceEnumeration_Impl::nextElement()
if( nIt == aFactories.getLength() )
throw NoSuchElementException();
- return Any( &aFactories.getConstArray()[nIt++], ::getCppuType( (const Reference<XInterface > *)0 ) );
+ return Any( &aFactories.getConstArray()[nIt++], cppu::UnoType<XInterface>::get());
}
@@ -282,7 +282,7 @@ Any ImplementationEnumeration_Impl::nextElement()
if( aIt == aImplementationMap.end() )
throw NoSuchElementException();
- Any ret( &(*aIt), ::getCppuType( (const Reference<XInterface > *)0 ) );
+ Any ret( &(*aIt), cppu::UnoType<XInterface>::get());
++aIt;
return ret;
}
@@ -350,7 +350,7 @@ void OServiceManager_Listener::disposing(const EventObject & rEvt )
{
try
{
- x->remove( Any( &rEvt.Source, ::getCppuType( (const Reference<XInterface > *)0 ) ) );
+ x->remove( Any( &rEvt.Source, cppu::UnoType<XInterface>::get()) );
}
catch( const IllegalArgumentException & )
{
@@ -1144,7 +1144,7 @@ Type OServiceManager::getElementType()
throw(css::uno::RuntimeException, std::exception)
{
check_undisposed();
- return ::getCppuType( (const Reference< XInterface > *)0 );
+ return cppu::UnoType<XInterface>::get();
}
// XElementAccess
diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx
index 5cd31abab9cb..b11260fd856d 100644
--- a/stoc/source/typeconv/convert.cxx
+++ b/stoc/source/typeconv/convert.cxx
@@ -847,7 +847,7 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina
{
aRet.setValue(
&((typelib_EnumTypeDescription *)aEnumTD.get())->ppEnumNames[nPos],
- ::getCppuType( (const OUString *)0 ) );
+ cppu::UnoType<OUString>::get());
}
else
{
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 );