diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-05 10:25:49 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-11-05 11:18:41 +0200 |
commit | f9a6e75e21e9919a405a1964d85345a1c0634067 (patch) | |
tree | 8b3a9162071da1e8beded91bc3cad16614b2abcc /sw/source | |
parent | 0e31c12f4c1cb53e1d68d1129b3b42508605846f (diff) |
use uno::Reference::set method instead of assignmen
Change-Id: I76671a74150791e1a74ece3d5bcf40fd6c727ac7
Diffstat (limited to 'sw/source')
33 files changed, 69 insertions, 81 deletions
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index 9c100c7a7c2f..f962e82300bc 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 da746b073ca0..9953b6c2066b 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 d957a74c288b..7e351a7f591f 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 b7cf85fc4236..a9dde64b999a 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 b0775197dfce..1941ff4efec8 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 e5ab550a06b7..60a237a94289 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 361a9f5d4c8f..06023ee47e73 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 295bfb2bf1ad..d948f8c51d77 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 c4ea3b7fca30..45cfa7b3ac80 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 0920d770b7dd..97670add2009 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 e4ecd3e4ef41..f8e9e33ddc0b 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 8e2734205a3b..386326a22f88 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 a41b95849552..cd44b5614d03 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 98da05807554..64bbe8e655ab 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 9f872426261d..fe75d2fd1820 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 886798756993..16ae310b60ae 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 a8460386a50b..0f21e387f555 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 09f6414684f4..4d600a4db9a6 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 f65903d132f0..49446b9ed506 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 4ddad2a74939..48f2ff993b28 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 22160a2bec9c..1b49433d0f4d 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 39bd292393dc..43043942e6ab 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 cc180b5cd0d0..93e7c427bf7a 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 3ad6f9c3a988..fa6ecca7d6d8 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 5bf5b738ac9f..c7164e5e771d 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 7e76bc6b26fa..1f1e47a4eee1 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 f8223eeaca96..428b6c92f109 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 8b281b03ba19..e1b95428eca7 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 df76382caa63..3d8fc435c617 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 62a899747808..c353e25817f8 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 43a5b324d9ca..79b5b90bd8bf 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 2871760addac..dc012f1a0183 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 9afbb4ab79a1..fce324cd2e13 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() ); |