From 0eb9f56db5dad711f12283d097e1d56a801ba526 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 4 Nov 2015 15:36:18 +0200 Subject: use uno::Reference::set method instead of assignment Change-Id: I2b592fd3327f4bbe4685e84711dc9d6f19222a97 --- sc/qa/extras/scnamedrangesobj.cxx | 2 +- sc/qa/extras/sctablesheetsobj.cxx | 2 +- sc/source/core/data/dpobject.cxx | 4 ++-- sc/source/core/tool/addincol.cxx | 2 +- sc/source/core/tool/calcconfig.cxx | 3 +-- sc/source/ui/app/drwtrans.cxx | 2 +- sc/source/ui/app/transobj.cxx | 2 +- sc/source/ui/docshell/dbdocimp.cxx | 3 +-- sc/source/ui/drawfunc/chartsh.cxx | 2 +- sc/source/ui/unoobj/shapeuno.cxx | 2 +- 10 files changed, 11 insertions(+), 13 deletions(-) (limited to 'sc') diff --git a/sc/qa/extras/scnamedrangesobj.cxx b/sc/qa/extras/scnamedrangesobj.cxx index a5371e2c3654..4a176b906cd8 100644 --- a/sc/qa/extras/scnamedrangesobj.cxx +++ b/sc/qa/extras/scnamedrangesobj.cxx @@ -66,7 +66,7 @@ uno::Reference< uno::XInterface > ScNamedRangesObj::init(sal_Int32 nSheet) //set value from xnamedranges.hxx uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW); uno::Reference< container::XIndexAccess > xIndexAccess(xDoc->getSheets(), UNO_QUERY_THROW); - xSheet = uno::Reference< sheet::XSpreadsheet >(xIndexAccess->getByIndex(nSheet),UNO_QUERY_THROW); + xSheet.set(xIndexAccess->getByIndex(nSheet),UNO_QUERY_THROW); return xNamedRanges; } diff --git a/sc/qa/extras/sctablesheetsobj.cxx b/sc/qa/extras/sctablesheetsobj.cxx index a71192c462b1..570b95765696 100644 --- a/sc/qa/extras/sctablesheetsobj.cxx +++ b/sc/qa/extras/sctablesheetsobj.cxx @@ -84,7 +84,7 @@ uno::Reference< uno::XInterface > ScTableSheetsObj::init() if(!mxComponent.is()) mxComponent = loadFromDesktop(aFileURL); CPPUNIT_ASSERT(mxComponent.is()); - xDocument = uno::Reference< sheet::XSpreadsheetDocument >(mxComponent, UNO_QUERY_THROW); + xDocument.set(mxComponent, UNO_QUERY_THROW); uno::Reference< uno::XInterface > xReturn( xDocument->getSheets(), UNO_QUERY_THROW); return xReturn; diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 50fc32d3f868..0c52b11221e5 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -1898,7 +1898,7 @@ void ScDPObject::ToggleDetails(const DataPilotTableHeaderData& rElemDesc, ScDPOb { uno::Reference xIntDim = ScUnoHelpFunctions::AnyToInterface( xIntDims->getByIndex(rElemDesc.Dimension) ); - xDim = uno::Reference( xIntDim, uno::UNO_QUERY ); + xDim.set( xIntDim, uno::UNO_QUERY ); } OSL_ENSURE( xDim.is(), "dimension not found" ); if ( !xDim.is() ) return; @@ -2776,7 +2776,7 @@ uno::Reference ScDPObject::CreateSource( const ScDPS pArray[3] <<= OUString( rDesc.aParPass ); xInit->initialize( aSeq ); } - xRet = uno::Reference( xInterface, uno::UNO_QUERY ); + xRet.set( xInterface, uno::UNO_QUERY ); } catch(uno::Exception&) { diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index 48f060f956f7..506b276d2a2d 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -1546,7 +1546,7 @@ void ScUnoAddInCall::SetResult( const uno::Any& rNewRes ) uno::Reference xInterface; rNewRes >>= xInterface; if ( xInterface.is() ) - xVarRes = uno::Reference( xInterface, uno::UNO_QUERY ); + xVarRes.set( xInterface, uno::UNO_QUERY ); if (!xVarRes.is()) nErrCode = errNoValue; // unknown interface diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx index f36309bf24ba..20d5530647c9 100644 --- a/sc/source/core/tool/calcconfig.cxx +++ b/sc/source/core/tool/calcconfig.cxx @@ -28,8 +28,7 @@ static rtl::Reference getMiscListener() { static rtl::Reference xListener; if (!xListener.is()) - xListener = rtl::Reference( - new ConfigurationListener("/org.openoffice.Office.Common/Misc")); + xListener.set(new ConfigurationListener("/org.openoffice.Office.Common/Misc")); return xListener; } diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx index 8d28ef2ba354..527ff99f8f6d 100644 --- a/sc/source/ui/app/drwtrans.cxx +++ b/sc/source/ui/app/drwtrans.cxx @@ -574,7 +574,7 @@ bool ScDrawTransferObj::WriteObject( tools::SvRef& rxOStm, voi bRet = true; xWorkStore->dispose(); - xWorkStore = uno::Reference < embed::XStorage >(); + xWorkStore.clear(); rxOStm->Commit(); } catch ( uno::Exception& ) diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index 15ac5ad51f87..b539596c26ba 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -467,7 +467,7 @@ bool ScTransferObj::WriteObject( tools::SvRef& rxOStm, void* p bRet = true; xWorkStore->dispose(); - xWorkStore = uno::Reference < embed::XStorage >(); + xWorkStore.clear(); rxOStm->Commit(); } break; diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx index 08499ef62a30..ce439e6debe0 100644 --- a/sc/source/ui/docshell/dbdocimp.cxx +++ b/sc/source/ui/docshell/dbdocimp.cxx @@ -195,8 +195,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, // only text (title is still needed, for the cancel button) ScProgress aProgress( &rDocShell, ScGlobal::GetRscString(STR_UNDO_IMPORTDATA), 0 ); - uno::Reference xRowSet = uno::Reference( - xResultSet, uno::UNO_QUERY ); + uno::Reference xRowSet( xResultSet, uno::UNO_QUERY ); bool bDispose = false; if ( !xRowSet.is() ) { diff --git a/sc/source/ui/drawfunc/chartsh.cxx b/sc/source/ui/drawfunc/chartsh.cxx index 1fb50a91877c..9e08c74498c1 100644 --- a/sc/source/ui/drawfunc/chartsh.cxx +++ b/sc/source/ui/drawfunc/chartsh.cxx @@ -97,7 +97,7 @@ void ScChartShell::ExecuteExportAsGraphic( SfxRequest& ) if( pObject && dynamic_cast( pObject) != nullptr ) { - Reference< drawing::XShape > xSourceDoc = Reference< drawing::XShape >( pObject->getUnoShape(), UNO_QUERY_THROW ); + Reference< drawing::XShape > xSourceDoc( pObject->getUnoShape(), UNO_QUERY_THROW ); GraphicHelper::SaveShapeAsGraphic( xSourceDoc ); } } diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx index e536e19d3e9e..c7e87878f209 100644 --- a/sc/source/ui/unoobj/shapeuno.cxx +++ b/sc/source/ui/unoobj/shapeuno.cxx @@ -99,7 +99,7 @@ ScShapeObj::ScShapeObj( uno::Reference& xShape ) : osl_atomic_increment( &m_refCount ); { - mxShapeAgg = uno::Reference( xShape, uno::UNO_QUERY ); + mxShapeAgg.set( xShape, uno::UNO_QUERY ); // extra block to force deletion of the temporary before setDelegator } -- cgit