diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-23 08:20:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-24 08:38:02 +0200 |
commit | 87c06415cebd707ae359cb2f1b06d468cb6afb08 (patch) | |
tree | 2732c68fcc98c03f6fecddc59000e9e25b067c2d /sc/source/ui/unoobj | |
parent | f31c9f16fefd16ea434cdd68721d45bced9b78e1 (diff) |
clang-tidy performance-unnecessary-copy-init in sc
Change-Id: I93ded61c22bd533a6ffaddd20d6e527f176e7651
Reviewed-on: https://gerrit.libreoffice.org/62218
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/unoobj')
-rw-r--r-- | sc/source/ui/unoobj/ChartTools.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/dapiuno.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/unoobj/styleuno.cxx | 2 |
4 files changed, 5 insertions, 7 deletions
diff --git a/sc/source/ui/unoobj/ChartTools.cxx b/sc/source/ui/unoobj/ChartTools.cxx index c74263697442..6647e10a2aaa 100644 --- a/sc/source/ui/unoobj/ChartTools.cxx +++ b/sc/source/ui/unoobj/ChartTools.cxx @@ -39,7 +39,7 @@ getPivotTableDataProvider(const SdrOle2Obj* pOleObject) { uno::Reference<chart2::data::XPivotTableDataProvider> xPivotTableDataProvider; - uno::Reference<embed::XEmbeddedObject> xObject = pOleObject->GetObjRef(); + const uno::Reference<embed::XEmbeddedObject>& xObject = pOleObject->GetObjRef(); if (xObject.is()) { uno::Reference<chart2::XChartDocument> xChartDoc(xObject->getComponent(), uno::UNO_QUERY); diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index f7bf1d0cbcf3..3a56fb138e25 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -344,8 +344,7 @@ ScDataPilotTableObj* ScDataPilotTablesObj::GetObjectByIndex_Impl( sal_Int32 nInd { if ( nFound == nIndex ) { - OUString aName = rDPObj.GetName(); - return new ScDataPilotTableObj( pDocShell, nTab, aName ); + return new ScDataPilotTableObj( pDocShell, nTab, rDPObj.GetName() ); } ++nFound; } @@ -2538,7 +2537,7 @@ Reference< XDataPilotField > SAL_CALL ScDataPilotFieldObj::createNameGroup( cons ScDPObject* pDPObj = nullptr; if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) ) { - OUString aDimName = pDim->GetName(); + const OUString& aDimName = pDim->GetName(); ScDPSaveData aSaveData = *pDPObj->GetSaveData(); ScDPDimensionSaveData* pDimData = aSaveData.GetDimensionData(); // created if not there diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 10c2220c22f1..ef5aca3f7950 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -2591,8 +2591,7 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName ) } else if ( aPropertyName == SC_UNO_CODENAME ) { - OUString sCodeName = rDoc.GetCodeName(); - aRet <<= sCodeName; + aRet <<= rDoc.GetCodeName(); } else if ( aPropertyName == SC_UNO_CJK_CLOCAL ) diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index 6e5ff6f8a154..08bdca0627fb 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -1870,7 +1870,7 @@ uno::Any ScStyleObj::getPropertyValue_Impl( const OUString& aPropertyName ) break; case ATTR_PAGE_SCALETO: { - ScPageScaleToItem aItem(pItemSet->Get(ATTR_PAGE_SCALETO)); + const ScPageScaleToItem& aItem(pItemSet->Get(ATTR_PAGE_SCALETO)); if ( aPropertyName == SC_UNO_PAGE_SCALETOX ) aAny <<= static_cast<sal_Int16>(aItem.GetWidth()); else |