diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-04 15:36:18 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-11-05 07:41:29 +0200 |
commit | 0eb9f56db5dad711f12283d097e1d56a801ba526 (patch) | |
tree | 5f3d939447347f8b44921ce23f8d0b261e64ead2 /sc | |
parent | a17cfe9de14d83c28cae142a64782387dcaa4864 (diff) |
use uno::Reference::set method instead of assignment
Change-Id: I2b592fd3327f4bbe4685e84711dc9d6f19222a97
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/extras/scnamedrangesobj.cxx | 2 | ||||
-rw-r--r-- | sc/qa/extras/sctablesheetsobj.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/dpobject.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/tool/addincol.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/calcconfig.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/app/drwtrans.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/app/transobj.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/dbdocimp.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/chartsh.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/shapeuno.cxx | 2 |
10 files changed, 11 insertions, 13 deletions
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<uno::XInterface> xIntDim = ScUnoHelpFunctions::AnyToInterface( xIntDims->getByIndex(rElemDesc.Dimension) ); - xDim = uno::Reference<container::XNamed>( 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<sheet::XDimensionsSupplier> ScDPObject::CreateSource( const ScDPS pArray[3] <<= OUString( rDesc.aParPass ); xInit->initialize( aSeq ); } - xRet = uno::Reference<sheet::XDimensionsSupplier>( 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<uno::XInterface> xInterface; rNewRes >>= xInterface; if ( xInterface.is() ) - xVarRes = uno::Reference<sheet::XVolatileResult>( 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<ConfigurationListener> getMiscListener() { static rtl::Reference<ConfigurationListener> xListener; if (!xListener.is()) - xListener = rtl::Reference<ConfigurationListener>( - 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<SotStorageStream>& 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<SotStorageStream>& 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<sdbc::XRowSet> xRowSet = uno::Reference<sdbc::XRowSet>( - xResultSet, uno::UNO_QUERY ); + uno::Reference<sdbc::XRowSet> 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<const SdrOle2Obj*>( 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<drawing::XShape>& xShape ) : osl_atomic_increment( &m_refCount ); { - mxShapeAgg = uno::Reference<uno::XAggregation>( xShape, uno::UNO_QUERY ); + mxShapeAgg.set( xShape, uno::UNO_QUERY ); // extra block to force deletion of the temporary before setDelegator } |