sc/inc/table.hxx | 2 +- sc/source/core/data/documen2.cxx | 3 +-- sc/source/core/data/documen3.cxx | 3 +-- sc/source/core/data/documen9.cxx | 3 +-- sc/source/core/data/document.cxx | 16 ++++++---------- sc/source/core/data/table1.cxx | 5 ----- 6 files changed, 10 insertions(+), 22 deletions(-)
New commits: commit aa0adc7a4f2b0ca735fc8330fa7b9dab75b38e56 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Aug 17 10:37:20 2018 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Aug 17 12:56:44 2018 +0200 make GetName accessor more standard Change-Id: I8cb4853be09e37499d26acb6889b3d9b2c70dcf8 Reviewed-on: https://gerrit.libreoffice.org/59252 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 5c22144c8e09..fe9f8615fb46 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -360,7 +360,7 @@ public: sal_Int64 GetHashCode () const; - void GetName( OUString& rName ) const; + const OUString& GetName() const { return aName; } void SetName( const OUString& rNewName ); void SetAnonymousDBData(std::unique_ptr<ScDBData> pDBData); diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 46bff72a4a10..6cba2a5eda6b 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -533,8 +533,7 @@ void ScDocument::ResetClip( ScDocument* pSourceDoc, const ScMarkData* pMarks ) if (pSourceDoc->maTabs[i]) if (!pMarks || pMarks->GetTableSelect(i)) { - OUString aString; - pSourceDoc->maTabs[i]->GetName(aString); + OUString aString = pSourceDoc->maTabs[i]->GetName(); if ( i < static_cast<SCTAB>(maTabs.size()) ) { maTabs[i].reset( new ScTable(this, i, aString) ); diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index d3b912200788..3ea09da33e0d 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -165,8 +165,7 @@ void ScDocument::GetRangeNameMap(std::map<OUString, ScRangeName*>& aRangeNameMap p = new ScRangeName(); SetRangeName(i, std::unique_ptr<ScRangeName>(p)); } - OUString aTableName; - maTabs[i]->GetName(aTableName); + OUString aTableName = maTabs[i]->GetName(); aRangeNameMap.insert(std::pair<OUString, ScRangeName*>(aTableName,p)); } if (!pRangeName) diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index ee80e09a143a..ed220de13044 100644 --- a/sc/source/core/data/documen9.cxx +++ b/sc/source/core/data/documen9.cxx @@ -154,8 +154,7 @@ void ScDocument::InitDrawLayer( SfxObjectShell* pDocShell ) mpDrawLayer->ScAddPage( nTab ); // always add page, with or without the table if (maTabs[nTab]) { - OUString aTabName; - maTabs[nTab]->GetName(aTabName); + OUString aTabName = maTabs[nTab]->GetName(); mpDrawLayer->ScRenamePage( nTab, aTabName ); maTabs[nTab]->SetDrawPageSize(false,false); // set the right size immediately diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 55a660a4930d..764492313380 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -216,7 +216,7 @@ bool ScDocument::GetName( SCTAB nTab, OUString& rName ) const { if (maTabs[nTab]) { - maTabs[nTab]->GetName( rName ); + rName = maTabs[nTab]->GetName(); return true; } } @@ -297,7 +297,7 @@ std::vector<OUString> ScDocument::GetAllTableNames() const if (*it) { const ScTable& rTab = **it; - rTab.GetName(aName); + aName = rTab.GetName(); } aNames.push_back(aName); } @@ -379,8 +379,7 @@ bool ScDocument::ValidNewTabName( const OUString& rName ) const for (; it != maTabs.end() && bValid; ++it) if ( *it ) { - OUString aOldName; - (*it)->GetName(aOldName); + OUString aOldName = (*it)->GetName(); bValid = !ScGlobal::GetpTransliteration()->isEqual( rName, aOldName ); } return bValid; @@ -875,8 +874,7 @@ bool ScDocument::RenameTab( SCTAB nTab, const OUString& rName, bool bExternalDoc for (i=0; (i< static_cast<SCTAB>(maTabs.size())) && bValid; i++) if (maTabs[i] && (i != nTab)) { - OUString aOldName; - maTabs[i]->GetName(aOldName); + OUString aOldName = maTabs[i]->GetName(); bValid = !ScGlobal::GetpTransliteration()->isEqual( rName, aOldName ); } if (bValid) @@ -2190,8 +2188,7 @@ void ScDocument::CopyToClip(const ScClipParam& rClipParam, { if( *itr ) { - OUString aTabName; - (*itr)->GetName(aTabName); + OUString aTabName = (*itr)->GetName(); pClipDoc->maTabNames.push_back(aTabName); } else @@ -2290,8 +2287,7 @@ void ScDocument::CopyTabToClip(SCCOL nCol1, SCROW nRow1, { if( *itr ) { - OUString aTabName; - (*itr)->GetName(aTabName); + OUString aTabName = (*itr)->GetName(); pClipDoc->maTabNames.push_back(aTabName); } else diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 9b0cec1bcdc2..21155a434e99 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -359,11 +359,6 @@ sal_Int64 ScTable::GetHashCode() const return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); } -void ScTable::GetName( OUString& rName ) const -{ - rName = aName; -} - void ScTable::SetName( const OUString& rNewName ) { aName = rNewName; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits