summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-05 09:30:03 +0200
committerNoel Grandin <noel@peralex.com>2015-11-05 09:59:30 +0200
commit3fdbf5935e0aff6350e861e868c7e0a12dd1bc8f (patch)
treec2d5a74b8aa8d51a7a3906e390ce77f7fce6ead1 /stoc
parent1c3d3ffa81d1a451b5a694cff022df3c5c94ba8e (diff)
use uno::Reference::set method instead of assignment
Change-Id: I6cb508e392d5e194c80fc6d0927c86414e4ab05b
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/implementationregistration/implreg.cxx2
-rw-r--r--stoc/source/inspect/introspection.cxx38
-rw-r--r--stoc/source/invocation/invocation.cxx69
-rw-r--r--stoc/source/javaloader/javaloader.cxx3
-rw-r--r--stoc/source/javavm/javavm.cxx12
-rw-r--r--stoc/source/uriproc/UriReferenceFactory.cxx3
-rw-r--r--stoc/test/javavm/jvm_interaction/interactionhandler.cxx4
-rw-r--r--stoc/test/registry_tdprovider/testregistrytdprovider.cxx93
-rw-r--r--stoc/test/testcorefl.cxx5
-rw-r--r--stoc/test/testintrosp.cxx3
-rw-r--r--stoc/test/testsmgr_cpnt.cxx2
11 files changed, 104 insertions, 130 deletions
diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx
index 671fffaaa0f8..dc1a17a0da70 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -1553,7 +1553,7 @@ sal_Bool ImplementationRegistration::revokeImplementation(const OUString& locati
xRegistry = xReg;
}
else {
- Reference < XPropertySet > xPropSet = Reference< XPropertySet >::query( m_xSMgr );
+ Reference < XPropertySet > xPropSet( m_xSMgr, UNO_QUERY );
if( xPropSet.is() ) {
try {
Any aAny = xPropSet->getPropertyValue( spool().Registry );
diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx
index 175354c50f57..aedda924a1f9 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -886,7 +886,7 @@ Reference<XElementAccess> ImplIntrospectionAccess::getXElementAccess()
if( !mxObjElementAccess.is() )
{
aGuard.clear();
- Reference<XElementAccess> xElementAccess = Reference<XElementAccess>::query( mxIface );
+ Reference<XElementAccess> xElementAccess( mxIface, UNO_QUERY );
aGuard.reset();
if( !mxObjElementAccess.is() )
mxObjElementAccess = xElementAccess;
@@ -901,18 +901,18 @@ void ImplIntrospectionAccess::cacheXNameContainer()
Reference<XNameAccess> xNameAccess;
if (mpStaticImpl->mbNameContainer)
{
- xNameContainer = Reference<XNameContainer>::query( mxIface );
- xNameReplace = Reference<XNameReplace>::query( xNameContainer );
- xNameAccess = Reference<XNameAccess>::query( xNameContainer );
+ xNameContainer.set( mxIface, UNO_QUERY );
+ xNameReplace.set( xNameContainer, UNO_QUERY );
+ xNameAccess.set( xNameContainer, UNO_QUERY );
}
else if (mpStaticImpl->mbNameReplace)
{
- xNameReplace = Reference<XNameReplace>::query( mxIface );
- xNameAccess = Reference<XNameAccess>::query( xNameReplace );
+ xNameReplace.set( mxIface, UNO_QUERY );
+ xNameAccess.set( xNameReplace, UNO_QUERY );
}
else if (mpStaticImpl->mbNameAccess)
{
- xNameAccess = Reference<XNameAccess>::query( mxIface );
+ xNameAccess.set( mxIface, UNO_QUERY );
}
{
@@ -969,18 +969,18 @@ void ImplIntrospectionAccess::cacheXIndexContainer()
Reference<XIndexAccess> xIndexAccess;
if (mpStaticImpl->mbIndexContainer)
{
- xIndexContainer = Reference<XIndexContainer>::query( mxIface );
- xIndexReplace = Reference<XIndexReplace>::query( xIndexContainer );
- xIndexAccess = Reference<XIndexAccess>::query( xIndexContainer );
+ xIndexContainer.set( mxIface, UNO_QUERY );
+ xIndexReplace.set( xIndexContainer, UNO_QUERY );
+ xIndexAccess.set( xIndexContainer, UNO_QUERY );
}
else if (mpStaticImpl->mbIndexReplace)
{
- xIndexReplace = Reference<XIndexReplace>::query( mxIface );
- xIndexAccess = Reference<XIndexAccess>::query( xIndexReplace );
+ xIndexReplace.set( mxIface, UNO_QUERY );
+ xIndexAccess.set( xIndexReplace, UNO_QUERY );
}
else if (mpStaticImpl->mbIndexAccess)
{
- xIndexAccess = Reference<XIndexAccess>::query( mxIface );
+ xIndexAccess.set( mxIface, UNO_QUERY );
}
{
@@ -1037,7 +1037,7 @@ Reference<XEnumerationAccess> ImplIntrospectionAccess::getXEnumerationAccess()
if( !mxObjEnumerationAccess.is() )
{
aGuard.clear();
- Reference<XEnumerationAccess> xEnumerationAccess = Reference<XEnumerationAccess>::query( mxIface );
+ Reference<XEnumerationAccess> xEnumerationAccess( mxIface, UNO_QUERY );
aGuard.reset();
if( !mxObjEnumerationAccess.is() )
mxObjEnumerationAccess = xEnumerationAccess;
@@ -1052,7 +1052,7 @@ Reference<XIdlArray> ImplIntrospectionAccess::getXIdlArray()
if( !mxObjIdlArray.is() )
{
aGuard.clear();
- Reference<XIdlArray> xIdlArray = Reference<XIdlArray>::query( mxIface );
+ Reference<XIdlArray> xIdlArray( mxIface, UNO_QUERY );
aGuard.reset();
if( !mxObjIdlArray.is() )
mxObjIdlArray = xIdlArray;
@@ -1763,7 +1763,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
// Look for interfaces XTypeProvider and PropertySet
if( eType == TypeClass_INTERFACE )
{
- xTypeProvider = Reference<XTypeProvider>::query( x );
+ xTypeProvider.set( x, UNO_QUERY );
if( xTypeProvider.is() )
{
SupportedTypesSeq = xTypeProvider->getTypes();
@@ -1775,7 +1775,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
{
if( pTypes[i].getTypeName() == "com.sun.star.beans.XPropertySet" )
{
- xPropSet = Reference<XPropertySet>::query( x );
+ xPropSet.set( x, UNO_QUERY );
break;
}
}
@@ -1786,7 +1786,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
"object of type \"" << aToInspectObj.getValueTypeName()
<< "\" lacks XTypeProvider");
SupportedTypesSeq = Sequence<Type>(&aToInspectObj.getValueType(), 1);
- xPropSet = Reference<XPropertySet>::query( x );
+ xPropSet.set( x, UNO_QUERY );
}
// Now try to get the PropertySetInfo
@@ -1856,7 +1856,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
if( xPropSet.is() && xPropSetInfo.is() )
{
// Is there also a FastPropertySet?
- Reference<XFastPropertySet> xDummy = Reference<XFastPropertySet>::query( x );
+ Reference<XFastPropertySet> xDummy( x, UNO_QUERY );
bool bFast = pAccess->mbFastPropSet = xDummy.is();
Sequence<Property> aPropSeq = xPropSetInfo->getProperties();
diff --git a/stoc/source/invocation/invocation.cxx b/stoc/source/invocation/invocation.cxx
index 42657baa9f5c..494fa4037b92 100644
--- a/stoc/source/invocation/invocation.cxx
+++ b/stoc/source/invocation/invocation.cxx
@@ -351,12 +351,12 @@ Any Invocation_Impl::getMaterial() throw(RuntimeException, std::exception)
Reference<XMaterialHolder> xMaterialHolder;
if( _xDirect.is() )
{
- xMaterialHolder = Reference<XMaterialHolder>::query( _xDirect );
+ xMaterialHolder.set( _xDirect, UNO_QUERY );
//_xDirect->queryInterface( XMaterialHolder::getSmartUik(), xMaterialHolder );
}
else if( _xIntrospectionAccess.is() )
{
- xMaterialHolder = Reference<XMaterialHolder>::query( _xIntrospectionAccess );
+ xMaterialHolder.set( _xIntrospectionAccess, UNO_QUERY );
//_xIntrospectionAccess->queryInterface( XMaterialHolder::getSmartUik(), xMaterialHolder );
}
if( xMaterialHolder.is() )
@@ -377,21 +377,21 @@ void Invocation_Impl::setMaterial( const Any& rMaterial )
_aMaterial = rMaterial;
// First do this outside the guard
- _xDirect = Reference<XInvocation>::query( xObj );
+ _xDirect.set( xObj, UNO_QUERY );
if( _xDirect.is() )
{
// Consult object directly
- _xElementAccess = Reference<XElementAccess>::query( _xDirect );
- _xEnumerationAccess = Reference<XEnumerationAccess>::query( _xDirect );
- _xIndexAccess = Reference<XIndexAccess>::query( _xDirect );
- _xIndexReplace = Reference<XIndexReplace>::query( _xDirect );
- _xIndexContainer = Reference<XIndexContainer>::query( _xDirect );
- _xNameAccess = Reference<XNameAccess>::query( _xDirect );
- _xNameReplace = Reference<XNameReplace>::query( _xDirect );
- _xNameContainer = Reference<XNameContainer>::query( _xDirect );
- _xENDirect = Reference<XExactName>::query( _xDirect );
- _xDirect2 = Reference<XInvocation2>::query( _xDirect );
+ _xElementAccess.set( _xDirect, UNO_QUERY );
+ _xEnumerationAccess.set( _xDirect, UNO_QUERY );
+ _xIndexAccess.set( _xDirect, UNO_QUERY );
+ _xIndexReplace.set( _xDirect, UNO_QUERY );
+ _xIndexContainer.set( _xDirect, UNO_QUERY );
+ _xNameAccess.set( _xDirect, UNO_QUERY );
+ _xNameReplace.set( _xDirect, UNO_QUERY );
+ _xNameContainer.set( _xDirect, UNO_QUERY );
+ _xENDirect.set( _xDirect, UNO_QUERY );
+ _xDirect2.set( _xDirect, UNO_QUERY );
// only once!!!
//_xIntrospectionAccess = XIntrospectionAccessRef();
@@ -405,52 +405,51 @@ void Invocation_Impl::setMaterial( const Any& rMaterial )
_xIntrospectionAccess = xIntrospection->inspect( _aMaterial );
if( _xIntrospectionAccess.is() )
{
- _xElementAccess = Reference<XElementAccess>::query(
+ _xElementAccess.set(
_xIntrospectionAccess->queryAdapter(
- cppu::UnoType<XElementAccess>::get()) );
+ cppu::UnoType<XElementAccess>::get()), UNO_QUERY );
if( _xElementAccess.is() )
{
- _xEnumerationAccess = Reference<XEnumerationAccess>::query(
+ _xEnumerationAccess.set(
_xIntrospectionAccess->queryAdapter(
- cppu::UnoType<XEnumerationAccess>::get()) );
+ cppu::UnoType<XEnumerationAccess>::get()), UNO_QUERY );
- _xIndexAccess = Reference<XIndexAccess>::query(
+ _xIndexAccess.set(
_xIntrospectionAccess->queryAdapter(
- cppu::UnoType<XIndexAccess>::get()) );
+ cppu::UnoType<XIndexAccess>::get()), UNO_QUERY );
if( _xIndexAccess.is() )
{
- _xIndexReplace = Reference<XIndexReplace>::query(
+ _xIndexReplace.set(
_xIntrospectionAccess->queryAdapter(
- cppu::UnoType<XIndexReplace>::get()) );
+ cppu::UnoType<XIndexReplace>::get()), UNO_QUERY );
- _xIndexContainer = Reference<XIndexContainer>::query(
+ _xIndexContainer.set(
_xIntrospectionAccess->queryAdapter(
- cppu::UnoType<XIndexContainer>::get()) );
+ cppu::UnoType<XIndexContainer>::get()), UNO_QUERY );
}
- _xNameAccess = Reference<XNameAccess>::query(
+ _xNameAccess.set(
_xIntrospectionAccess->queryAdapter(
- cppu::UnoType<XNameAccess>::get()) );
+ cppu::UnoType<XNameAccess>::get()), UNO_QUERY );
if( _xNameAccess.is() )
{
- _xNameReplace = Reference<XNameReplace>::query(
+ _xNameReplace.set(
_xIntrospectionAccess->queryAdapter(
- cppu::UnoType<XNameReplace>::get()) );
+ cppu::UnoType<XNameReplace>::get()), UNO_QUERY );
- _xNameContainer = Reference<XNameContainer>::query(
+ _xNameContainer.set(
_xIntrospectionAccess->queryAdapter(
- cppu::UnoType<XNameContainer>::get()) );
+ cppu::UnoType<XNameContainer>::get()), UNO_QUERY );
}
}
- _xPropertySet = Reference<XPropertySet>::query(
- _xIntrospectionAccess->queryAdapter(
- cppu::UnoType<XPropertySet>::get()) );
+ _xPropertySet.set( _xIntrospectionAccess->queryAdapter( cppu::UnoType<XPropertySet>::get()),
+ UNO_QUERY );
- _xENIntrospection = Reference<XExactName>::query( _xIntrospectionAccess );
+ _xENIntrospection.set( _xIntrospectionAccess, UNO_QUERY );
}
}
/* only once !!!
@@ -1114,7 +1113,7 @@ InvocationService::InvocationService( const Reference<XComponentContext> & xCtx
, mxSMgr( xCtx->getServiceManager() )
, xCoreReflection( css::reflection::theCoreReflection::get(mxCtx) )
{
- xTypeConverter = Reference<XTypeConverter>(
+ xTypeConverter.set(
mxSMgr->createInstanceWithContext( "com.sun.star.script.Converter", xCtx ),
UNO_QUERY );
xIntrospection = theIntrospection::get(xCtx);
@@ -1169,7 +1168,7 @@ Reference<XInterface> InvocationService::createInstanceWithArguments(
Reference<XInterface> SAL_CALL InvocationService_CreateInstance( const Reference<XComponentContext> & xCtx )
throw( RuntimeException )
{
- Reference<XInterface> xService = Reference< XInterface > ( *new InvocationService( xCtx ) );
+ Reference<XInterface> xService( *new InvocationService( xCtx ) );
return xService;
}
diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx
index 684d96761db3..a602619607fa 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -247,8 +247,7 @@ const css::uno::Reference<XImplementationLoader> & JavaComponentLoader::getJavaL
throw RuntimeException(
"javaloader error - no type information for XImplementationLoader");
- m_javaLoader = css::uno::Reference<XImplementationLoader>(static_cast<XImplementationLoader *>(
- java_curr.mapInterface(joJavaLoader, pType_XImplementationLoader)));
+ m_javaLoader.set(static_cast<XImplementationLoader *>(java_curr.mapInterface(joJavaLoader, pType_XImplementationLoader)));
pJNIEnv->DeleteLocalRef( joJavaLoader );
if(!m_javaLoader.is())
throw RuntimeException(
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 9d1571186a47..0bcad2c3ac2e 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -152,8 +152,7 @@ css::uno::Reference< css::uno::XInterface > SingletonFactory::getSingleton(
{
if (m_bDisposed)
throw css::lang::DisposedException();
- xComponent = css::uno::Reference< css::lang::XComponent >(
- rContext, css::uno::UNO_QUERY_THROW);
+ xComponent.set( rContext, css::uno::UNO_QUERY_THROW);
m_xSingleton = static_cast< cppu::OWeakObject * >(
new JavaVirtualMachine(rContext));
}
@@ -183,8 +182,7 @@ void SingletonFactory::dispose()
css::uno::Reference< css::lang::XComponent > xComponent;
{
osl::MutexGuard aGuard(m_aMutex);
- xComponent = css::uno::Reference< css::lang::XComponent >(
- m_xSingleton, css::uno::UNO_QUERY);
+ xComponent.set( m_xSingleton, css::uno::UNO_QUERY);
m_xSingleton.clear();
m_bDisposed = true;
}
@@ -1349,8 +1347,7 @@ void JavaVirtualMachine::registerConfigChangesListener()
css::uno::makeAny( (sal_Int32)-1),
css::beans::PropertyState_DIRECT_VALUE);
- m_xInetConfiguration
- = css::uno::Reference< css::container::XContainer >(
+ m_xInetConfiguration.set(
xConfigProvider->createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationAccess",
aArguments),
@@ -1373,8 +1370,7 @@ void JavaVirtualMachine::registerConfigChangesListener()
css::uno::makeAny( (sal_Int32)-1),
css::beans::PropertyState_DIRECT_VALUE);
- m_xJavaConfiguration
- = css::uno::Reference< css::container::XContainer >(
+ m_xJavaConfiguration.set(
xConfigProvider->createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationAccess",
aArguments2),
diff --git a/stoc/source/uriproc/UriReferenceFactory.cxx b/stoc/source/uriproc/UriReferenceFactory.cxx
index 16ffe39ed597..021a80651e58 100644
--- a/stoc/source/uriproc/UriReferenceFactory.cxx
+++ b/stoc/source/uriproc/UriReferenceFactory.cxx
@@ -381,8 +381,7 @@ css::uno::Reference< css::uri::XUriReference > Factory::parse(
css::uno::makeAny(e)); //TODO: preserve type of e
}
if (service.is()) {
- parser = css::uno::Reference< css::uri::XUriSchemeParser >(
- service, css::uno::UNO_QUERY_THROW);
+ parser.set( service, css::uno::UNO_QUERY_THROW);
}
}
}
diff --git a/stoc/test/javavm/jvm_interaction/interactionhandler.cxx b/stoc/test/javavm/jvm_interaction/interactionhandler.cxx
index 39a6305c5829..b8dd3819cc52 100644
--- a/stoc/test/javavm/jvm_interaction/interactionhandler.cxx
+++ b/stoc/test/javavm/jvm_interaction/interactionhandler.cxx
@@ -94,13 +94,13 @@ void SAL_CALL InteractionHandler::handle( const Reference< XInteractionRequest >
for (sal_Int32 i= 0; i < seqCont.getLength(); i++)
{
- abort= Reference<XInteractionAbort>::query( seqCont[i]);
+ abort.set( seqCont[i], UNO_QUERY );
if(abort.is())
break;
}
for (sal_Int32 i= 0; i < seqCont.getLength(); i++)
{
- retry= Reference<XInteractionRetry>::query( seqCont[i]);
+ retry.set( seqCont[i], UNO_QUERY );
if(retry.is())
break;
}
diff --git a/stoc/test/registry_tdprovider/testregistrytdprovider.cxx b/stoc/test/registry_tdprovider/testregistrytdprovider.cxx
index f6fd89843b19..359c4b789f3b 100644
--- a/stoc/test/registry_tdprovider/testregistrytdprovider.cxx
+++ b/stoc/test/registry_tdprovider/testregistrytdprovider.cxx
@@ -151,8 +151,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
OUString( "com.sun.star.uno.XComponentContext::getValueByName")));
css::uno::Reference< css::reflection::XCompoundTypeDescription > exception;
- exception
- = css::uno::Reference< css::reflection::XCompoundTypeDescription >(
+ exception.set(
provider->getByHierarchicalName(
OUString( "com.sun.star.uno.Exception")),
css::uno::UNO_QUERY_THROW);
@@ -160,8 +159,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
assertEqual( OUString( "com.sun.star.uno.Exception"),
exception->getName());
assertFalse(exception->getBaseType().is());
- exception
- = css::uno::Reference< css::reflection::XCompoundTypeDescription >(
+ exception.set(
provider->getByHierarchicalName(
OUString( "com.sun.star.uno.RuntimeException")),
css::uno::UNO_QUERY_THROW);
@@ -173,7 +171,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::Reference< css::reflection::XStructTypeDescription > structure;
- structure = css::uno::Reference< css::reflection::XStructTypeDescription >(
+ structure.set(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Struct2")),
css::uno::UNO_QUERY_THROW);
@@ -192,7 +190,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
assertEqual< sal_Int32 >(0, structure->getTypeParameters().getLength());
assertEqual< sal_Int32 >(0, structure->getTypeArguments().getLength());
- structure = css::uno::Reference< css::reflection::XStructTypeDescription >(
+ structure.set(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Struct3")),
css::uno::UNO_QUERY_THROW);
@@ -221,7 +219,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
structure->getTypeParameters()[1]);
assertEqual< sal_Int32 >(0, structure->getTypeArguments().getLength());
- structure = css::uno::Reference< css::reflection::XStructTypeDescription >(
+ structure.set(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Struct4")),
css::uno::UNO_QUERY_THROW);
@@ -248,8 +246,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::Reference< css::reflection::XInterfaceTypeDescription2 >
interface;
- interface
- = css::uno::Reference< css::reflection::XInterfaceTypeDescription2 >(
+ interface.set(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.XTest1")),
css::uno::UNO_QUERY_THROW);
@@ -289,9 +286,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::Reference< css::reflection::XInterfaceMethodTypeDescription >
method;
- attribute = css::uno::Reference<
- css::reflection::XInterfaceAttributeTypeDescription2 >(
- members[0], css::uno::UNO_QUERY_THROW);
+ attribute.set( members[0], css::uno::UNO_QUERY_THROW);
assertEqual(
css::uno::TypeClass_INTERFACE_ATTRIBUTE, attribute->getTypeClass());
assertEqual(
@@ -311,9 +306,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
setExceptions = attribute->getSetExceptions();
assertEqual< sal_Int32 >(0, setExceptions.getLength());
- attribute = css::uno::Reference<
- css::reflection::XInterfaceAttributeTypeDescription2 >(
- members[1], css::uno::UNO_QUERY_THROW);
+ attribute.set( members[1], css::uno::UNO_QUERY_THROW);
assertEqual(
css::uno::TypeClass_INTERFACE_ATTRIBUTE, attribute->getTypeClass());
assertEqual(
@@ -345,9 +338,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
OUString( "com.sun.star.lang.WrappedTargetException"),
setExceptions[1]->getName());
- attribute = css::uno::Reference<
- css::reflection::XInterfaceAttributeTypeDescription2 >(
- members[2], css::uno::UNO_QUERY_THROW);
+ attribute.set( members[2], css::uno::UNO_QUERY_THROW);
assertEqual(
css::uno::TypeClass_INTERFACE_ATTRIBUTE, attribute->getTypeClass());
assertEqual(
@@ -371,9 +362,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
setExceptions = attribute->getSetExceptions();
assertEqual< sal_Int32 >(0, setExceptions.getLength());
- method = css::uno::Reference<
- css::reflection::XInterfaceMethodTypeDescription >(
- members[3], css::uno::UNO_QUERY_THROW);
+ method.set( members[3], css::uno::UNO_QUERY_THROW);
assertEqual(css::uno::TypeClass_INTERFACE_METHOD, method->getTypeClass());
assertEqual(
OUString( "test.registrytdprovider.XTest1::f1"),
@@ -398,9 +387,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
OUString( "com.sun.star.uno.RuntimeException"),
method->getExceptions()[0]->getName());
- method = css::uno::Reference<
- css::reflection::XInterfaceMethodTypeDescription >(
- members[4], css::uno::UNO_QUERY_THROW);
+ method.set( members[4], css::uno::UNO_QUERY_THROW);
assertEqual(css::uno::TypeClass_INTERFACE_METHOD, method->getTypeClass());
assertEqual(
OUString( "test.registrytdprovider.XTest1::f2"),
@@ -413,8 +400,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
assertEqual< sal_Int32 >(0, method->getParameters().getLength());
assertEqual< sal_Int32 >(0, method->getExceptions().getLength());
- interface
- = css::uno::Reference< css::reflection::XInterfaceTypeDescription2 >(
+ interface.set(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.XTest2")),
css::uno::UNO_QUERY_THROW);
@@ -431,7 +417,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::Reference< css::reflection::XServiceTypeDescription2 > service;
- service = css::uno::Reference< css::reflection::XServiceTypeDescription2 >(
+ service.set(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Service1")),
css::uno::UNO_QUERY_THROW);
@@ -483,7 +469,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
OUString( "com.sun.star.uno.RuntimeException"),
service->getConstructors()[1]->getExceptions()[0]->getName());
- service = css::uno::Reference< css::reflection::XServiceTypeDescription2 >(
+ service.set(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Service2")),
css::uno::UNO_QUERY_THROW);
@@ -505,7 +491,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
assertFalse(service->getInterface().is());
assertEqual< sal_Int32 >(0, service->getConstructors().getLength());
- service = css::uno::Reference< css::reflection::XServiceTypeDescription2 >(
+ service.set(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Service3")),
css::uno::UNO_QUERY_THROW);
@@ -528,8 +514,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::Reference< css::reflection::XSingletonTypeDescription2 >
singleton;
- singleton = css::uno::Reference<
- css::reflection::XSingletonTypeDescription2 >(
+ singleton.set(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Singleton1")),
css::uno::UNO_QUERY_THROW);
@@ -545,8 +530,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
"test.registrytdprovider.XTest1"),
singleton->getInterface()->getName());
- singleton = css::uno::Reference<
- css::reflection::XSingletonTypeDescription2 >(
+ singleton.set(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Singleton2")),
css::uno::UNO_QUERY_THROW);
@@ -562,8 +546,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
assertEqual< bool >(false, singleton->isInterfaceBased());
assertFalse(singleton->getInterface().is());
- singleton = css::uno::Reference<
- css::reflection::XSingletonTypeDescription2 >(
+ singleton.set(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Singleton3")),
css::uno::UNO_QUERY_THROW);
@@ -580,7 +563,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
singleton->getInterface()->getName());
css::uno::Reference< css::reflection::XPublished > published;
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Enum1")),
@@ -588,7 +571,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::UNO_QUERY);
assertTrue(published.is());
assertTrue(published->isPublished());
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Enum2")),
@@ -596,7 +579,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::UNO_QUERY);
assertTrue(published.is());
assertFalse(published->isPublished());
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Struct1")),
@@ -604,7 +587,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::UNO_QUERY);
assertTrue(published.is());
assertTrue(published->isPublished());
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Struct2")),
@@ -612,7 +595,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::UNO_QUERY);
assertTrue(published.is());
assertFalse(published->isPublished());
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Struct3")),
@@ -620,14 +603,14 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::UNO_QUERY);
assertTrue(published.is());
assertTrue(published->isPublished());
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XStructTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Struct3")),
css::uno::UNO_QUERY_THROW)->getMemberTypes()[0],
css::uno::UNO_QUERY);
assertFalse(published.is());
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Struct3a")),
@@ -635,7 +618,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::UNO_QUERY);
assertTrue(published.is());
assertFalse(published->isPublished());
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Exception1")),
@@ -643,7 +626,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::UNO_QUERY);
assertTrue(published.is());
assertTrue(published->isPublished());
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Exception2")),
@@ -651,7 +634,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::UNO_QUERY);
assertTrue(published.is());
assertFalse(published->isPublished());
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.XTest1")),
@@ -659,7 +642,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::UNO_QUERY);
assertTrue(published.is());
assertTrue(published->isPublished());
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.XTest2")),
@@ -667,7 +650,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::UNO_QUERY);
assertTrue(published.is());
assertFalse(published->isPublished());
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Typedef1")),
@@ -675,7 +658,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::UNO_QUERY);
assertTrue(published.is());
assertTrue(published->isPublished());
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Typedef2")),
@@ -687,7 +670,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
// test.registrytdprovider.Const2 (unpublished), and
// test.registrytdprovider.Consts1.C (no XPublished), which are not
// accessible via provider->getByHierarchicalName (see #i31428)
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Consts1")),
@@ -695,7 +678,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::UNO_QUERY);
assertTrue(published.is());
assertTrue(published->isPublished());
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Consts2")),
@@ -703,14 +686,14 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::UNO_QUERY);
assertTrue(published.is());
assertFalse(published->isPublished());
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider")),
css::uno::UNO_QUERY_THROW),
css::uno::UNO_QUERY);
assertFalse(published.is());
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Service1")),
@@ -718,7 +701,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::UNO_QUERY);
assertTrue(published.is());
assertTrue(published->isPublished());
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Service2")),
@@ -726,7 +709,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::UNO_QUERY);
assertTrue(published.is());
assertFalse(published->isPublished());
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Singleton2")),
@@ -734,7 +717,7 @@ sal_Int32 Service::run(css::uno::Sequence< OUString > const &)
css::uno::UNO_QUERY);
assertTrue(published.is());
assertTrue(published->isPublished());
- published = css::uno::Reference< css::reflection::XPublished >(
+ published.set(
css::uno::Reference< css::reflection::XTypeDescription >(
provider->getByHierarchicalName(
OUString( "test.registrytdprovider.Singleton1")),
diff --git a/stoc/test/testcorefl.cxx b/stoc/test/testcorefl.cxx
index 5fbd2cbdfd75..3d875b94efc7 100644
--- a/stoc/test/testcorefl.cxx
+++ b/stoc/test/testcorefl.cxx
@@ -246,7 +246,7 @@ static sal_Bool test_corefl( const Reference< XIdlReflection > & xRefl )
Any blup;
blup <<= aStructC;
Any gulp;
- rField = Reference< XIdlField2 > ( xRefl->forName("ModuleA.StructC")->getField(OUString("aString")) , UNO_QUERY);
+ rField.set( xRefl->forName("ModuleA.StructC")->getField(OUString("aString")) , UNO_QUERY);
rField->set( blup, gulp);
OSL_ENSURE(sal_False, "test_RegCoreReflection(): error 64");
return sal_False;
@@ -262,8 +262,7 @@ static sal_Bool test_corefl( const Reference< XIdlReflection > & xRefl )
gulp <<= 3.14f;
Any blup;
blup <<= aStructC;
- rField = Reference< XIdlField2 > (
- xRefl->forName("ModuleA.StructC")->getField(OUString("aString")) , UNO_QUERY);
+ rField.set( xRefl->forName("ModuleA.StructC")->getField(OUString("aString")) , UNO_QUERY);
xRefl->forName("ModuleA.StructC")->getField(OUString("aString"))->set(blup, gulp);
OSL_ENSURE(sal_False, "test_RegCoreReflection(): error 65");
return sal_False;
diff --git a/stoc/test/testintrosp.cxx b/stoc/test/testintrosp.cxx
index 2aedac97cf5f..a3f694bb3bfc 100644
--- a/stoc/test/testintrosp.cxx
+++ b/stoc/test/testintrosp.cxx
@@ -70,8 +70,7 @@ Reference<XIdlClass> TypeToIdlClass( const Type& rType, const Reference< XMultiS
OUString sOWName( pTD->pTypeName );
if( !xRefl.is() )
{
- xRefl = Reference< XIdlReflection >( xMgr->createInstance(
- "com.sun.star.reflection.CoreReflection" ), UNO_QUERY );
+ xRefl.set( xMgr->createInstance( "com.sun.star.reflection.CoreReflection" ), UNO_QUERY );
OSL_ENSURE( xRefl.is(), "### no corereflection!" );
}
xRetClass = xRefl->forName( sOWName );
diff --git a/stoc/test/testsmgr_cpnt.cxx b/stoc/test/testsmgr_cpnt.cxx
index 9fb7a64d813e..8540061650f5 100644
--- a/stoc/test/testsmgr_cpnt.cxx
+++ b/stoc/test/testsmgr_cpnt.cxx
@@ -203,7 +203,7 @@ extern "C" void SAL_CALL test_ServiceManager()
Reference<XEnumerationAccess> xImplEnum(xSMgr, UNO_QUERY);
OSL_ENSURE( xImplEnum.is() , "query on XEnumeration failed" );
- xEnum = Reference<XEnumeration >(xImplEnum->createEnumeration());
+ xEnum.set(xImplEnum->createEnumeration());
OSL_ENSURE( xEnum.is() , "createEnumeration failed" );
nLen = 0;
while( xEnum->hasMoreElements() )