sw/qa/extras/odfexport/odfexport.cxx | 2 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 2 sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 4 - sw/source/core/unocore/unochart.cxx | 6 +- sw/source/core/unocore/unocrsrhelper.cxx | 5 - sw/source/core/unocore/unodraw.cxx | 6 +- sw/source/core/unocore/unofield.cxx | 3 - sw/source/filter/html/htmlform.cxx | 9 +-- sw/source/filter/ww8/docxattributeoutput.cxx | 2 sw/source/filter/ww8/docxsdrexport.cxx | 2 sw/source/filter/ww8/wrtw8nds.cxx | 2 sw/source/filter/ww8/wrtww8.cxx | 3 - sw/source/filter/ww8/ww8par3.cxx | 4 - sw/source/filter/xml/xmlfmt.cxx | 2 sw/source/filter/xml/xmltbli.cxx | 2 sw/source/ui/dbui/addresslistdialog.cxx | 2 sw/source/ui/dbui/dbinsdlg.cxx | 2 sw/source/ui/envelp/mailmrge.cxx | 4 - sw/source/ui/index/cntex.cxx | 3 - sw/source/ui/vba/vbafind.cxx | 2 sw/source/uibase/app/apphdl.cxx | 3 - sw/source/uibase/dbui/dbmgr.cxx | 20 +++---- sw/source/uibase/dbui/dbtree.cxx | 12 ++-- sw/source/uibase/dbui/mailmergehelper.cxx | 7 -- sw/source/uibase/dochdl/swdtflvr.cxx | 2 sw/source/uibase/docvw/PageBreakWin.cxx | 12 +--- sw/source/uibase/fldui/fldmgr.cxx | 2 sw/source/uibase/fldui/xfldui.cxx | 8 +- sw/source/uibase/misc/numberingtypelistbox.cxx | 2 sw/source/uibase/uno/unoatxt.cxx | 4 - sw/source/uibase/uno/unodispatch.cxx | 2 sw/source/uibase/uno/unomailmerge.cxx | 5 - sw/source/uibase/uno/unomodule.cxx | 2 sw/source/uibase/uno/unotxdoc.cxx | 2 sw/source/uibase/uno/unotxvw.cxx | 6 +- sw/source/uibase/utlui/unotools.cxx | 2 test/source/sheet/xspreadsheets2.cxx | 6 +- toolkit/source/awt/vclxtoolkit.cxx | 3 - toolkit/source/awt/vclxwindow.cxx | 2 toolkit/source/controls/controlmodelcontainerbase.cxx | 8 +- toolkit/source/controls/formattedcontrol.cxx | 2 toolkit/source/controls/geometrycontrolmodel.cxx | 2 toolkit/source/controls/stdtabcontroller.cxx | 4 - ucb/source/cacher/cachedcontentresultset.cxx | 6 +- ucb/source/cacher/contentresultsetwrapper.cxx | 5 - ucb/source/cacher/dynamicresultsetwrapper.cxx | 6 +- ucb/source/core/FileAccess.cxx | 2 ucb/source/core/provprox.cxx | 4 - ucb/source/core/ucb.cxx | 3 - ucb/source/core/ucbcmds.cxx | 3 - ucb/source/sorter/sortdynres.cxx | 2 ucb/source/sorter/sortresult.cxx | 4 - ucb/source/ucp/cmis/cmis_content.cxx | 6 +- ucb/source/ucp/cmis/cmis_datasupplier.cxx | 2 ucb/source/ucp/file/bc.cxx | 5 - ucb/source/ucp/file/filrset.cxx | 4 - ucb/source/ucp/file/prov.cxx | 2 ucb/source/ucp/ftp/ftpdynresultset.cxx | 4 - ucb/source/ucp/ftp/ftpresultsetI.cxx | 2 ucb/source/ucp/gio/gio_content.cxx | 4 - ucb/source/ucp/gio/gio_datasupplier.cxx | 2 ucb/source/ucp/hierarchy/hierarchycontent.cxx | 3 - ucb/source/ucp/hierarchy/hierarchydata.cxx | 49 +++++------------- ucb/source/ucp/hierarchy/hierarchydatasource.cxx | 4 - ucb/source/ucp/hierarchy/hierarchydatasupplier.cxx | 2 ucb/source/ucp/hierarchy/hierarchyprovider.cxx | 6 -- ucb/source/ucp/package/pkgcontent.cxx | 3 - ucb/source/ucp/package/pkgdatasupplier.cxx | 2 ucb/source/ucp/package/pkgprovider.cxx | 2 ucb/source/ucp/tdoc/tdoc_content.cxx | 3 - ucb/source/ucp/tdoc/tdoc_datasupplier.cxx | 2 ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx | 6 -- ucb/source/ucp/tdoc/tdoc_storage.cxx | 4 - ucb/source/ucp/webdav-neon/webdavcontent.cxx | 10 +-- ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx | 2 ucb/source/ucp/webdav/webdavcontent.cxx | 10 +-- ucb/source/ucp/webdav/webdavdatasupplier.cxx | 2 77 files changed, 152 insertions(+), 209 deletions(-)
New commits: commit b37b7b5cd5a4b7acdee4736008f3947317dad4ce Author: Noel Grandin <[email protected]> Date: Thu Nov 5 11:13:07 2015 +0200 use uno::Reference::set method instead of assignment Change-Id: Id036f867e75d03d8347cc32a1011c5cdda1dcc73 diff --git a/test/source/sheet/xspreadsheets2.cxx b/test/source/sheet/xspreadsheets2.cxx index 187a25e..5da8e96 100644 --- a/test/source/sheet/xspreadsheets2.cxx +++ b/test/source/sheet/xspreadsheets2.cxx @@ -306,7 +306,7 @@ uno::Reference< sheet::XNamedRanges> XSpreadsheets2::getNamedRanges(uno::Referen void XSpreadsheets2::importSheetToCopy() { uno::Reference< container::XNameAccess> xSrcNameAccess(init(),UNO_QUERY_THROW); - xSrcSheet = uno::Reference< sheet::XSpreadsheet >( xSrcNameAccess->getByName(aSrcSheetName), UNO_QUERY_THROW); + xSrcSheet.set( xSrcNameAccess->getByName(aSrcSheetName), UNO_QUERY_THROW); uno::Reference< lang::XComponent > xDestComponent; if (!xDestComponent.is()) @@ -322,11 +322,11 @@ void XSpreadsheets2::importSheetToCopy() } else { - xDestDoc = uno::Reference< sheet::XSpreadsheetDocument >(xDestComponent,UNO_QUERY_THROW); + xDestDoc.set(xDestComponent,UNO_QUERY_THROW); } uno::Reference< container::XNameAccess > xDestSheetNameAccess (xDestDoc->getSheets(), UNO_QUERY_THROW); - xDestSheet = uno::Reference< sheet::XSpreadsheet > ( xDestSheetNameAccess->getByName(aSrcSheetName), UNO_QUERY_THROW); + xDestSheet.set( xDestSheetNameAccess->getByName(aSrcSheetName), UNO_QUERY_THROW); } bool XSpreadsheets2::isExternalReference(const OUString& aDestContent, const OUString& aSrcContent ) diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index e31e5c3..56c3f19 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -626,8 +626,7 @@ static void SAL_CALL ToolkitWorkerFunction( void* pArgs ) css::uno::Reference<css::uno::XComponentContext> xContext = ::cppu::defaultBootstrap_InitialComponentContext(); - xServiceManager = css::uno::Reference<css::lang::XMultiServiceFactory>( - xContext->getServiceManager(), css::uno::UNO_QUERY_THROW ); + xServiceManager.set( xContext->getServiceManager(), css::uno::UNO_QUERY_THROW ); // set global process service factory used by unotools config helpers ::comphelper::setProcessServiceFactory( xServiceManager ); } diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 7c6a328..94a2f7c 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -2357,7 +2357,7 @@ void SAL_CALL VCLXWindow::disposing( const ::com::sun::star::lang::EventObject& if ( aAC.get() == xSource.get() ) { // yep, it does - mpImpl->mxAccessibleContext = uno::Reference< accessibility::XAccessibleContext >(); + mpImpl->mxAccessibleContext.clear(); } } diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index 3f5cecd..8e62ecb 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -1213,7 +1213,7 @@ void ResourceListener::stopListening() // --- SAFE --- ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex ); if ( m_bListening && m_xResource.is() ) - xModifyBroadcaster = Reference< util::XModifyBroadcaster >( m_xResource, UNO_QUERY ); + xModifyBroadcaster.set( m_xResource, UNO_QUERY ); aGuard.clear(); // --- SAFE --- @@ -1291,7 +1291,7 @@ throw ( RuntimeException, std::exception ) aGuard.reset(); m_bListening = false; xResource = m_xResource; - xListener = Reference< lang::XEventListener >( m_xListener, UNO_QUERY ); + xListener.set( m_xListener, UNO_QUERY ); m_xResource.clear(); aGuard.clear(); // --- SAFE --- @@ -1316,7 +1316,7 @@ throw ( RuntimeException, std::exception ) // --- SAFE --- aGuard.reset(); m_bListening = false; - xListener = Reference< lang::XEventListener >( m_xListener, UNO_QUERY ); + xListener.set( m_xListener, UNO_QUERY ); xResource = m_xResource; m_xResource.clear(); m_xListener.clear(); @@ -1773,7 +1773,7 @@ static void lcl_ApplyResolverToNestedContainees( const Reference< resource::XSt Reference< XPropertySet > xPropertySet; if ( xControl.is() ) - xPropertySet = Reference< XPropertySet >( xControl->getModel(), UNO_QUERY ); + xPropertySet.set( xControl->getModel(), UNO_QUERY ); if ( !xPropertySet.is() ) continue; diff --git a/toolkit/source/controls/formattedcontrol.cxx b/toolkit/source/controls/formattedcontrol.cxx index bd2b7b5..ef8393b 100644 --- a/toolkit/source/controls/formattedcontrol.cxx +++ b/toolkit/source/controls/formattedcontrol.cxx @@ -239,7 +239,7 @@ namespace toolkit if ( !m_xCachedFormatter.is() ) { - m_xCachedFormatter = Reference< XNumberFormatter >( + m_xCachedFormatter.set( NumberFormatter::create(::comphelper::getProcessComponentContext()), UNO_QUERY_THROW ); diff --git a/toolkit/source/controls/geometrycontrolmodel.cxx b/toolkit/source/controls/geometrycontrolmodel.cxx index 6bdf50c..1c35df6 100644 --- a/toolkit/source/controls/geometrycontrolmodel.cxx +++ b/toolkit/source/controls/geometrycontrolmodel.cxx @@ -117,7 +117,7 @@ { { // ensure that the temporary gets destructed NOW - m_xAggregate = Reference< XAggregation >(_rxAggregateInstance, UNO_QUERY); + m_xAggregate.set(_rxAggregateInstance, UNO_QUERY); } OSL_ENSURE(m_xAggregate.is(), "OGeometryControlModel_Base::OGeometryControlModel_Base: invalid object given!"); diff --git a/toolkit/source/controls/stdtabcontroller.cxx b/toolkit/source/controls/stdtabcontroller.cxx index bb606ae..e6a5387 100644 --- a/toolkit/source/controls/stdtabcontroller.cxx +++ b/toolkit/source/controls/stdtabcontroller.cxx @@ -105,9 +105,9 @@ bool StdTabController::ImplCreateComponentSequence( if ( xCtrl.is() ) { if (bPeerComponent) - pComps[n] = Reference< XWindow > (xCtrl->getPeer(), UNO_QUERY); + pComps[n].set(xCtrl->getPeer(), UNO_QUERY); else - pComps[n] = Reference< XWindow > (xCtrl, UNO_QUERY); + pComps[n].set(xCtrl, UNO_QUERY); // TabStop-Property if ( pTabs ) diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx index 5b097fc..6e593b0 100644 --- a/ucb/source/cacher/cachedcontentresultset.cxx +++ b/ucb/source/cacher/cachedcontentresultset.cxx @@ -700,10 +700,10 @@ CachedContentResultSet::CachedContentResultSet( , m_bTriedToGetTypeConverter( false ) , m_xTypeConverter( NULL ) { - m_xFetchProvider = Reference< XFetchProvider >( m_xResultSetOrigin, UNO_QUERY ); + m_xFetchProvider.set( m_xResultSetOrigin, UNO_QUERY ); OSL_ENSURE( m_xFetchProvider.is(), "interface XFetchProvider is required" ); - m_xFetchProviderForContentAccess = Reference< XFetchProviderForContentAccess >( m_xResultSetOrigin, UNO_QUERY ); + m_xFetchProviderForContentAccess.set( m_xResultSetOrigin, UNO_QUERY ); OSL_ENSURE( m_xFetchProviderForContentAccess.is(), "interface XFetchProviderForContentAccess is required" ); impl_init(); @@ -2190,7 +2190,7 @@ const Reference< XTypeConverter >& CachedContentResultSet::getTypeConverter() if ( !m_bTriedToGetTypeConverter && !m_xTypeConverter.is() ) { m_bTriedToGetTypeConverter = true; - m_xTypeConverter = Reference< XTypeConverter >( Converter::create(m_xContext) ); + m_xTypeConverter.set( Converter::create(m_xContext) ); OSL_ENSURE( m_xTypeConverter.is(), "PropertyValueSet::getTypeConverter() - " diff --git a/ucb/source/cacher/contentresultsetwrapper.cxx b/ucb/source/cacher/contentresultsetwrapper.cxx index 1c4a127..f592ea5 100644 --- a/ucb/source/cacher/contentresultsetwrapper.cxx +++ b/ucb/source/cacher/contentresultsetwrapper.cxx @@ -58,7 +58,7 @@ ContentResultSetWrapper::ContentResultSetWrapper( , m_pVetoableChangeListeners( NULL ) { m_pMyListenerImpl = new ContentResultSetWrapperListener( this ); - m_xMyListenerImpl = Reference< XPropertyChangeListener >( m_pMyListenerImpl ); + m_xMyListenerImpl.set( m_pMyListenerImpl ); OSL_ENSURE( m_xResultSetOrigin.is(), "XResultSet is required" ); @@ -471,8 +471,7 @@ Reference< XResultSetMetaData > SAL_CALL ContentResultSetWrapper::getMetaData() ReacquireableGuard aGuard( m_aMutex ); if( !m_xMetaDataFromOrigin.is() && m_xResultSetOrigin.is() ) { - Reference< XResultSetMetaDataSupplier > xMetaDataSupplier - = Reference< XResultSetMetaDataSupplier >( + Reference< XResultSetMetaDataSupplier > xMetaDataSupplier( m_xResultSetOrigin, UNO_QUERY ); if( xMetaDataSupplier.is() ) diff --git a/ucb/source/cacher/dynamicresultsetwrapper.cxx b/ucb/source/cacher/dynamicresultsetwrapper.cxx index 13e156c..fc25344 100644 --- a/ucb/source/cacher/dynamicresultsetwrapper.cxx +++ b/ucb/source/cacher/dynamicresultsetwrapper.cxx @@ -59,7 +59,7 @@ DynamicResultSetWrapper::DynamicResultSetWrapper( , m_xListener( NULL ) { m_pMyListenerImpl = new DynamicResultSetWrapperListener( this ); - m_xMyListenerImpl = Reference< XDynamicResultSetListener >( m_pMyListenerImpl ); + m_xMyListenerImpl.set( m_pMyListenerImpl ); //call impl_init() at the end of constructor of derived class }; @@ -146,7 +146,7 @@ void SAL_CALL DynamicResultSetWrapper::dispose() return; m_bInDispose = true; - xSourceComponent = Reference< XComponent >(m_xSource, UNO_QUERY); + xSourceComponent.set(m_xSource, UNO_QUERY); if( m_pDisposeEventListeners && m_pDisposeEventListeners->getLength() ) { @@ -341,7 +341,7 @@ Reference< XResultSet > SAL_CALL DynamicResultSetWrapper::getStaticResultSet() xSource = m_xSource; m_bStatic = true; - xMyListenerImpl = Reference< XEventListener > ::query( m_xMyListenerImpl ); + xMyListenerImpl.set( m_xMyListenerImpl, UNO_QUERY ); } if( xSource.is() ) diff --git a/ucb/source/core/FileAccess.cxx b/ucb/source/core/FileAccess.cxx index 21ffe5f..3dffc8d 100644 --- a/ucb/source/core/FileAccess.cxx +++ b/ucb/source/core/FileAccess.cxx @@ -570,7 +570,7 @@ Reference< XStream > OFileAccess::openFileReadWrite( const OUString& FileURL ) throw(CommandAbortedException, Exception, RuntimeException, std::exception) { Reference< XActiveDataStreamer > xSink = static_cast<XActiveDataStreamer*>(new OActiveDataStreamer()); - Reference< XInterface > xSinkIface = Reference< XInterface >::query( xSink ); + Reference< XInterface > xSinkIface( xSink, UNO_QUERY ); OpenCommandArgument2 aArg; aArg.Mode = OpenMode::DOCUMENT; diff --git a/ucb/source/core/provprox.cxx b/ucb/source/core/provprox.cxx index b77ab69..70d3d94 100644 --- a/ucb/source/core/provprox.cxx +++ b/ucb/source/core/provprox.cxx @@ -310,9 +310,7 @@ UcbContentProviderProxy::getContentProvider() { try { - m_xProvider - = Reference< XContentProvider >( - m_xSMgr->createInstance( m_aService ), UNO_QUERY ); + m_xProvider.set( m_xSMgr->createInstance( m_aService ), UNO_QUERY ); if ( m_aArguments == "NoConfig" ) { Reference<XInitialization> xInit(m_xProvider,UNO_QUERY); diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index 0bd9b92..7ed2fff 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -905,8 +905,7 @@ bool UniversalContentBroker::getContentProviderData( if ( !m_xNotifier.is() ) { - m_xNotifier = uno::Reference< util::XChangesNotifier >( - xInterface, uno::UNO_QUERY_THROW ); + m_xNotifier.set( xInterface, uno::UNO_QUERY_THROW ); m_xNotifier->addChangesListener( this ); } diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx index 3a7ff47..935ba2f 100644 --- a/ucb/source/core/ucbcmds.cxx +++ b/ucb/source/core/ucbcmds.cxx @@ -966,8 +966,7 @@ uno::Reference< io::XInputStream > getInputStream( xCommandProcessorS->execute( aOpenCommand, 0, rContext.xEnv ); - xInputStream = uno::Reference< io::XInputStream >( - xOutputStream, uno::UNO_QUERY ); + xInputStream.set( xOutputStream, uno::UNO_QUERY ); } catch ( uno::RuntimeException const & ) { diff --git a/ucb/source/sorter/sortdynres.cxx b/ucb/source/sorter/sortdynres.cxx index a26c2b0..63075b2 100644 --- a/ucb/source/sorter/sortdynres.cxx +++ b/ucb/source/sorter/sortdynres.cxx @@ -65,7 +65,7 @@ SortedDynamicResultSet::SortedDynamicResultSet( mpDisposeEventListeners = NULL; mpOwnListener = new SortedDynamicResultSetListener( this ); - mxOwnListener = Reference< XDynamicResultSetListener >( mpOwnListener ); + mxOwnListener.set( mpOwnListener ); mxOriginal = xOriginal; maOptions = aOptions; diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx index bc0f7e0..64d3ec0 100644 --- a/ucb/source/sorter/sortresult.cxx +++ b/ucb/source/sorter/sortresult.cxx @@ -978,8 +978,8 @@ sal_IntPtr SortedResultSet::CompareImpl( Reference < XResultSet > xResultOne, throw( SQLException, RuntimeException ) { - Reference < XRow > xRowOne = Reference< XRow >::query( xResultOne ); - Reference < XRow > xRowTwo = Reference< XRow >::query( xResultTwo ); + Reference < XRow > xRowOne( xResultOne, UNO_QUERY ); + Reference < XRow > xRowTwo( xResultTwo, UNO_QUERY ); sal_IntPtr nCompare = 0; sal_IntPtr nColumn = pSortInfo->mnColumn; diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 3e52ffb..c504605 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -1506,9 +1506,9 @@ namespace cmis if ( !xSink.is() ) return false; - uno::Reference< io::XOutputStream > xOut = uno::Reference< io::XOutputStream >(xSink, uno::UNO_QUERY ); - uno::Reference< io::XActiveDataSink > xDataSink = uno::Reference< io::XActiveDataSink >(xSink, uno::UNO_QUERY ); - uno::Reference< io::XActiveDataStreamer > xDataStreamer = uno::Reference< io::XActiveDataStreamer >( xSink, uno::UNO_QUERY ); + uno::Reference< io::XOutputStream > xOut(xSink, uno::UNO_QUERY ); + uno::Reference< io::XActiveDataSink > xDataSink(xSink, uno::UNO_QUERY ); + uno::Reference< io::XActiveDataStreamer > xDataStreamer( xSink, uno::UNO_QUERY ); if ( !xOut.is() && !xDataSink.is() && ( !xDataStreamer.is() || !xDataStreamer->getStream().is() ) ) return false; diff --git a/ucb/source/ucp/cmis/cmis_datasupplier.cxx b/ucb/source/ucp/cmis/cmis_datasupplier.cxx index 1958474..19754f8 100644 --- a/ucb/source/ucp/cmis/cmis_datasupplier.cxx +++ b/ucb/source/ucp/cmis/cmis_datasupplier.cxx @@ -157,7 +157,7 @@ namespace cmis void DataSupplier::releasePropertyValues( sal_uInt32 nIndex ) { if ( nIndex < maResults.size() ) - maResults[ nIndex ]->xRow = uno::Reference< sdbc::XRow >(); + maResults[ nIndex ]->xRow.clear(); } void DataSupplier::close() diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx index 9debd71..92c8e63 100644 --- a/ucb/source/ucp/file/bc.cxx +++ b/ucb/source/ucp/file/bc.cxx @@ -1238,8 +1238,7 @@ void SAL_CALL BaseContent::insert( sal_Int32 nMyCommandIdentifier, if ( ! success ) return; - FileContentIdentifier* p = new FileContentIdentifier( m_aUncPath ); - m_xContentIdentifier = Reference< XContentIdentifier >( p ); + m_xContentIdentifier.set( new FileContentIdentifier( m_aUncPath ) ); m_pMyShell->registerNotifier( m_aUncPath,this ); m_pMyShell->insertDefaultProperties( m_aUncPath ); @@ -1286,7 +1285,7 @@ BaseContent::cEXC( const OUString& aNewName ) Reference< XContentIdentifier > xOldRef = m_xContentIdentifier; m_aUncPath = aNewName; FileContentIdentifier* pp = new FileContentIdentifier( aNewName ); - m_xContentIdentifier = Reference< XContentIdentifier >( pp ); + m_xContentIdentifier.set( pp ); ContentEventNotifier* p = 0; if( m_pContentEventListeners ) diff --git a/ucb/source/ucp/file/filrset.cxx b/ucb/source/ucp/file/filrset.cxx index e4d8159..d843874 100644 --- a/ucb/source/ucp/file/filrset.cxx +++ b/ucb/source/ucp/file/filrset.cxx @@ -560,9 +560,7 @@ XResultSet_impl::queryContentIdentifier( { if( ! m_aIdents[m_nRow].is() ) { - FileContentIdentifier* p - = new FileContentIdentifier( m_aUnqPath[ m_nRow ] ); - m_aIdents[m_nRow] = uno::Reference< ucb::XContentIdentifier >(p); + m_aIdents[m_nRow].set( new FileContentIdentifier( m_aUnqPath[ m_nRow ] ) ); } return m_aIdents[m_nRow]; } diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx index ba3e638..d513639 100644 --- a/ucb/source/ucp/file/prov.cxx +++ b/ucb/source/ucp/file/prov.cxx @@ -447,7 +447,7 @@ void SAL_CALL FileProvider::initProperties() // static const sal_Int32 MAC_NOTATION = (sal_Int32)3; XPropertySetInfoImpl2* p = new XPropertySetInfoImpl2(); - m_xPropertySetInfo = Reference< XPropertySetInfo >( p ); + m_xPropertySetInfo.set( p ); } } diff --git a/ucb/source/ucp/ftp/ftpdynresultset.cxx b/ucb/source/ucp/ftp/ftpdynresultset.cxx index b53fc90..2e764f6 100644 --- a/ucb/source/ucp/ftp/ftpdynresultset.cxx +++ b/ucb/source/ucp/ftp/ftpdynresultset.cxx @@ -63,13 +63,13 @@ DynamicResultSet::~DynamicResultSet() void DynamicResultSet::initStatic() { - m_xResultSet1 = Reference< XResultSet >( m_pFactory->createResultSet() ); + m_xResultSet1.set( m_pFactory->createResultSet() ); } void DynamicResultSet::initDynamic() { - m_xResultSet1 = Reference< XResultSet >( m_pFactory->createResultSet() ); + m_xResultSet1.set( m_pFactory->createResultSet() ); m_xResultSet2 = m_xResultSet1; } diff --git a/ucb/source/ucp/ftp/ftpresultsetI.cxx b/ucb/source/ucp/ftp/ftpresultsetI.cxx index 89e1367..7488449 100644 --- a/ucb/source/ucp/ftp/ftpresultsetI.cxx +++ b/ucb/source/ucp/ftp/ftpresultsetI.cxx @@ -90,7 +90,7 @@ ResultSetI::ResultSetI(const Reference<XComponentContext>& rxContext, else xRow->appendVoid(seqProp[i]); } - m_aItems[n] = Reference<XRow>(xRow.get()); + m_aItems[n].set(xRow.get()); } } diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx index 5fc3e8e..41a5a89 100644 --- a/ucb/source/ucp/gio/gio_content.cxx +++ b/ucb/source/ucp/gio/gio_content.cxx @@ -834,8 +834,8 @@ bool Content::feedSink( uno::Reference< uno::XInterface > xSink, if ( !xSink.is() ) return false; - uno::Reference< io::XOutputStream > xOut = uno::Reference< io::XOutputStream >(xSink, uno::UNO_QUERY ); - uno::Reference< io::XActiveDataSink > xDataSink = uno::Reference< io::XActiveDataSink >(xSink, uno::UNO_QUERY ); + uno::Reference< io::XOutputStream > xOut(xSink, uno::UNO_QUERY ); + uno::Reference< io::XActiveDataSink > xDataSink(xSink, uno::UNO_QUERY ); if ( !xOut.is() && !xDataSink.is() ) return false; diff --git a/ucb/source/ucp/gio/gio_datasupplier.cxx b/ucb/source/ucp/gio/gio_datasupplier.cxx index 02c1e11..cabe444 100644 --- a/ucb/source/ucp/gio/gio_datasupplier.cxx +++ b/ucb/source/ucp/gio/gio_datasupplier.cxx @@ -256,7 +256,7 @@ uno::Reference< sdbc::XRow > DataSupplier::queryPropertyValues( sal_uInt32 nInde void DataSupplier::releasePropertyValues( sal_uInt32 nIndex ) { if ( nIndex < maResults.size() ) - maResults[ nIndex ]->xRow = uno::Reference< sdbc::XRow >(); + maResults[ nIndex ]->xRow.clear(); } void DataSupplier::close() diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx index 5d5efeb..0d84c4e 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx @@ -973,8 +973,7 @@ uno::Reference< sdbc::XRow > HierarchyContent::getPropertyValues( if ( !bTriedToGetAdditionalPropSet && !xAdditionalPropSet.is() ) { - xAdditionalPropSet - = uno::Reference< beans::XPropertySet >( + xAdditionalPropSet.set( pProvider->getAdditionalPropertySet( rContentId, false ), uno::UNO_QUERY ); diff --git a/ucb/source/ucp/hierarchy/hierarchydata.cxx b/ucb/source/ucp/hierarchy/hierarchydata.cxx index 0e2ff62..bd48fe9 100644 --- a/ucb/source/ucp/hierarchy/hierarchydata.cxx +++ b/ucb/source/ucp/hierarchy/hierarchydata.cxx @@ -265,7 +265,7 @@ bool HierarchyEntry::setData( osl::Guard< osl::Mutex > aGuard( m_aMutex ); if ( !m_xConfigProvider.is() ) - m_xConfigProvider = uno::Reference< lang::XMultiServiceFactory >( + m_xConfigProvider.set( m_xContext->getServiceManager()->createInstanceWithContext(m_aServiceSpecifier, m_xContext), uno::UNO_QUERY ); @@ -367,8 +367,7 @@ bool HierarchyEntry::setData( // Special handling for children of root, // which is not an entry. It's only a set // of entries. - xFac = uno::Reference< lang::XSingleServiceFactory >( - xParentNameAccess, uno::UNO_QUERY ); + xFac.set( xParentNameAccess, uno::UNO_QUERY ); } else { @@ -382,18 +381,14 @@ bool HierarchyEntry::setData( if ( xFac.is() ) { - xNameReplace - = uno::Reference< container::XNameReplace >( - xFac->createInstance(), uno::UNO_QUERY ); + xNameReplace.set( xFac->createInstance(), uno::UNO_QUERY ); OSL_ENSURE( xNameReplace.is(), "HierarchyEntry::setData - No name replace!" ); if ( xNameReplace.is() ) { - xContainer - = uno::Reference< container::XNameContainer >( - xFac, uno::UNO_QUERY ); + xContainer.set( xFac, uno::UNO_QUERY ); OSL_ENSURE( xContainer.is(), "HierarchyEntry::setData - No container!" ); @@ -517,7 +512,7 @@ bool HierarchyEntry::move( try { if ( !m_xConfigProvider.is() ) - m_xConfigProvider = uno::Reference< lang::XMultiServiceFactory >( + m_xConfigProvider.set( m_xContext->getServiceManager()->createInstanceWithContext(m_aServiceSpecifier, m_xContext), uno::UNO_QUERY ); @@ -557,7 +552,7 @@ bool HierarchyEntry::move( aProperty.Value <<= aOldParentPath; aArguments[ 0 ] <<= aProperty; - xOldParentBatch = uno::Reference< util::XChangesBatch >( + xOldParentBatch.set( m_xConfigProvider->createInstanceWithArguments( READWRITE_SERVICE_NAME, aArguments ), @@ -581,7 +576,7 @@ bool HierarchyEntry::move( aProperty.Value <<= aNewParentPath; aArguments[ 0 ] <<= aProperty; - xNewParentBatch = uno::Reference< util::XChangesBatch >( + xNewParentBatch.set( m_xConfigProvider->createInstanceWithArguments( READWRITE_SERVICE_NAME, aArguments ), @@ -616,9 +611,7 @@ bool HierarchyEntry::move( try { - xOldParentNameAccess - = uno::Reference< container::XNameAccess >( - xOldParentBatch, uno::UNO_QUERY ); + xOldParentNameAccess.set( xOldParentBatch, uno::UNO_QUERY ); OSL_ENSURE( xOldParentNameAccess.is(), "HierarchyEntry::move - No name access!" ); @@ -628,8 +621,7 @@ bool HierarchyEntry::move( if ( bOldRoot ) { - xOldNameContainer = uno::Reference< container::XNameContainer >( - xOldParentNameAccess, uno::UNO_QUERY ); + xOldNameContainer.set( xOldParentNameAccess, uno::UNO_QUERY ); } else { @@ -687,9 +679,7 @@ bool HierarchyEntry::move( uno::Reference< container::XNameAccess > xNewParentNameAccess; if ( bDifferentParents ) - xNewParentNameAccess - = uno::Reference< container::XNameAccess >( - xNewParentBatch, uno::UNO_QUERY ); + xNewParentNameAccess.set( xNewParentBatch, uno::UNO_QUERY ); else xNewParentNameAccess = xOldParentNameAccess; @@ -704,9 +694,7 @@ bool HierarchyEntry::move( { if ( bNewRoot ) { - xNewNameContainer - = uno::Reference< container::XNameContainer >( - xNewParentNameAccess, uno::UNO_QUERY ); + xNewNameContainer.set( xNewParentNameAccess, uno::UNO_QUERY ); } else { @@ -783,7 +771,7 @@ bool HierarchyEntry::remove() osl::Guard< osl::Mutex > aGuard( m_aMutex ); if ( !m_xConfigProvider.is() ) - m_xConfigProvider = uno::Reference< lang::XMultiServiceFactory >( + m_xConfigProvider.set( m_xContext->getServiceManager()->createInstanceWithContext(m_aServiceSpecifier, m_xContext), uno::UNO_QUERY ); @@ -838,8 +826,7 @@ bool HierarchyEntry::remove() // Special handling for children of root, // which is not an entry. It's only a set // of entries. - xContainer = uno::Reference< container::XNameContainer >( - xParentNameAccess, uno::UNO_QUERY ); + xContainer.set( xParentNameAccess, uno::UNO_QUERY ); } else { @@ -915,9 +902,7 @@ bool HierarchyEntry::first( iterator& it ) >>= xNameAccess; } else - xNameAccess - = uno::Reference< container::XNameAccess >( - xRootHierNameAccess, uno::UNO_QUERY ); + xNameAccess.set( xRootHierNameAccess, uno::UNO_QUERY ); OSL_ENSURE( xNameAccess.is(), "HierarchyEntry::first - No name access!" ); @@ -1036,8 +1021,7 @@ HierarchyEntry::getRootReadAccess() try { if ( !m_xConfigProvider.is() ) - m_xConfigProvider - = uno::Reference< lang::XMultiServiceFactory >( + m_xConfigProvider.set( m_xContext->getServiceManager()->createInstanceWithContext(m_aServiceSpecifier, m_xContext), uno::UNO_QUERY ); @@ -1053,8 +1037,7 @@ HierarchyEntry::getRootReadAccess() m_bTriedToGetRootReadAccess = true; - m_xRootReadAccess - = uno::Reference< container::XHierarchicalNameAccess >( + m_xRootReadAccess.set( m_xConfigProvider->createInstanceWithArguments( READ_SERVICE_NAME, aArguments ), diff --git a/ucb/source/ucp/hierarchy/hierarchydatasource.cxx b/ucb/source/ucp/hierarchy/hierarchydatasource.cxx index 217aaab..d3cdf8f 100644 --- a/ucb/source/ucp/hierarchy/hierarchydatasource.cxx +++ b/ucb/source/ucp/hierarchy/hierarchydatasource.cxx @@ -606,9 +606,7 @@ bool HierarchyDataSource::createConfigPath( { \ osl::Guard< osl::Mutex > aGuard( m_aMutex ); \ if ( !m_xCfg##member_name.is() ) \ - m_xCfg##member_name \ - = uno::Reference< interface_name >( \ - m_xConfigAccess, uno::UNO_QUERY ); \ + m_xCfg##member_name.set( m_xConfigAccess, uno::UNO_QUERY ); \ xOrig = m_xCfg##member_name; \ } diff --git a/ucb/source/ucp/hierarchy/hierarchydatasupplier.cxx b/ucb/source/ucp/hierarchy/hierarchydatasupplier.cxx index dd3e1bf..de1ada0 100644 --- a/ucb/source/ucp/hierarchy/hierarchydatasupplier.cxx +++ b/ucb/source/ucp/hierarchy/hierarchydatasupplier.cxx @@ -383,7 +383,7 @@ void HierarchyResultSetDataSupplier::releasePropertyValues( sal_uInt32 nIndex ) osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); if ( nIndex < m_pImpl->m_aResults.size() ) - m_pImpl->m_aResults[ nIndex ]->xRow = uno::Reference< sdbc::XRow >(); + m_pImpl->m_aResults[ nIndex ]->xRow.clear(); } diff --git a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx index 241ea55..b63fd36 100644 --- a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx +++ b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx @@ -186,8 +186,7 @@ HierarchyContentProvider::getConfigProvider( try { ConfigProviderMapEntry aEntry; - aEntry.xConfigProvider - = uno::Reference< lang::XMultiServiceFactory >( + aEntry.xConfigProvider.set( m_xContext->getServiceManager()->createInstanceWithContext(rServiceSpecifier, m_xContext), uno::UNO_QUERY ); @@ -246,8 +245,7 @@ HierarchyContentProvider::getRootConfigReadNameAccess( (*it).second.bTriedToGetRootReadAccess = true; - (*it).second.xRootReadAccess - = uno::Reference< container::XHierarchicalNameAccess >( + (*it).second.xRootReadAccess.set( xConfigProv->createInstanceWithArguments( "com.sun.star.ucb.HierarchyDataReadAccess", aArguments ), diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx index 0e79ffa..42da216 100644 --- a/ucb/source/ucp/package/pkgcontent.cxx +++ b/ucb/source/ucp/package/pkgcontent.cxx @@ -891,8 +891,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( if ( !bTriedToGetAdditionalPropSet && !xAdditionalPropSet.is() ) { - xAdditionalPropSet - = uno::Reference< beans::XPropertySet >( + xAdditionalPropSet.set( rProvider->getAdditionalPropertySet( rContentId, false ), uno::UNO_QUERY ); diff --git a/ucb/source/ucp/package/pkgdatasupplier.cxx b/ucb/source/ucp/package/pkgdatasupplier.cxx index fa02008..32d893a 100644 --- a/ucb/source/ucp/package/pkgdatasupplier.cxx +++ b/ucb/source/ucp/package/pkgdatasupplier.cxx @@ -432,7 +432,7 @@ void DataSupplier::releasePropertyValues( sal_uInt32 nIndex ) osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); if ( nIndex < m_pImpl->m_aResults.size() ) - m_pImpl->m_aResults[ nIndex ]->xRow = uno::Reference< sdbc::XRow >(); + m_pImpl->m_aResults[ nIndex ]->xRow.clear(); } diff --git a/ucb/source/ucp/package/pkgprovider.cxx b/ucb/source/ucp/package/pkgprovider.cxx index 5362c6f..3a0ed71 100644 --- a/ucb/source/ucp/package/pkgprovider.cxx +++ b/ucb/source/ucp/package/pkgprovider.cxx @@ -240,7 +240,7 @@ ContentProvider::createPackage( const PackageUri & rURI ) uno::Reference< container::XHierarchicalNameAccess > xNameAccess; try { - xNameAccess = uno::Reference< container::XHierarchicalNameAccess >( + xNameAccess.set( m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext( "com.sun.star.packages.comp.ZipPackage", aArguments, m_xContext ), diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index b350f31..7b48aa0 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -1005,8 +1005,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( if ( !bTriedToGetAdditionalPropSet && !xAdditionalPropSet.is() ) { - xAdditionalPropSet - = uno::Reference< beans::XPropertySet >( + xAdditionalPropSet.set( pProvider->getAdditionalPropertySet( rContentId, false ), uno::UNO_QUERY ); diff --git a/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx b/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx index ecf725c..0777123 100644 --- a/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx +++ b/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx @@ -378,7 +378,7 @@ void ResultSetDataSupplier::releasePropertyValues( sal_uInt32 nIndex ) osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); if ( nIndex < m_pImpl->m_aResults.size() ) - m_pImpl->m_aResults[ nIndex ]->xRow = uno::Reference< sdbc::XRow >(); + m_pImpl->m_aResults[ nIndex ]->xRow.clear(); } // virtual diff --git a/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx b/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx index cef7495..c896e83 100644 --- a/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx +++ b/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx @@ -115,10 +115,8 @@ DocumentContentFactory::createDocumentContent( uno::Reference< frame::XTransientDocumentsDocumentContentFactory > xDocFac; try { - xDocFac - = uno::Reference< frame::XTransientDocumentsDocumentContentFactory >( - m_xSMgr->createInstance("com.sun.star.ucb.TransientDocumentsContentProvider"), - uno::UNO_QUERY ); + xDocFac.set( m_xSMgr->createInstance("com.sun.star.ucb.TransientDocumentsContentProvider"), + uno::UNO_QUERY ); } catch ( uno::Exception const & ) { diff --git a/ucb/source/ucp/tdoc/tdoc_storage.cxx b/ucb/source/ucp/tdoc/tdoc_storage.cxx index 964fab0..f43bee8 100644 --- a/ucb/source/ucp/tdoc/tdoc_storage.cxx +++ b/ucb/source/ucp/tdoc/tdoc_storage.cxx @@ -73,9 +73,7 @@ StorageElementFactory::createTemporaryStorage() OSL_ENSURE( xStorageFac.is(), "Can't create storage factory!" ); if ( xStorageFac.is() ) - xStorage = uno::Reference< embed::XStorage >( - xStorageFac->createInstance(), - uno::UNO_QUERY ); + xStorage.set( xStorageFac->createInstance(), uno::UNO_QUERY ); if ( !xStorage.is() ) throw uno::RuntimeException(); diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index 275f8c5..a2ce660 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -1177,8 +1177,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // Process local Additional Properties. if ( !bTriedToGetAdditionalPropSet && !xAdditionalPropSet.is() ) { - xAdditionalPropSet - = uno::Reference< beans::XPropertySet >( + xAdditionalPropSet.set( rProvider->getAdditionalPropertySet( rContentId, false ), uno::UNO_QUERY ); @@ -1999,8 +1998,7 @@ uno::Any Content::open( // Unreachable } - uno::Reference< io::XOutputStream > xOut - = uno::Reference< io::XOutputStream >( rArg.Sink, uno::UNO_QUERY ); + uno::Reference< io::XOutputStream > xOut( rArg.Sink, uno::UNO_QUERY ); if ( xOut.is() ) { // PUSH: write data @@ -2044,9 +2042,7 @@ uno::Any Content::open( } else { - uno::Reference< io::XActiveDataSink > xDataSink - = uno::Reference< io::XActiveDataSink >( rArg.Sink, - uno::UNO_QUERY ); + uno::Reference< io::XActiveDataSink > xDataSink( rArg.Sink, uno::UNO_QUERY ); if ( xDataSink.is() ) { // PULL: wait for client read diff --git a/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx b/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx index dc86ddb..3213749 100644 --- a/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx +++ b/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx @@ -319,7 +319,7 @@ void DataSupplier::releasePropertyValues( sal_uInt32 nIndex ) osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); if (nIndex < m_pImpl->m_Results.size()) - m_pImpl->m_Results[ nIndex ]->xRow = uno::Reference< sdbc::XRow >(); + m_pImpl->m_Results[ nIndex ]->xRow.clear(); } diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx index 469e536..9dbfd92 100644 --- a/ucb/source/ucp/webdav/webdavcontent.cxx +++ b/ucb/source/ucp/webdav/webdavcontent.cxx @@ -1283,8 +1283,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // Process local Additional Properties. if ( !bTriedToGetAdditionalPropSet && !xAdditionalPropSet.is() ) { - xAdditionalPropSet - = uno::Reference< beans::XPropertySet >( + xAdditionalPropSet.set( rProvider->getAdditionalPropertySet( rContentId, false ), uno::UNO_QUERY ); @@ -2141,8 +2140,7 @@ uno::Any Content::open( // Unreachable } - uno::Reference< io::XOutputStream > xOut - = uno::Reference< io::XOutputStream >( rArg.Sink, uno::UNO_QUERY ); + uno::Reference< io::XOutputStream > xOut( rArg.Sink, uno::UNO_QUERY ); if ( xOut.is() ) { // PUSH: write data @@ -2185,9 +2183,7 @@ uno::Any Content::open( } else { - uno::Reference< io::XActiveDataSink > xDataSink - = uno::Reference< io::XActiveDataSink >( rArg.Sink, - uno::UNO_QUERY ); + uno::Reference< io::XActiveDataSink > xDataSink( rArg.Sink, uno::UNO_QUERY ); if ( xDataSink.is() ) { // PULL: wait for client read diff --git a/ucb/source/ucp/webdav/webdavdatasupplier.cxx b/ucb/source/ucp/webdav/webdavdatasupplier.cxx index 3fa7d86..c2ad2a1 100644 --- a/ucb/source/ucp/webdav/webdavdatasupplier.cxx +++ b/ucb/source/ucp/webdav/webdavdatasupplier.cxx @@ -315,7 +315,7 @@ void DataSupplier::releasePropertyValues( sal_uInt32 nIndex ) osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); if ( nIndex < m_pImpl->m_aResults.size() ) - m_pImpl->m_aResults[ nIndex ]->xRow = uno::Reference< sdbc::XRow >(); + m_pImpl->m_aResults[ nIndex ]->xRow.clear(); } commit f9a6e75e21e9919a405a1964d85345a1c0634067 Author: Noel Grandin <[email protected]> Date: Thu Nov 5 10:25:49 2015 +0200 use uno::Reference::set method instead of assignmen Change-Id: I76671a74150791e1a74ece3d5bcf40fd6c727ac7 diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 1286891..cb91303 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -642,7 +642,7 @@ DECLARE_ODFEXPORT_TEST(testFdo43807, "fdo43807.odt") uno::Reference<beans::XPropertySet> xSet(getParagraph(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("Drop Caps"),getProperty<OUString>(xSet,"DropCapCharStyleName")); - xSet = uno::Reference<beans::XPropertySet>(getParagraph(2), uno::UNO_QUERY); + xSet.set(getParagraph(2), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("User Defined Drop Caps"),getProperty<OUString>(xSet,"DropCapCharStyleName")); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index d6cd49c..63cd8ed2 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -188,7 +188,7 @@ DECLARE_OOXMLEXPORT_TEST(testStyleInheritance, "style-inheritance.docx") // This was 0, as export of w:outlineLvl was missing. CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty<sal_Int32>(properties, "OutlineLevel")); - properties = uno::Reference< beans::XPropertySet >(paragraphStyles->getByName("Heading 11"), uno::UNO_QUERY); + properties.set(paragraphStyles->getByName("Heading 11"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), getProperty<OUString>(properties, "FollowStyle")); // Make sure style #2 is Heading 1. diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 7e5eaab..9ab5746 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -134,7 +134,7 @@ public: { OUString aURL(getURLFromSrc(mpTestDocumentPath) + OUString::createFromAscii(filename)); CPPUNIT_ASSERT_MESSAGE("no desktop", mxDesktop.is()); - uno::Reference<frame::XComponentLoader> xLoader = uno::Reference<frame::XComponentLoader>(mxDesktop, uno::UNO_QUERY); + uno::Reference<frame::XComponentLoader> xLoader(mxDesktop, uno::UNO_QUERY); CPPUNIT_ASSERT_MESSAGE("no loader", xLoader.is()); uno::Sequence<beans::PropertyValue> args(1); args[0].Name = "DocumentService"; @@ -2119,7 +2119,7 @@ DECLARE_OOXMLIMPORT_TEST(testDMLGroupShapeRunFonts, "dml-groupshape-runfonts.doc { // Fonts defined by w:rFonts was not imported and so the font specified by a:fontRef was used. uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); - uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY)->getText(); + uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY)->getText(); uno::Reference<text::XTextRange> xRun = getRun(getParagraphOfText(1, xText),1); CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xRun, "CharFontName")); CPPUNIT_ASSERT_EQUAL(OUString("Arial Unicode MS"), getProperty<OUString>(xRun, "CharFontNameComplex")); diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index 9c100c7..f962e82 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -142,7 +142,7 @@ void SwChartLockController_Helper::LockUnlockAllCharts( bool bLock ) uno::Reference < embed::XEmbeddedObject > xIP = pONd->GetOLEObj().GetOleRef(); if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) ) { - xRes = uno::Reference < frame::XModel >( xIP->getComponent(), uno::UNO_QUERY ); + xRes.set( xIP->getComponent(), uno::UNO_QUERY ); if (xRes.is()) { if (bLock) @@ -2696,10 +2696,10 @@ void SwChartLabeledDataSequence::SetDataSequence( rxDest = rxSource; // start listening to new data-sequence - xC = uno::Reference< lang::XComponent >( rxDest, uno::UNO_QUERY ); + xC.set( rxDest, uno::UNO_QUERY ); if (xC.is()) xC->addEventListener( xEL ); - xMB = uno::Reference< util::XModifyBroadcaster >( rxDest, uno::UNO_QUERY ); + xMB.set( rxDest, uno::UNO_QUERY ); if (xMB.is()) xMB->addModifyListener( xML ); } diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index da746b0..9953b6c 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -991,9 +991,8 @@ void InsertFile(SwUnoCrsr* pUnoCrsr, const OUString& rURL, aArgs[1] <<= embed::ElementModes::READ; try { - xReadStorage = uno::Reference< embed::XStorage >( - ::comphelper::OStorageHelper::GetStorageFactory()->createInstanceWithArguments( aArgs ), - uno::UNO_QUERY ); + xReadStorage.set( ::comphelper::OStorageHelper::GetStorageFactory()->createInstanceWithArguments( aArgs ), + uno::UNO_QUERY ); } catch( const io::IOException& rEx) { diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index d957a74..7e351a7 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -364,7 +364,7 @@ uno::Reference< drawing::XShape > SwFmDrawPage::_CreateShape( SdrObject *pObj ) xPrSet = new SwXGroupShape( xCreate ); else xPrSet = new SwXShape( xCreate ); - xRet = uno::Reference< drawing::XShape >(xPrSet, uno::UNO_QUERY); + xRet.set(xPrSet, uno::UNO_QUERY); } } return xRet; @@ -403,7 +403,7 @@ SwXShapesEnumeration::SwXShapesEnumeration(SwXDrawPage* const pDrawPage) std::set<const SwFrameFormat*> aTextBoxes = SwTextBoxHelper::findTextBoxes(pDrawPage->GetDoc()); for(sal_Int32 nIdx = 0; nIdx < nCount; nIdx++) { - uno::Reference<drawing::XShape> xShape = uno::Reference<drawing::XShape>(pDrawPage->getByIndex(nIdx, &aTextBoxes), uno::UNO_QUERY); + uno::Reference<drawing::XShape> xShape(pDrawPage->getByIndex(nIdx, &aTextBoxes), uno::UNO_QUERY); *pInserter++ = uno::makeAny(xShape); } } @@ -806,7 +806,7 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference< if(pContact) { uno::Reference< uno::XInterface > xInt = SwFmDrawPage::GetInterface( pContact->GetMaster() ); - xRet = uno::Reference< drawing::XShapeGroup >(xInt, uno::UNO_QUERY); + xRet.set(xInt, uno::UNO_QUERY); } pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); } diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index b7cf85fc..a9dde64 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -857,8 +857,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::Reference<text::XTextField> const xField = SwXTextField::CreateXTextField(m_pImpl->m_pDoc, pField); - pRetSeq[i] = uno::Reference<text::XDependentTextField>(xField, - uno::UNO_QUERY); + pRetSeq[i].set(xField, uno::UNO_QUERY); } aRet <<= aRetSeq; } diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index b077519..1941ff4 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -303,8 +303,7 @@ const uno::Reference< container::XIndexContainer >& SwHTMLForm_Impl::GetForms() uno::Reference< container::XNameContainer > xNameCont = xFormsSupplier->getForms(); - xForms = uno::Reference< container::XIndexContainer >( xNameCont, - UNO_QUERY ); + xForms.set( xNameCont, UNO_QUERY ); OSL_ENSURE( xForms.is(), "XForms nicht erhalten" ); } @@ -319,7 +318,7 @@ const uno::Reference< drawing::XShapes > & SwHTMLForm_Impl::GetShapes() GetDrawPage(); if( xDrawPage.is() ) { - xShapes = uno::Reference< drawing::XShapes >( xDrawPage, UNO_QUERY ); + xShapes.set( xDrawPage, UNO_QUERY ); OSL_ENSURE( xShapes.is(), "XShapes nicht vom drawing::XDrawPage erhalten" ); } @@ -418,7 +417,7 @@ SwHTMLImageWatcher::SwHTMLImageWatcher( uno::Reference< drawing::XControlShape > xControlShape( xShape, UNO_QUERY ); uno::Reference< awt::XControlModel > xControlModel( xControlShape->getControl() ); - xSrc = uno::Reference< XImageProducerSupplier >( xControlModel, UNO_QUERY ); + xSrc.set( xControlModel, UNO_QUERY ); OSL_ENSURE( xSrc.is(), "Kein XImageProducerSupplier" ); // Als Event-Listener am Shape anmelden, damit wir es beim dispose @@ -895,7 +894,7 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl( if( !xCreate.is() ) return xShape; - xShape = uno::Reference< drawing::XShape >( xCreate, UNO_QUERY ); + xShape.set( xCreate, UNO_QUERY ); OSL_ENSURE( xShape.is(), "XShape nicht erhalten" ); awt::Size aTmpSz; diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index e5ab550..60a237a 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -421,7 +421,7 @@ bool DocxAttributeOutput::TextBoxIsFramePr(const SwFrameFormat& rFrameFormat) uno::Reference< drawing::XShape > xShape; const SdrObject* pSdrObj = rFrameFormat.FindRealSdrObject(); if (pSdrObj) - xShape = uno::Reference< drawing::XShape >(const_cast<SdrObject*>(pSdrObj)->getUnoShape(), uno::UNO_QUERY); + xShape.set(const_cast<SdrObject*>(pSdrObj)->getUnoShape(), uno::UNO_QUERY); uno::Reference< beans::XPropertySet > xPropertySet(xShape, uno::UNO_QUERY); uno::Reference< beans::XPropertySetInfo > xPropSetInfo; if (xPropertySet.is()) diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 361a9f5d..06023ee 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -1380,7 +1380,7 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* pParentFrame, int nAnchorId, bo uno::Reference< drawing::XShape > xShape; const SdrObject* pSdrObj = rFrameFormat.FindRealSdrObject(); if (pSdrObj) - xShape = uno::Reference< drawing::XShape >(const_cast<SdrObject*>(pSdrObj)->getUnoShape(), uno::UNO_QUERY); + xShape.set(const_cast<SdrObject*>(pSdrObj)->getUnoShape(), uno::UNO_QUERY); uno::Reference< beans::XPropertySet > xPropertySet(xShape, uno::UNO_QUERY); uno::Reference< beans::XPropertySetInfo > xPropSetInfo; if (xPropertySet.is()) diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 295bfb2..d948f8c 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -558,7 +558,7 @@ FlyProcessingState SwWW8AttrIter::OutFlys(sal_Int32 nSwPos) sw::Frame xFrame = *linkedTextboxesIter; const SdrObject* pSdrObj = xFrame.GetFrameFormat().FindRealSdrObject(); if( pSdrObj ) - xShape = uno::Reference< drawing::XShape >(const_cast<SdrObject*>(pSdrObj)->getUnoShape(), uno::UNO_QUERY); + xShape.set(const_cast<SdrObject*>(pSdrObj)->getUnoShape(), uno::UNO_QUERY); uno::Reference< beans::XPropertySet > xPropertySet(xShape, uno::UNO_QUERY); uno::Reference< beans::XPropertySetInfo > xPropertySetInfo; if( xPropertySet.is() ) diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index c4ea3b7..45cfa7b 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -367,8 +367,7 @@ static void WriteDop( WW8Export& rWrt ) if (pDocShell) { uno::Reference<lang::XComponent> xModelComp(pDocShell->GetModel(), uno::UNO_QUERY); - xProps = uno::Reference<beans::XPropertySet>(xModelComp, - uno::UNO_QUERY); + xProps.set(xModelComp, uno::UNO_QUERY); uno::Reference<document::XDocumentPropertiesSupplier> xDPS( xModelComp, uno::UNO_QUERY_THROW); xDocProps = xDPS->getDocumentProperties(); diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 0920d77..97670ad 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -2427,7 +2427,7 @@ bool WW8FormulaListBox::Import(const uno::Reference < if( !xCreate.is() ) return false; - rFComp = uno::Reference<form::XFormComponent>(xCreate, uno::UNO_QUERY); + rFComp.set(xCreate, uno::UNO_QUERY); if( !rFComp.is() ) return false; @@ -2519,7 +2519,7 @@ bool WW8FormulaCheckBox::Import(const uno::Reference < if( !xCreate.is() ) return false; - rFComp = uno::Reference< form::XFormComponent >( xCreate, uno::UNO_QUERY ); + rFComp.set( xCreate, uno::UNO_QUERY ); if( !rFComp.is() ) return false; diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx index e4ecd3e..f8e9e33 100644 --- a/sw/source/filter/xml/xmlfmt.cxx +++ b/sw/source/filter/xml/xmlfmt.cxx @@ -299,7 +299,7 @@ uno::Reference < style::XStyle > SwXMLTextStyleContext_Impl::Create() uno::Reference < uno::XInterface > xIfc = xFactory->createInstance( "com.sun.star.style.ConditionalParagraphStyle" ); if( xIfc.is() ) - xNewStyle = uno::Reference < style::XStyle >( xIfc, uno::UNO_QUERY ); + xNewStyle.set( xIfc, uno::UNO_QUERY ); } } else diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 8e27342..386326a 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -1356,7 +1356,7 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport, OSL_ENSURE( xIfc.is(), "Couldn't create a table" ); if( xIfc.is() ) - xTable = Reference< XTextTable > ( xIfc, UNO_QUERY ); + xTable.set( xIfc, UNO_QUERY ); } if( xTable.is() ) diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index a41b958..cd44b56 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -544,7 +544,7 @@ void SwAddressListDialog::DetectTablesAndQueries( { m_aDBData.sDataSource = SvTabListBox::GetEntryText(pSelect, ITEMID_NAME - 1); m_xDBContext->getByName(m_aDBData.sDataSource) >>= xComplConnection; - pUserData->xSource = uno::Reference<XDataSource>(xComplConnection, UNO_QUERY); + pUserData->xSource.set(xComplConnection, UNO_QUERY); uno::Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); uno::Reference< XInteractionHandler > xHandler( InteractionHandler::createWithParent(xContext, 0), UNO_QUERY ); diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 98da058..64bbe8e 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -1222,7 +1222,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, // every data set SwDBFormatData aDBFormatData; Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); - aDBFormatData.xFormatter = Reference<util::XNumberFormatter>(util::NumberFormatter::create(xContext), UNO_QUERY_THROW) ; + aDBFormatData.xFormatter.set(util::NumberFormatter::create(xContext), UNO_QUERY_THROW) ; Reference<XPropertySet> xSourceProps(xSource, UNO_QUERY); if(xSourceProps.is()) diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx index 9f87242..fe75d2f 100644 --- a/sw/source/ui/envelp/mailmrge.cxx +++ b/sw/source/ui/envelp/mailmrge.cxx @@ -230,10 +230,10 @@ SwMailMergeDlg::SwMailMergeDlg(vcl::Window* pParent, SwWrtShell& rShell, m_pBeamerWin->Show(); } uno::Reference<XController> xController = m_xFrame->getController(); - pImpl->xFController = uno::Reference<runtime::XFormController>(xController, UNO_QUERY); + pImpl->xFController.set(xController, UNO_QUERY); if(pImpl->xFController.is()) { uno::Reference< awt::XControl > xCtrl = pImpl->xFController->getCurrentControl( ); - pImpl->xSelSupp = uno::Reference<XSelectionSupplier>(xCtrl, UNO_QUERY); + pImpl->xSelSupp.set(xCtrl, UNO_QUERY); if(pImpl->xSelSupp.is()) { pImpl->xChgLstnr = new SwXSelChgLstnr_Impl(*this); pImpl->xSelSupp->addSelectionChangeListener( pImpl->xChgLstnr ); diff --git a/sw/source/ui/index/cntex.cxx b/sw/source/ui/index/cntex.cxx index 8867987..16ae310b 100644 --- a/sw/source/ui/index/cntex.cxx +++ b/sw/source/ui/index/cntex.cxx @@ -178,8 +178,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample( OUString sIndexTypeName(OUString::createFromAscii( IndexServiceNames[ nTOXIndex <= TOX_AUTHORITIES ? nTOXIndex : TOX_USER] )); - pxIndexSectionsArr[nTOXIndex]->xDocumentIndex = uno::Reference< text::XDocumentIndex > (xFact->createInstance( - sIndexTypeName), uno::UNO_QUERY); + pxIndexSectionsArr[nTOXIndex]->xDocumentIndex.set(xFact->createInstance(sIndexTypeName), uno::UNO_QUERY); uno::Reference< text::XTextContent > xContent(pxIndexSectionsArr[nTOXIndex]->xDocumentIndex, uno::UNO_QUERY); uno::Reference< text::XTextRange > xRg(xCrsr, uno::UNO_QUERY); xCrsr->getText()->insertTextContent(xRg, xContent, sal_False); diff --git a/sw/source/ui/vba/vbafind.cxx b/sw/source/ui/vba/vbafind.cxx index a846038..0f21e38 100644 --- a/sw/source/ui/vba/vbafind.cxx +++ b/sw/source/ui/vba/vbafind.cxx @@ -92,7 +92,7 @@ uno::Reference< text::XTextRange > SwVbaFind::FindOneElement() throw ( uno::Runt } else if( xFoundOne.is() && !InRange( xFoundOne ) ) { - xFoundOne = uno::Reference< text::XTextRange >(); + xFoundOne.clear(); } } else diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx index 09f6414..4d600a4 100644 --- a/sw/source/uibase/app/apphdl.cxx +++ b/sw/source/uibase/app/apphdl.cxx @@ -382,8 +382,7 @@ void SwMailMergeWizardExecutor::ExecuteMailMergeWizard( const SfxItemSet * pArgs aDescriptor[svx::daConnection] >>= xConnection; uno::Reference<container::XChild> xChild(xConnection, uno::UNO_QUERY); if(xChild.is()) - xSource = uno::Reference<sdbc::XDataSource>( - xChild->getParent(), uno::UNO_QUERY); + xSource.set(xChild->getParent(), uno::UNO_QUERY); m_pMMConfig->SetCurrentConnection( xSource, SharedConnection( xConnection, SharedConnection::NoTakeOwnership ), xColumnsSupplier, aDBData); diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index f65903d..49446b9 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -306,7 +306,7 @@ struct SwDBManager_Impl static void lcl_InitNumberFormatter(SwDSParam& rParam, uno::Reference<sdbc::XDataSource> xSource) { uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext(); - rParam.xFormatter = uno::Reference<util::XNumberFormatter>(util::NumberFormatter::create(xContext), uno::UNO_QUERY); + rParam.xFormatter.set(util::NumberFormatter::create(xContext), uno::UNO_QUERY); if(!xSource.is()) xSource = SwDBManager::getDataSourceAsParent(rParam.xConnection, rParam.sDataSource); @@ -690,7 +690,7 @@ bool SwDBManager::GetTableNames(ListBox* pListBox, const OUString& rDBName) } if(xConnection.is()) { - uno::Reference<sdbcx::XTablesSupplier> xTSupplier = uno::Reference<sdbcx::XTablesSupplier>(xConnection, uno::UNO_QUERY); + uno::Reference<sdbcx::XTablesSupplier> xTSupplier(xConnection, uno::UNO_QUERY); if(xTSupplier.is()) { uno::Reference<container::XNameAccess> xTables = xTSupplier->getTables(); @@ -702,7 +702,7 @@ bool SwDBManager::GetTableNames(ListBox* pListBox, const OUString& rDBName) pListBox->SetEntryData(nEntry, nullptr); } } - uno::Reference<sdb::XQueriesSupplier> xQSupplier = uno::Reference<sdb::XQueriesSupplier>(xConnection, uno::UNO_QUERY); + uno::Reference<sdb::XQueriesSupplier> xQSupplier(xConnection, uno::UNO_QUERY); if(xQSupplier.is()) { uno::Reference<container::XNameAccess> xQueries = xQSupplier->getQueries(); @@ -1694,7 +1694,7 @@ sal_uLong SwDBManager::GetColumnFormat( uno::Reference< sdbc::XDataSource> xSour { uno::Reference<container::XChild> xChild(xConnection, uno::UNO_QUERY); if ( xChild.is() ) - xSource = uno::Reference<sdbc::XDataSource>(xChild->getParent(), uno::UNO_QUERY); + xSource.set(xChild->getParent(), uno::UNO_QUERY); } if(xSource.is() && xConnection.is() && xColumn.is() && pNFormatr) { @@ -1779,7 +1779,7 @@ sal_Int32 SwDBManager::GetColumnType( const OUString& rDBName, if(pParam && pParam->xConnection.is()) { xConnection = pParam->xConnection; - xColsSupp = uno::Reference< sdbcx::XColumnsSupplier >( pParam->xResultSet, uno::UNO_QUERY ); + xColsSupp.set( pParam->xResultSet, uno::UNO_QUERY ); } else { @@ -1840,7 +1840,7 @@ uno::Reference< sdbcx::XColumnsSupplier> SwDBManager::GetColumnSupplier(uno::Ref if(eTableOrQuery == SwDBSelect::UNKNOWN) { //search for a table with the given command name - uno::Reference<sdbcx::XTablesSupplier> xTSupplier = uno::Reference<sdbcx::XTablesSupplier>(xConnection, uno::UNO_QUERY); + uno::Reference<sdbcx::XTablesSupplier> xTSupplier(xConnection, uno::UNO_QUERY); if(xTSupplier.is()) { uno::Reference<container::XNameAccess> xTables = xTSupplier->getTables(); @@ -1868,7 +1868,7 @@ uno::Reference< sdbcx::XColumnsSupplier> SwDBManager::GetColumnSupplier(uno::Ref xRowProperties->setPropertyValue("FetchSize", uno::makeAny((sal_Int32)10)); xRowProperties->setPropertyValue("ActiveConnection", uno::makeAny(xConnection)); xRowSet->execute(); - xRet = uno::Reference<sdbcx::XColumnsSupplier>( xRowSet, uno::UNO_QUERY ); + xRet.set( xRowSet, uno::UNO_QUERY ); } catch (const uno::Exception& e) { @@ -2970,7 +2970,7 @@ void SwDBManager::InsertText(SwWrtShell& rSh, uno::Reference<sdbc::XDataSource> xSource; uno::Reference<container::XChild> xChild(xConnection, uno::UNO_QUERY); if(xChild.is()) - xSource = uno::Reference<sdbc::XDataSource>(xChild->getParent(), uno::UNO_QUERY); + xSource.set(xChild->getParent(), uno::UNO_QUERY); if(!xSource.is()) xSource = dbtools::getDataSource(sDataSource, xContext); uno::Reference< sdbcx::XColumnsSupplier > xColSupp( xResSet, uno::UNO_QUERY ); @@ -3010,7 +3010,7 @@ uno::Reference<sdbc::XDataSource> SwDBManager::getDataSourceAsParent(const uno:: { uno::Reference<container::XChild> xChild(_xConnection, uno::UNO_QUERY); if ( xChild.is() ) - xSource = uno::Reference<sdbc::XDataSource>(xChild->getParent(), uno::UNO_QUERY); + xSource.set(xChild->getParent(), uno::UNO_QUERY); if ( !xSource.is() ) xSource = dbtools::getDataSource(_sDataSourceName, ::comphelper::getProcessComponentContext()); } @@ -3049,7 +3049,7 @@ uno::Reference<sdbc::XResultSet> SwDBManager::createCursor(const OUString& _sDat uno::Reference< task::XInteractionHandler > xHandler( task::InteractionHandler::createWithParent(comphelper::getComponentContext(xMgr), 0), uno::UNO_QUERY_THROW ); xRowSet->executeWithCompletion(xHandler); } - xResultSet = uno::Reference<sdbc::XResultSet>(xRowSet, uno::UNO_QUERY); + xResultSet.set(xRowSet, uno::UNO_QUERY); } } } diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx index 4ddad2a..48f2ff9 100644 --- a/sw/source/uibase/dbui/dbtree.cxx +++ b/sw/source/uibase/dbui/dbtree.cxx @@ -277,7 +277,7 @@ void SwDBTreeList::RequestingChildren(SvTreeListEntry* pParent) Reference<XColumnsSupplier> xColsSupplier; if(bTable) { - Reference<XTablesSupplier> xTSupplier = Reference<XTablesSupplier>(xConnection, UNO_QUERY); + Reference<XTablesSupplier> xTSupplier(xConnection, UNO_QUERY); if(xTSupplier.is()) { Reference<XNameAccess> xTables = xTSupplier->getTables(); @@ -287,7 +287,7 @@ void SwDBTreeList::RequestingChildren(SvTreeListEntry* pParent) Any aTable = xTables->getByName(sTableName); Reference<XPropertySet> xPropSet; aTable >>= xPropSet; - xColsSupplier = Reference<XColumnsSupplier>(xPropSet, UNO_QUERY); + xColsSupplier.set(xPropSet, UNO_QUERY); } catch (const Exception&) { @@ -296,7 +296,7 @@ void SwDBTreeList::RequestingChildren(SvTreeListEntry* pParent) } else { - Reference<XQueriesSupplier> xQSupplier = Reference<XQueriesSupplier>(xConnection, UNO_QUERY); + Reference<XQueriesSupplier> xQSupplier(xConnection, UNO_QUERY); if(xQSupplier.is()) { Reference<XNameAccess> xQueries = xQSupplier->getQueries(); @@ -306,7 +306,7 @@ void SwDBTreeList::RequestingChildren(SvTreeListEntry* pParent) Any aQuery = xQueries->getByName(sTableName); Reference<XPropertySet> xPropSet; aQuery >>= xPropSet; - xColsSupplier = Reference<XColumnsSupplier>(xPropSet, UNO_QUERY); + xColsSupplier.set(xPropSet, UNO_QUERY); } catch (const Exception&) { @@ -341,7 +341,7 @@ void SwDBTreeList::RequestingChildren(SvTreeListEntry* pParent) Reference<XConnection> xConnection = pImpl->GetConnection(sSourceName); if (xConnection.is()) { - Reference<XTablesSupplier> xTSupplier = Reference<XTablesSupplier>(xConnection, UNO_QUERY); + Reference<XTablesSupplier> xTSupplier(xConnection, UNO_QUERY); if(xTSupplier.is()) { Reference<XNameAccess> xTables = xTSupplier->getTables(); @@ -359,7 +359,7 @@ void SwDBTreeList::RequestingChildren(SvTreeListEntry* pParent) } } - Reference<XQueriesSupplier> xQSupplier = Reference<XQueriesSupplier>(xConnection, UNO_QUERY); + Reference<XQueriesSupplier> xQSupplier(xConnection, UNO_QUERY); if(xQSupplier.is()) { Reference<XNameAccess> xQueries = xQSupplier->getQueries(); diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx index 22160a2..1b49433 100644 --- a/sw/source/uibase/dbui/mailmergehelper.cxx +++ b/sw/source/uibase/dbui/mailmergehelper.cxx @@ -97,10 +97,7 @@ uno::Reference< mail::XSmtpService > ConnectToSmtpServer( { uno::Reference< mail::XMailServiceProvider > xMailServiceProvider( mail::MailServiceProvider::create( xContext ) ); - xSmtpServer = uno::Reference< mail::XSmtpService > ( - xMailServiceProvider->create( - mail::MailServiceType_SMTP - ), uno::UNO_QUERY); + xSmtpServer.set(xMailServiceProvider->create(mail::MailServiceType_SMTP), uno::UNO_QUERY); uno::Reference< mail::XConnectionListener> xConnectionListener(new SwConnectionListener()); @@ -155,7 +152,7 @@ uno::Reference< mail::XSmtpService > ConnectToSmtpServer( rConfigItem.GetMailPort(), rConfigItem.IsSecureConnection() ? OUString("Ssl") : OUString("Insecure") ); xSmtpServer->connect(xConnectionContext, xAuthenticator); - rxInMailService = uno::Reference< mail::XMailService >( xSmtpServer, uno::UNO_QUERY ); + rxInMailService.set( xSmtpServer, uno::UNO_QUERY ); } catch (const uno::Exception&) { diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 39bd292..4304394 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -691,7 +691,7 @@ bool SwTransferable::WriteObject( tools::SvRef<SotStorageStream>& xStream, bRet = true; xWorkStore->dispose(); - xWorkStore = uno::Reference < embed::XStorage >(); + xWorkStore.clear(); xStream->Commit(); } catch (const uno::Exception&) diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx index cc180b5..93e7c42 100644 --- a/sw/source/uibase/docvw/PageBreakWin.cxx +++ b/sw/source/uibase/docvw/PageBreakWin.cxx @@ -165,9 +165,9 @@ void SwPageBreakWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) B2DPolygon aPolygon = createPolygonFromRect(aBRect, 3.0 / BUTTON_WIDTH, 3.0 / BUTTON_HEIGHT); // Create the polygon primitives - aSeq[0] = css::uno::Reference< css::graphic::XPrimitive2D >(new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( + aSeq[0].set(new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( B2DPolyPolygon(aPolygon), aOtherColor)); - aSeq[1] = css::uno::Reference< css::graphic::XPrimitive2D >(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D( + aSeq[1].set(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D( aPolygon, aColor)); // Create the primitive for the image @@ -175,7 +175,7 @@ void SwPageBreakWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) double nImgOfstX = 3.0; if (bRtl) nImgOfstX = aRect.Right() - aImg.GetSizePixel().Width() - 3.0; - aSeq[2] = css::uno::Reference< css::graphic::XPrimitive2D >(new drawinglayer::primitive2d::DiscreteBitmapPrimitive2D( + aSeq[2].set(new drawinglayer::primitive2d::DiscreteBitmapPrimitive2D( aImg.GetBitmapEx(), B2DPoint(nImgOfstX, 1.0))); double nTop = double(aRect.getHeight()) / 2.0; @@ -196,8 +196,7 @@ void SwPageBreakWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) aTriangleColor = Color(COL_WHITE).getBColor(); aSeq.realloc(aSeq.getLength() + 1); - aSeq[aSeq.getLength() - 1] = css::uno::Reference< css::graphic::XPrimitive2D >( - new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( + aSeq[aSeq.getLength() - 1].set( new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( B2DPolyPolygon(aTriangle), aTriangleColor)); css::uno::Sequence< css::uno::Reference< css::graphic::XPrimitive2D > > aGhostedSeq(1); @@ -205,8 +204,7 @@ void SwPageBreakWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) const basegfx::BColorModifierSharedPtr aBColorModifier( new basegfx::BColorModifier_interpolate(Color(COL_WHITE).getBColor(), 1.0 - nFadeRate)); - aGhostedSeq[0] = css::uno::Reference< css::graphic::XPrimitive2D >( - new drawinglayer::primitive2d::ModifiedColorPrimitive2D( + aGhostedSeq[0].set( new drawinglayer::primitive2d::ModifiedColorPrimitive2D( aSeq, aBColorModifier)); // Create the processor and process the primitives diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx index 3ad6f9c..fa6ecca 100644 --- a/sw/source/uibase/fldui/fldmgr.cxx +++ b/sw/source/uibase/fldui/fldmgr.cxx @@ -1707,7 +1707,7 @@ Reference<XNumberingTypeInfo> SwFieldMgr::GetNumberingInfo() const { Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() ); Reference<XDefaultNumberingProvider> xDefNum = text::DefaultNumberingProvider::create(xContext); - const_cast<SwFieldMgr*>(this)->xNumberingInfo = Reference<XNumberingTypeInfo>(xDefNum, UNO_QUERY); + const_cast<SwFieldMgr*>(this)->xNumberingInfo.set(xDefNum, UNO_QUERY); } return xNumberingInfo; } diff --git a/sw/source/uibase/fldui/xfldui.cxx b/sw/source/uibase/fldui/xfldui.cxx index 5bf5b73..c7164e5 100644 --- a/sw/source/uibase/fldui/xfldui.cxx +++ b/sw/source/uibase/fldui/xfldui.cxx @@ -65,7 +65,7 @@ bool SwFieldMgr::IsDBNumeric( const OUString& rDBName, const OUString& rTableQry Reference<XColumnsSupplier> xColsSupplier; if(bIsTable) { - Reference<XTablesSupplier> xTSupplier = Reference<XTablesSupplier>(xConnection, UNO_QUERY); + Reference<XTablesSupplier> xTSupplier(xConnection, UNO_QUERY); if(xTSupplier.is()) { Reference<XNameAccess> xTables = xTSupplier->getTables(); @@ -75,7 +75,7 @@ bool SwFieldMgr::IsDBNumeric( const OUString& rDBName, const OUString& rTableQry Any aTable = xTables->getByName(rTableQryName); Reference<XPropertySet> xPropSet; aTable >>= xPropSet; - xColsSupplier = Reference<XColumnsSupplier>(xPropSet, UNO_QUERY); + xColsSupplier.set(xPropSet, UNO_QUERY); } catch (const Exception&) { @@ -84,7 +84,7 @@ bool SwFieldMgr::IsDBNumeric( const OUString& rDBName, const OUString& rTableQry } else { - Reference<XQueriesSupplier> xQSupplier = Reference<XQueriesSupplier>(xConnection, UNO_QUERY); + Reference<XQueriesSupplier> xQSupplier(xConnection, UNO_QUERY); if(xQSupplier.is()) { Reference<XNameAccess> xQueries = xQSupplier->getQueries(); @@ -94,7 +94,7 @@ bool SwFieldMgr::IsDBNumeric( const OUString& rDBName, const OUString& rTableQry Any aQuery = xQueries->getByName(rTableQryName); Reference<XPropertySet> xPropSet; aQuery >>= xPropSet; - xColsSupplier = Reference<XColumnsSupplier>(xPropSet, UNO_QUERY); + xColsSupplier.set(xPropSet, UNO_QUERY); } catch (const Exception&) { diff --git a/sw/source/uibase/misc/numberingtypelistbox.cxx b/sw/source/uibase/misc/numberingtypelistbox.cxx index 7e76bc6..1f1e47a 100644 --- a/sw/source/uibase/misc/numberingtypelistbox.cxx +++ b/sw/source/uibase/misc/numberingtypelistbox.cxx @@ -43,7 +43,7 @@ SwNumberingTypeListBox::SwNumberingTypeListBox( vcl::Window* pWin, WinBits nStyl uno::Reference<uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() ); uno::Reference<text::XDefaultNumberingProvider> xDefNum = text::DefaultNumberingProvider::create(xContext); - pImpl->xInfo = uno::Reference<text::XNumberingTypeInfo>(xDefNum, uno::UNO_QUERY); + pImpl->xInfo.set(xDefNum, uno::UNO_QUERY); } bool SwNumberingTypeListBox::set_property(const OString &rKey, const OString &rValue) diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx index f8223ee..428b6c9 100644 --- a/sw/source/uibase/uno/unoatxt.cxx +++ b/sw/source/uibase/uno/unoatxt.cxx @@ -802,7 +802,7 @@ void SwXAutoTextEntry::GetBodyText () StartListening( *&xDocSh ); pBodyText = new SwXBodyText ( xDocSh->GetDoc() ); - xBodyText = uno::Reference < lang::XServiceInfo > ( *pBodyText, uno::UNO_QUERY); + xBodyText.set( *pBodyText, uno::UNO_QUERY); } uno::Reference< text::XTextCursor > SwXAutoTextEntry::createTextCursor() throw( uno::RuntimeException, std::exception ) @@ -928,7 +928,7 @@ void SwXAutoTextEntry::applyTo(const uno::Reference< text::XTextRange > & xTextR pDoc = pCursor->GetDoc(); else if ( pText && pText->GetDoc() ) { - xTunnel = uno::Reference < lang::XUnoTunnel > (pText->getStart(), uno::UNO_QUERY); + xTunnel.set(pText->getStart(), uno::UNO_QUERY); if (xTunnel.is()) { pCursor = reinterpret_cast < OTextCursorHelper* > diff --git a/sw/source/uibase/uno/unodispatch.cxx b/sw/source/uibase/uno/unodispatch.cxx index 8b281b0..e1b9542 100644 --- a/sw/source/uibase/uno/unodispatch.cxx +++ b/sw/source/uibase/uno/unodispatch.cxx @@ -43,7 +43,7 @@ SwXDispatchProviderInterceptor::SwXDispatchProviderInterceptor(SwView& rVw) : m_pView(&rVw) { uno::Reference< frame::XFrame> xUnoFrame = m_pView->GetViewFrame()->GetFrame().GetFrameInterface(); - m_xIntercepted = uno::Reference< frame::XDispatchProviderInterception>(xUnoFrame, uno::UNO_QUERY); + m_xIntercepted.set(xUnoFrame, uno::UNO_QUERY); if(m_xIntercepted.is()) { m_refCount++; diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx index df76382..3d8fc43 100644 --- a/sw/source/uibase/uno/unomailmerge.cxx +++ b/sw/source/uibase/uno/unomailmerge.cxx @@ -145,8 +145,7 @@ static bool LoadFromURL_impl( try { Reference < XDesktop2 > xDesktop = Desktop::create( ::comphelper::getProcessComponentContext() ); - xTmpModel = Reference < XModel >( xDesktop->loadComponentFromURL( - rURL, "_blank", 0, aArgs ), UNO_QUERY ); + xTmpModel.set( xDesktop->loadComponentFromURL( rURL, "_blank", 0, aArgs ), UNO_QUERY ); } catch (const Exception&) { @@ -642,7 +641,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( xRowSet->execute(); // build ResultSet from properties if( !xCurConnection.is() ) xCurConnection.set( xRowSetPropSet->getPropertyValue( "ActiveConnection" ), UNO_QUERY ); - xCurResultSet = Reference< sdbc::XResultSet >( xRowSet, UNO_QUERY ); + xCurResultSet.set( xRowSet, UNO_QUERY ); OSL_ENSURE( xCurResultSet.is(), "failed to build ResultSet" ); } } diff --git a/sw/source/uibase/uno/unomodule.cxx b/sw/source/uibase/uno/unomodule.cxx index 62a8997..c353e25 100644 --- a/sw/source/uibase/uno/unomodule.cxx +++ b/sw/source/uibase/uno/unomodule.cxx @@ -132,7 +132,7 @@ uno::Reference< frame::XDispatch > SAL_CALL SwUnoModule::queryDispatch( SwGlobals::ensure(); const SfxSlot* pSlot = SW_MOD()->GetInterface()->GetSlot( aURL.Complete ); if ( pSlot ) - xReturn = uno::Reference< frame::XDispatch >(static_cast< frame::XDispatch* >(this), uno::UNO_QUERY); + xReturn.set(static_cast< frame::XDispatch* >(this), uno::UNO_QUERY); return xReturn; } diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 43a5b32..79b5b90 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -452,7 +452,7 @@ void SwXTextDocument::GetNumberFormatter() SvNumberFormatsSupplierObj* pNumFormat = new SvNumberFormatsSupplierObj( pDocShell->GetDoc()->GetNumberFormatter()); Reference< util::XNumberFormatsSupplier > xTmp = pNumFormat; - xNumFormatAgg = Reference< XAggregation >(xTmp, UNO_QUERY); + xNumFormatAgg.set(xTmp, UNO_QUERY); } if(xNumFormatAgg.is()) xNumFormatAgg->setDelegator(static_cast<cppu::OWeakObject*>(static_cast<SwXTextDocumentBaseClass*>(this))); diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx index 2871760..dc012f1a 100644 --- a/sw/source/uibase/uno/unotxvw.cxx +++ b/sw/source/uibase/uno/unotxvw.cxx @@ -341,7 +341,7 @@ uno::Any SwXTextView::getSelection() OSL_ENSURE(rSh.GetTableFormat(), "not a table format?"); uno::Reference< text::XTextTableCursor > xCrsr = new SwXTextTableCursor(*rSh.GetTableFormat(), rSh.GetTableCrsr()); - aRef = uno::Reference< uno::XInterface > (xCrsr, uno::UNO_QUERY); + aRef.set(xCrsr, uno::UNO_QUERY); break; } @@ -353,7 +353,7 @@ uno::Any SwXTextView::getSelection() case SHELL_MODE_TEXT : { uno::Reference< container::XIndexAccess > xPos = SwXTextRanges::Create(rSh.GetCrsr()); - aRef = uno::Reference< uno::XInterface >(xPos, uno::UNO_QUERY); + aRef.set(xPos, uno::UNO_QUERY); } break; case SHELL_MODE_FRAME : @@ -407,7 +407,7 @@ uno::Any SwXTextView::getSelection() uno::Reference< drawing::XShape > xShape(xInt, uno::UNO_QUERY); xShCol->add(xShape); } - aRef = uno::Reference< uno::XInterface >(xShCol, uno::UNO_QUERY); + aRef.set(xShCol, uno::UNO_QUERY); } break; default:;//prevent warning diff --git a/sw/source/uibase/utlui/unotools.cxx b/sw/source/uibase/utlui/unotools.cxx index 9afbb4a..fce324c 100644 --- a/sw/source/uibase/utlui/unotools.cxx +++ b/sw/source/uibase/utlui/unotools.cxx @@ -114,7 +114,7 @@ void SwOneExampleFrame::CreateControl() xMgr = comphelper::getProcessServiceFactory(); uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); uno::Reference< uno::XInterface > xInst = xMgr->createInstance( "com.sun.star.frame.FrameControl" ); - _xControl = uno::Reference< awt::XControl >(xInst, uno::UNO_QUERY); + _xControl.set(xInst, uno::UNO_QUERY); if(_xControl.is()) { uno::Reference< awt::XWindowPeer > xParent( aTopWindow->GetComponentInterface() ); _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
