diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-30 15:20:12 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-11-02 06:46:53 +0000 |
commit | dd1729f854af4f27f396d51d3c930c95d1011001 (patch) | |
tree | b65685fee797f657a3bc950902956c3820fd5106 /extensions | |
parent | 1b41208608f472df8dd5879c27dca45cc2ea7740 (diff) |
use uno::Reference::set method instead of assignment
Change-Id: Ib297f2ab1c0c82703030f28d034d24f8a84a85ea
Reviewed-on: https://gerrit.libreoffice.org/19732
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'extensions')
24 files changed, 63 insertions, 68 deletions
diff --git a/extensions/source/abpilot/admininvokationimpl.cxx b/extensions/source/abpilot/admininvokationimpl.cxx index b17973902012..97706e295dcb 100644 --- a/extensions/source/abpilot/admininvokationimpl.cxx +++ b/extensions/source/abpilot/admininvokationimpl.cxx @@ -88,7 +88,7 @@ namespace abp // so we display a wait cursor WaitObject aWaitCursor(m_pMessageParent); Reference<XInterface> x = m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(s_sDataSourceTypeChangeDialog, aArguments, m_xContext); - xDialog = Reference< XExecutableDialog >( x, UNO_QUERY ); + xDialog.set( x, UNO_QUERY ); // just for a smoother UI: What the dialog does upon execution, is (amongst other things) creating // the DriverManager service diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx index 344c7cda331f..9f7210091cae 100644 --- a/extensions/source/abpilot/datasourcehandling.cxx +++ b/extensions/source/abpilot/datasourcehandling.cxx @@ -115,7 +115,7 @@ namespace abp // create a new data source Reference< XPropertySet > xNewDataSource; if (xContext.is()) - xNewDataSource = Reference< XPropertySet >( xContext->createInstance(), UNO_QUERY ); + xNewDataSource.set( xContext->createInstance(), UNO_QUERY ); DBG_ASSERT( xNewDataSource.is(), "lcl_implCreateAndInsert: could not create a new data source!" ); @@ -199,9 +199,7 @@ namespace abp try { // create the UNO context - m_pImpl->xContext = Reference<XNameAccess>( - lcl_getDataSourceContext( _rxORB ), - UNO_QUERY_THROW); + m_pImpl->xContext.set( lcl_getDataSourceContext( _rxORB ), UNO_QUERY_THROW ); if (m_pImpl->xContext.is()) { diff --git a/extensions/source/bibliography/bibbeam.cxx b/extensions/source/bibliography/bibbeam.cxx index ad6e2463bc49..666950c9d9a7 100644 --- a/extensions/source/bibliography/bibbeam.cxx +++ b/extensions/source/bibliography/bibbeam.cxx @@ -145,7 +145,7 @@ namespace bib OUString aControlName; aAny >>= aControlName; - m_xControl = Reference< awt::XControl > ( xContext->getServiceManager()->createInstanceWithContext(aControlName, xContext), UNO_QUERY_THROW ); + m_xControl.set( xContext->getServiceManager()->createInstanceWithContext(aControlName, xContext), UNO_QUERY_THROW ); m_xControl->setModel( m_xGridModel ); } @@ -153,8 +153,8 @@ namespace bib { // Peer as Child to the FrameWindow m_xControlContainer->addControl("GridControl", m_xControl); - m_xGridWin=uno::Reference< awt::XWindow > (m_xControl, UNO_QUERY ); - m_xDispatchProviderInterception=uno::Reference< frame::XDispatchProviderInterception > (m_xControl, UNO_QUERY ); + m_xGridWin.set(m_xControl, UNO_QUERY ); + m_xDispatchProviderInterception.set(m_xControl, UNO_QUERY ); m_xGridWin->setVisible( sal_True ); m_xControl->setDesignMode( sal_True ); // initially switch on the design mode - switch it off _after_ loading the form diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx index 2460e9639f46..78aa2a4e2dc0 100644 --- a/extensions/source/bibliography/bibload.cxx +++ b/extensions/source/bibliography/bibload.cxx @@ -402,7 +402,7 @@ Reference< sdb::XColumn > BibliographyLoader::GetIdentifierColumn() const Reference< sdb::XColumn > xReturn; if (xColumns.is() && xColumns->hasByName(sIdentifierColumnName)) { - xReturn = Reference< XColumn > (*static_cast<Reference< XInterface > const *>( + xReturn.set(*static_cast<Reference< XInterface > const *>( xColumns->getByName(sIdentifierColumnName).getValue()), UNO_QUERY); } return xReturn; @@ -436,7 +436,7 @@ static OUString lcl_AddProperty(Reference< XNameAccess > xColumns, OUString uRet; Reference< sdb::XColumn > xCol; if (xColumns->hasByName(uColumnName)) - xCol = Reference< sdb::XColumn > (*static_cast<Reference< XInterface > const *>(xColumns->getByName(uColumnName).getValue()), UNO_QUERY); + xCol.set(*static_cast<Reference< XInterface > const *>(xColumns->getByName(uColumnName).getValue()), UNO_QUERY); if (xCol.is()) uRet = xCol->getString(); return uRet; @@ -463,7 +463,7 @@ Any BibliographyLoader::getByName(const OUString& rName) throw OUString sId = sIdentifierMapping; Reference< sdb::XColumn > xColumn; if (xColumns->hasByName(sId)) - xColumn = Reference< sdb::XColumn > (*static_cast<Reference< XInterface > const *>(xColumns->getByName(sId).getValue()), UNO_QUERY); + xColumn.set(*static_cast<Reference< XInterface > const *>(xColumns->getByName(sId).getValue()), UNO_QUERY); if (xColumn.is()) { do diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index 728359d65af2..34c7360f607a 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -96,7 +96,7 @@ Reference< XConnection > getConnection(const OUString& _rURL) DBG_ASSERT(xNamingContext.is(), "::getDataSource : no NamingService interface on the sdb::DatabaseAccessContext !"); try { - xDataSource = Reference< XDataSource > (xNamingContext->getRegisteredObject(_rURL), UNO_QUERY); + xDataSource.set(xNamingContext->getRegisteredObject(_rURL), UNO_QUERY); } catch (const Exception&) { @@ -135,7 +135,7 @@ Reference< XConnection > getConnection(const Reference< XInterface > & xRowSe if (!xFormProps.is()) return xConn; - xConn = Reference< XConnection > (*static_cast<Reference< XInterface > const *>(xFormProps->getPropertyValue("ActiveConnection").getValue()), UNO_QUERY); + xConn.set(*static_cast<Reference< XInterface > const *>(xFormProps->getPropertyValue("ActiveConnection").getValue()), UNO_QUERY); if (!xConn.is()) { SAL_INFO("extensions", "no active connection"); @@ -173,7 +173,7 @@ Reference< XNameAccess > getColumns(const Reference< XForm > & _rxForm) xFormProps->getPropertyValue("Command") >>= sTable; Reference< XNameAccess > xTables = xSupplyTables->getTables(); if (xTables.is() && xTables->hasByName(sTable)) - xSupplyCols = Reference< XColumnsSupplier > ( + xSupplyCols.set( *static_cast<Reference< XInterface > const *>(xTables->getByName(sTable).getValue()), UNO_QUERY); if (xSupplyCols.is()) xReturn = xSupplyCols->getColumns(); @@ -778,7 +778,7 @@ Reference< XForm > BibDataManager::createDatabaseForm(BibDBDescriptor& rDesc) try { Reference< XMultiServiceFactory > xMgr = comphelper::getProcessServiceFactory(); - m_xForm = Reference< XForm > ( xMgr->createInstance( "com.sun.star.form.component.Form" ), UNO_QUERY ); + m_xForm.set( xMgr->createInstance( "com.sun.star.form.component.Form" ), UNO_QUERY ); Reference< XPropertySet > aPropertySet( m_xForm, UNO_QUERY ); @@ -1210,7 +1210,7 @@ Reference< awt::XControlModel > BibDataManager::createGridModel(const OUString& // create the control model Reference< XMultiServiceFactory > xMgr = ::comphelper::getProcessServiceFactory(); Reference< XInterface > xObject = xMgr->createInstance("com.sun.star.form.component.GridControl"); - xModel=Reference< awt::XControlModel > ( xObject, UNO_QUERY ); + xModel.set( xObject, UNO_QUERY ); // set the Reference< XPropertySet > xPropSet( xModel, UNO_QUERY ); @@ -1312,7 +1312,7 @@ Reference< awt::XControlModel > BibDataManager::loadControlModel( Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); Reference< XInterface > xObject = xContext->getServiceManager()->createInstanceWithContext(aInstanceName, xContext); - xModel=Reference< awt::XControlModel > ( xObject, UNO_QUERY ); + xModel.set( xObject, UNO_QUERY ); Reference< XPropertySet > xPropSet( xModel, UNO_QUERY ); Any aFieldName; aFieldName <<= aName; @@ -1607,7 +1607,7 @@ uno::Reference< form::runtime::XFormController > BibDataManager::GetFormControll Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); m_xFormCtrl = form::runtime::FormController::create(xContext); m_xFormCtrl->setModel(uno::Reference< awt::XTabControllerModel > (getForm(), UNO_QUERY)); - m_xFormDispatch = uno::Reference< frame::XDispatch > ( m_xFormCtrl, UNO_QUERY); + m_xFormDispatch.set( m_xFormCtrl, UNO_QUERY); } return m_xFormCtrl; } diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx index abc6a672cd88..dad48596571f 100644 --- a/extensions/source/bibliography/framectr.cxx +++ b/extensions/source/bibliography/framectr.cxx @@ -563,7 +563,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen if (xConfirm.is()) { sdb::RowChangeEvent aEvent; - aEvent.Source = Reference< XInterface > (xCursor, UNO_QUERY); + aEvent.Source.set(xCursor, UNO_QUERY); aEvent.Action = sdb::RowChangeAction::DELETE; aEvent.Rows = 1; bSuccess = xConfirm->confirmDelete(aEvent); diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index 8f851218ea48..11c30663c97a 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -463,7 +463,7 @@ uno::Reference< awt::XControlModel > BibGeneralPage::AddXControl( if (bTypeListBox) { aControlName = "com.sun.star.form.control.ListBox"; - xLBModel = Reference< form::XBoundComponent >(xCtrModel, UNO_QUERY); + xLBModel.set(xCtrModel, UNO_QUERY); } else { diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index 2749fd0b85c8..18a56c1a9760 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -325,8 +325,8 @@ namespace dbp if (xModelAsChild.is()) xControlParent = xModelAsChild->getParent(); - m_aContext.xForm = Reference< XPropertySet >(xControlParent, UNO_QUERY); - m_aContext.xRowSet = Reference< XRowSet >(xControlParent, UNO_QUERY); + m_aContext.xForm.set(xControlParent, UNO_QUERY); + m_aContext.xRowSet.set(xControlParent, UNO_QUERY); DBG_ASSERT(m_aContext.xForm.is() && m_aContext.xRowSet.is(), "OControlWizard::implDetermineForm: missing some interfaces of the control parent!"); @@ -344,8 +344,8 @@ namespace dbp Reference< XModel > xModel(xModelSearch, UNO_QUERY); while (xModelSearch.is() && !xModel.is()) { - xModelSearch = Reference< XChild >(xModelSearch->getParent(), UNO_QUERY); - xModel = Reference< XModel >(xModelSearch, UNO_QUERY); + xModelSearch.set(xModelSearch->getParent(), UNO_QUERY); + xModel.set(xModelSearch, UNO_QUERY); } Reference< XDrawPage > xPage; @@ -369,7 +369,7 @@ namespace dbp if (xView.is()) { // okay, it is one Reference< XSpreadsheet > xSheet = xView->getActiveSheet(); - xPageSupp = Reference< XDrawPageSupplier >(xSheet, UNO_QUERY); + xPageSupp.set(xSheet, UNO_QUERY); DBG_ASSERT(xPageSupp.is(), "OControlWizard::implDeterminePage: a spreadsheet which is no page supplier!"); if (xPageSupp.is()) xPage = xPageSupp->getDrawPage(); @@ -472,7 +472,7 @@ namespace dbp Reference< XInteractionHandler > xHandler; try { - xHandler = Reference< XInteractionHandler >( InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY_THROW ); + xHandler.set( InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY_THROW ); } catch(const Exception&) { } if (!xHandler.is()) diff --git a/extensions/source/ole/unoconversionutilities.hxx b/extensions/source/ole/unoconversionutilities.hxx index 7ab69779e799..fe008e991adc 100644 --- a/extensions/source/ole/unoconversionutilities.hxx +++ b/extensions/source/ole/unoconversionutilities.hxx @@ -282,15 +282,13 @@ Reference< XSingleServiceFactory > UnoConversionUtilities<T>::getInvocationFacto m_smgrRemote.is() ) { if( ! m_xInvocationFactoryRemote.is() ) - m_xInvocationFactoryRemote= Reference<XSingleServiceFactory>( - m_smgrRemote->createInstance( INVOCATION_SERVICE), UNO_QUERY); + m_xInvocationFactoryRemote.set(m_smgrRemote->createInstance( INVOCATION_SERVICE), UNO_QUERY); retVal= m_xInvocationFactoryRemote; } else { if( ! m_xInvocationFactoryLocal.is() ) - m_xInvocationFactoryLocal= Reference<XSingleServiceFactory>( - m_smgr->createInstance(INVOCATION_SERVICE ), UNO_QUERY); + m_xInvocationFactoryLocal.set(m_smgr->createInstance(INVOCATION_SERVICE ), UNO_QUERY); retVal= m_xInvocationFactoryLocal; } return retVal; @@ -1371,7 +1369,7 @@ void UnoConversionUtilities<T>::createUnoObjectWrapper(const Any & rObj, VARIANT return; } //make sure we have the main XInterface which is used with a map - xInt = Reference<XInterface>(xInt, UNO_QUERY); + xInt.set(xInt, UNO_QUERY); //If there is already a wrapper for the UNO object then use it Reference<XInterface> xIntWrapper; @@ -1414,7 +1412,7 @@ void UnoConversionUtilities<T>::createUnoObjectWrapper(const Any & rObj, VARIANT Sequence<Any> params(1); params.getArray()[0] = rObj; Reference<XInterface> xInt = xInvFactory->createInstanceWithArguments(params); - xInv= Reference<XInvocation>(xInt, UNO_QUERY); + xInv.set(xInt, UNO_QUERY); } } @@ -2364,7 +2362,7 @@ Reference<XTypeConverter> UnoConversionUtilities<T>::getTypeConverter() Reference<XInterface> xIntConverter = m_smgr->createInstance("com.sun.star.script.Converter"); if (xIntConverter.is()) - m_typeConverter = Reference<XTypeConverter>(xIntConverter, UNO_QUERY); + m_typeConverter.set(xIntConverter, UNO_QUERY); } } return m_typeConverter; diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx index a8a45aab68a1..5d1c62ddc9ca 100644 --- a/extensions/source/ole/unoobjw.cxx +++ b/extensions/source/ole/unoobjw.cxx @@ -146,7 +146,7 @@ STDMETHODIMP_(ULONG) InterfaceOleWrapper_Impl::Release() // IUnoObjectWrapper -------------------------------------------------------- STDMETHODIMP InterfaceOleWrapper_Impl::getWrapperXInterface( Reference<XInterface>* pXInt) { - *pXInt= Reference<XInterface>( static_cast<XWeak*>( this), UNO_QUERY); + pXInt->set( static_cast<XWeak*>( this), UNO_QUERY); return pXInt->is() ? S_OK : E_FAIL; } STDMETHODIMP InterfaceOleWrapper_Impl::getOriginalUnoObject( Reference<XInterface>* pXInt) @@ -514,7 +514,7 @@ void SAL_CALL InterfaceOleWrapper_Impl::initialize( const Sequence< Any >& aArgu break; } - m_xExactName= Reference<XExactName>( m_xInvocation, UNO_QUERY); + m_xExactName.set( m_xInvocation, UNO_QUERY); } Reference< XInterface > InterfaceOleWrapper_Impl::createUnoWrapperInstance() diff --git a/extensions/source/plugin/base/multiplx.cxx b/extensions/source/plugin/base/multiplx.cxx index e28d492532bc..faf41001285d 100644 --- a/extensions/source/plugin/base/multiplx.cxx +++ b/extensions/source/plugin/base/multiplx.cxx @@ -167,7 +167,7 @@ void MRCListenerMultiplexerHelper::disposing(const css::lang::EventObject& ) thr { ::osl::Guard< ::osl::Mutex > aGuard( aMutex ); // peer is disposed, clear the reference - xPeer = Reference< css::awt::XWindow > (); + xPeer.clear(); } #define MULTIPLEX( InterfaceName, MethodName, EventName ) \ diff --git a/extensions/source/plugin/base/plctrl.cxx b/extensions/source/plugin/base/plctrl.cxx index 4204586707a0..0ff4c8c77564 100644 --- a/extensions/source/plugin/base/plctrl.cxx +++ b/extensions/source/plugin/base/plctrl.cxx @@ -87,7 +87,7 @@ void PluginControl_Impl::dispose() getMultiplexer()->disposeAndClear(); // release context - _xContext = Reference< XInterface > (); + _xContext.clear(); releasePeer(); } @@ -147,8 +147,8 @@ void PluginControl_Impl::releasePeer() _xParentWindow->removeFocusListener( this ); _xPeerWindow->dispose(); _pSysChild = NULL; - _xPeerWindow = Reference< css::awt::XWindow > (); - _xPeer = Reference< css::awt::XWindowPeer > (); + _xPeerWindow.clear(); + _xPeer.clear(); getMultiplexer()->setPeer( Reference< css::awt::XWindow > () ); } } @@ -164,7 +164,7 @@ void PluginControl_Impl::createPeer( const Reference< css::awt::XToolkit > & /*x } _xParentPeer = xParentPeer; - _xParentWindow = Reference< css::awt::XWindow > ( xParentPeer, UNO_QUERY ); + _xParentWindow.set( xParentPeer, UNO_QUERY ); DBG_ASSERT( _xParentWindow.is(), "### no parent peer window!" ); vcl::Window* pImpl = VCLUnoHelper::GetWindow( xParentPeer ); @@ -175,8 +175,8 @@ void PluginControl_Impl::createPeer( const Reference< css::awt::XToolkit > & /*x _pSysChild->GrabFocus(); // get peer - _xPeer = Reference< css::awt::XWindowPeer > ( _pSysChild->GetComponentInterface() ); - _xPeerWindow = Reference< css::awt::XWindow > ( _xPeer, UNO_QUERY ); + _xPeer.set( _pSysChild->GetComponentInterface() ); + _xPeerWindow.set( _xPeer, UNO_QUERY ); // !_BOTH_ MUST BE VALID! DBG_ASSERT( (_xPeer.is() && _xPeerWindow.is()), "### no peer!" ); diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx index 0678508ec30c..133f072aa978 100644 --- a/extensions/source/plugin/base/xplugin.cxx +++ b/extensions/source/plugin/base/xplugin.cxx @@ -823,9 +823,9 @@ sal_Bool XPlugin_Impl::provideNewStream(const OUString& mimetype, pStream->setSource( stream ); uno::Reference< css::io::XActiveDataControl > xController; if( xConnectable.is() ) - xController = uno::Reference< css::io::XActiveDataControl >( xConnectable, UNO_QUERY ); + xController.set( xConnectable, UNO_QUERY ); else - xController = uno::Reference< css::io::XActiveDataControl >( stream, UNO_QUERY ); + xController.set( stream, UNO_QUERY ); if( xController.is() ) xController->start(); @@ -1151,7 +1151,7 @@ void PluginInputStream::closeOutput() throw(std::exception) Guard< Mutex > aGuard( pPlugin->getMutex() ); flush(); - m_xSource = uno::Reference< css::io::XActiveDataSource >(); + m_xSource.clear(); } sal_uInt32 PluginInputStream::read( sal_uInt32 offset, sal_Int8* buffer, sal_uInt32 size ) diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx index 637bf744884f..cd501bb5638e 100644 --- a/extensions/source/propctrlr/eventhandler.cxx +++ b/extensions/source/propctrlr/eventhandler.cxx @@ -508,7 +508,7 @@ namespace pcr if ( !_rxIntrospectee.is() ) throw NullPointerException(); - m_xComponent = Reference< XPropertySet >( _rxIntrospectee, UNO_QUERY_THROW ); + m_xComponent.set( _rxIntrospectee, UNO_QUERY_THROW ); m_bEventsMapInitialized = false; EventMap aEmpty; diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index e83e8dd0232f..a5f49336d4d1 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -2300,7 +2300,7 @@ namespace pcr xRowSet.set( m_xComponent, UNO_QUERY ); if ( !xRowSet.is() ) { - xRowSet = Reference< XRowSet >( m_xObjectParent, UNO_QUERY ); + xRowSet.set( m_xObjectParent, UNO_QUERY ); if ( !xRowSet.is() ) { // are we inspecting a grid column? @@ -2308,7 +2308,7 @@ namespace pcr { // yes Reference< XChild > xParentAsChild( m_xObjectParent, UNO_QUERY ); if ( xParentAsChild.is() ) - xRowSet = Reference< XRowSet >( xParentAsChild->getParent(), UNO_QUERY ); + xRowSet.set( xParentAsChild->getParent(), UNO_QUERY ); } } if ( !xRowSet.is() ) diff --git a/extensions/source/propctrlr/genericpropertyhandler.cxx b/extensions/source/propctrlr/genericpropertyhandler.cxx index 92e19d76e951..857dc031bd3a 100644 --- a/extensions/source/propctrlr/genericpropertyhandler.cxx +++ b/extensions/source/propctrlr/genericpropertyhandler.cxx @@ -94,7 +94,7 @@ namespace pcr _rxContext->getValueByName("/singletons/com.sun.star.reflection.theTypeDescriptionManager"), UNO_QUERY_THROW ); - m_xTypeDescription = Reference< XEnumTypeDescription >( xTypeDescProv->getByHierarchicalName( m_aEnumType.getTypeName() ), UNO_QUERY_THROW ); + m_xTypeDescription.set( xTypeDescProv->getByHierarchicalName( m_aEnumType.getTypeName() ), UNO_QUERY_THROW ); } } catch( const Exception& ) @@ -322,7 +322,7 @@ namespace pcr if ( !xIntrospectionAccess.is() ) throw RuntimeException("The introspection service could not handle the given component.", *this ); - m_xComponent = Reference< XPropertySet >( xIntrospectionAccess->queryAdapter( cppu::UnoType<XPropertySet>::get() ), UNO_QUERY_THROW ); + m_xComponent.set( xIntrospectionAccess->queryAdapter( cppu::UnoType<XPropertySet>::get() ), UNO_QUERY_THROW ); // now that we survived so far, remember m_xComponentIntrospectionAccess m_xComponentIntrospectionAccess = xIntrospectionAccess; m_xPropertyState.set(m_xComponent, css::uno::UNO_QUERY); diff --git a/extensions/source/propctrlr/selectlabeldialog.cxx b/extensions/source/propctrlr/selectlabeldialog.cxx index 7d0b9391ef96..d9fcf04b2652 100644 --- a/extensions/source/propctrlr/selectlabeldialog.cxx +++ b/extensions/source/propctrlr/selectlabeldialog.cxx @@ -87,9 +87,9 @@ namespace pcr Reference< XResultSet > xParentAsResultSet(xSearch, UNO_QUERY); while (xParentAsResultSet.is()) { - xCont = Reference< XChild > (xSearch, UNO_QUERY); + xCont.set(xSearch, UNO_QUERY); xSearch = xCont.is() ? xCont->getParent() : Reference< XInterface > (); - xParentAsResultSet = Reference< XResultSet > (xSearch, UNO_QUERY); + xParentAsResultSet.set(xSearch, UNO_QUERY); } // and insert all entries below this root into the listbox @@ -248,7 +248,7 @@ namespace pcr void* pData = pSelected ? pSelected->GetUserData() : NULL; if (pData) - m_xSelectedControl = Reference< XPropertySet > (*static_cast<Reference< XPropertySet > *>(pData)); + m_xSelectedControl.set(*static_cast<Reference< XPropertySet > *>(pData)); m_pNoAssignment->SetClickHdl(Link<Button*,void>()); m_pNoAssignment->Check(pData == NULL); diff --git a/extensions/source/resource/ResourceIndexAccess.cxx b/extensions/source/resource/ResourceIndexAccess.cxx index 638433fc8fd4..63bfee9e3e22 100644 --- a/extensions/source/resource/ResourceIndexAccess.cxx +++ b/extensions/source/resource/ResourceIndexAccess.cxx @@ -95,10 +95,10 @@ Any SAL_CALL ResourceIndexAccess::getByName(const OUString& aName) switch(::std::find(aNames.begin(), aNames.end(), aName) - aNames.begin()) { case 0: - xResult = Reference<XIndexAccess>(new ResourceStringIndexAccess(m_pResMgr)); + xResult.set(new ResourceStringIndexAccess(m_pResMgr)); break; case 1: - xResult = Reference<XIndexAccess>(new ResourceStringListIndexAccess(m_pResMgr)); + xResult.set(new ResourceStringListIndexAccess(m_pResMgr)); break; default: throw NoSuchElementException(); diff --git a/extensions/source/scanner/scanunx.cxx b/extensions/source/scanner/scanunx.cxx index 45fd33549cce..f43d2b467207 100644 --- a/extensions/source/scanner/scanunx.cxx +++ b/extensions/source/scanner/scanunx.cxx @@ -188,7 +188,7 @@ void ScannerThread::run() BitmapTransporter* pTransporter = new BitmapTransporter; Reference< XInterface > aIf( static_cast< OWeakObject* >( pTransporter ) ); - m_pHolder->m_xBitmap = Reference< css::awt::XBitmap >( aIf, UNO_QUERY ); + m_pHolder->m_xBitmap.set( aIf, UNO_QUERY ); m_pHolder->m_bBusy = true; if( m_pHolder->m_aSane.IsOpen() ) @@ -378,7 +378,7 @@ Reference< css::awt::XBitmap > ScannerManager::getBitmap( const ScannerContext& osl::MutexGuard aProtGuard( pHolder->m_aProtector ); Reference< css::awt::XBitmap > xRet( pHolder->m_xBitmap ); - pHolder->m_xBitmap = Reference< css::awt::XBitmap >(); + pHolder->m_xBitmap.clear(); return xRet; } diff --git a/extensions/source/scanner/scanwin.cxx b/extensions/source/scanner/scanwin.cxx index 362f6570023c..0ce2ab719b5d 100644 --- a/extensions/source/scanner/scanwin.cxx +++ b/extensions/source/scanner/scanwin.cxx @@ -670,8 +670,8 @@ bool Twain::SelectSource( ScannerManager& rMgr ) if( !mpImpTwain ) { // hold reference to ScannerManager, to prevent premature death - mxMgr = uno::Reference< scanner::XScannerManager >( static_cast< OWeakObject* >( const_cast< ScannerManager* >( mpCurMgr = &rMgr ) ), - uno::UNO_QUERY ), + mxMgr.set( static_cast< OWeakObject* >( const_cast< ScannerManager* >( mpCurMgr = &rMgr ) ), + uno::UNO_QUERY ), meState = TWAIN_STATE_NONE; mpImpTwain = new ImpTwain( rMgr, LINK( this, Twain, ImpNotifyHdl ) ); @@ -690,8 +690,8 @@ bool Twain::PerformTransfer( ScannerManager& rMgr, const uno::Reference< lang::X if( !mpImpTwain ) { // hold reference to ScannerManager, to prevent premature death - mxMgr = uno::Reference< scanner::XScannerManager >( static_cast< OWeakObject* >( const_cast< ScannerManager* >( mpCurMgr = &rMgr ) ), - uno::UNO_QUERY ), + mxMgr.set( static_cast< OWeakObject* >( const_cast< ScannerManager* >( mpCurMgr = &rMgr ) ), + uno::UNO_QUERY ), mxListener = rxListener; meState = TWAIN_STATE_NONE; diff --git a/extensions/source/scanner/scnserv.cxx b/extensions/source/scanner/scnserv.cxx index b722b16ba4d5..49ae76d2d1be 100644 --- a/extensions/source/scanner/scnserv.cxx +++ b/extensions/source/scanner/scnserv.cxx @@ -34,7 +34,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL scn_component_getFactory( const s if( OUString::createFromAscii( pImplName ) == ScannerManager::getImplementationName_Static() ) { - xFactory = Reference< css::lang::XSingleServiceFactory >( ::cppu::createSingleFactory( + xFactory.set( ::cppu::createSingleFactory( static_cast< css::lang::XMultiServiceFactory* >( pServiceManager ), ScannerManager::getImplementationName_Static(), ScannerManager_CreateInstance, diff --git a/extensions/source/update/check/updatecheckconfig.cxx b/extensions/source/update/check/updatecheckconfig.cxx index 27eb528d2bea..e8b29d784b6d 100644 --- a/extensions/source/update/check/updatecheckconfig.cxx +++ b/extensions/source/update/check/updatecheckconfig.cxx @@ -605,12 +605,12 @@ UpdateCheckConfig::commitChanges() } } - xChangesBatch = uno::Reference< util::XChangesBatch > ( m_xAvailableUpdates, uno::UNO_QUERY ); + xChangesBatch.set( m_xAvailableUpdates, uno::UNO_QUERY ); if( xChangesBatch.is() && xChangesBatch->hasPendingChanges() ) { xChangesBatch->commitChanges(); } - xChangesBatch = uno::Reference< util::XChangesBatch > ( m_xIgnoredUpdates, uno::UNO_QUERY ); + xChangesBatch.set( m_xIgnoredUpdates, uno::UNO_QUERY ); if( xChangesBatch.is() && xChangesBatch->hasPendingChanges() ) { xChangesBatch->commitChanges(); diff --git a/extensions/test/ole/OleClient/funcs.cxx b/extensions/test/ole/OleClient/funcs.cxx index d20eabde3053..a67cdbb1766e 100644 --- a/extensions/test/ole/OleClient/funcs.cxx +++ b/extensions/test/ole/OleClient/funcs.cxx @@ -55,7 +55,7 @@ Reference<XMultiServiceFactory> getMultiServiceFactory() if( ! objectFactory.is() ) { Reference<XComponentContext> context = defaultBootstrap_InitialComponentContext(); - factory = Reference<XMultiServiceFactory>( context->getServiceManager(), UNO_QUERY); + factory.set(context->getServiceManager(), UNO_QUERY); } return factory; @@ -65,12 +65,11 @@ Reference<XInvocation> getComObject( OUString progId) { HRESULT hr= S_OK; Reference< XInvocation > ret; -// Reference<XMultiServiceFactory> fac; if( ! objectFactory.is()) { Reference<XMultiServiceFactory> mgr= getMultiServiceFactory(); Reference<XInterface> xInt= mgr->createInstance( "com.sun.star.bridge.oleautomation.Factory"); - objectFactory= Reference<XMultiServiceFactory>::query( xInt); + objectFactory.set(xInt, UNO_QUERY); } if( objectFactory.is()) diff --git a/extensions/test/ole/cpnt/cpnt.cxx b/extensions/test/ole/cpnt/cpnt.cxx index 26852ce4993c..f0bbebcb47ec 100644 --- a/extensions/test/ole/cpnt/cpnt.cxx +++ b/extensions/test/ole/cpnt/cpnt.cxx @@ -1711,7 +1711,7 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac for( int i= 0; i < LISTENERS; i++) { Reference<XInterface> aList= static_cast<XWeak*>( new EventListener()); - arListeners[i]= Reference<XEventListener>( aList, UNO_QUERY); + arListeners[i].set( aList, UNO_QUERY); } xCallback->inSeqXEventListener(Sequence<Reference<XEventListener> > (arListeners, LISTENERS), |