diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-29 15:48:45 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-10-30 08:10:22 +0200 |
commit | 065c8b48a604b70140862d0d02deb584626d6994 (patch) | |
tree | 578c07b470b8ec9e5908d224c2fbf33cadda5adf /basic | |
parent | addb63fa8ac9fa1a29a00e886e7ae177b604494c (diff) |
use uno::Reference::set method instead of assignment
Change-Id: I58410209f32f988f258a588364e0b037c2790211
Diffstat (limited to 'basic')
-rw-r--r-- | basic/qa/cppunit/test_vba.cxx | 6 | ||||
-rw-r--r-- | basic/source/classes/propacc.cxx | 2 | ||||
-rw-r--r-- | basic/source/classes/sbunoobj.cxx | 15 | ||||
-rw-r--r-- | basic/source/uno/namecont.cxx | 2 |
4 files changed, 11 insertions, 14 deletions
diff --git a/basic/qa/cppunit/test_vba.cxx b/basic/qa/cppunit/test_vba.cxx index f7ddc6c494ec..ba145621b0e8 100644 --- a/basic/qa/cppunit/test_vba.cxx +++ b/basic/qa/cppunit/test_vba.cxx @@ -91,10 +91,8 @@ void VBATest::testMiscOLEStuff() if( xContext.is() ) { uno::Reference<lang::XMultiComponentFactory> xSMgr = xContext->getServiceManager(); - xOLEFactory = uno::Reference<lang::XMultiServiceFactory>( - xSMgr->createInstanceWithContext( - "com.sun.star.bridge.OleObjectFactory", - xContext ), uno::UNO_QUERY ); + xOLEFactory.set( xSMgr->createInstanceWithContext( "com.sun.star.bridge.OleObjectFactory", xContext ), + uno::UNO_QUERY ); } bool bOk = false; if( xOLEFactory.is() ) diff --git a/basic/source/classes/propacc.cxx b/basic/source/classes/propacc.cxx index 2a0b49af8eed..ae2cdb2fc78e 100644 --- a/basic/source/classes/propacc.cxx +++ b/basic/source/classes/propacc.cxx @@ -216,7 +216,7 @@ void RTL_Impl_CreatePropertySet( StarBASIC* pBasic, SbxArray& rPar, bool bWrite cppu::UnoType<Sequence<PropertyValue>>::get() ); Sequence<PropertyValue> const *pArg = static_cast<Sequence<PropertyValue> const *>(aArgAsAny.getValue()); - Reference< XPropertyAccess > xPropAcc = Reference< XPropertyAccess >::query( xInterface ); + Reference< XPropertyAccess > xPropAcc( xInterface, UNO_QUERY ); xPropAcc->setPropertyValues( *pArg ); // Build a SbUnoObject and return it diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 248f96b566d4..c4165e8cb432 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -248,12 +248,11 @@ SbUnoObject* createOLEObject_Impl( const OUString& aType ) { bNeedsInit = false; - Reference< XComponentContext > xContext( - comphelper::getProcessComponentContext() ); + Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() ); if( xContext.is() ) { Reference<XMultiComponentFactory> xSMgr = xContext->getServiceManager(); - xOLEFactory = Reference<XMultiServiceFactory>( + xOLEFactory.set( xSMgr->createInstanceWithContext( OUString( "com.sun.star.bridge.OleObjectFactory"), xContext ), UNO_QUERY ); @@ -2347,15 +2346,15 @@ SbUnoObject::SbUnoObject( const OUString& aName_, const Any& aUnoObj_ ) Reference< XTypeProvider > xTypeProvider; // Did the object have an invocation itself? - mxInvocation = Reference< XInvocation >( x, UNO_QUERY ); + mxInvocation.set( x, UNO_QUERY ); - xTypeProvider = Reference< XTypeProvider >( x, UNO_QUERY ); + xTypeProvider.set( x, UNO_QUERY ); if( mxInvocation.is() ) { // get the ExactName - mxExactNameInvocation = Reference< XExactName >::query( mxInvocation ); + mxExactNameInvocation.set( mxInvocation, UNO_QUERY ); // The remainder refers only to the introspection if( !xTypeProvider.is() ) @@ -2462,10 +2461,10 @@ void SbUnoObject::doIntrospection() } // get MaterialHolder from access - mxMaterialHolder = Reference< XMaterialHolder >::query( mxUnoAccess ); + mxMaterialHolder.set( mxUnoAccess, UNO_QUERY ); // get ExactName from access - mxExactName = Reference< XExactName >::query( mxUnoAccess ); + mxExactName.set( mxUnoAccess, UNO_QUERY ); } diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index a9e2c0e454f5..6996ab1e70d1 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -2779,7 +2779,7 @@ void SAL_CALL SfxLibraryContainer::disposing() EventObject aEvent( xModel.get() ); maVBAScriptListeners.disposing( aEvent ); stopAllComponentListening(); - mxOwnerDocument = WeakReference< XModel >(); + mxOwnerDocument.clear(); } // Methods XLibraryContainerPassword |