summaryrefslogtreecommitdiff
path: root/stoc/test
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/test
parent1c3d3ffa81d1a451b5a694cff022df3c5c94ba8e (diff)
use uno::Reference::set method instead of assignment
Change-Id: I6cb508e392d5e194c80fc6d0927c86414e4ab05b
Diffstat (limited to 'stoc/test')
-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
5 files changed, 44 insertions, 63 deletions
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() )