summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-28 11:27:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-28 17:22:39 +0200
commitfa87224130a4ab6c4b79f993cc990adc4be0465b (patch)
tree89ef6c5fbae775cfc508d96e20d052fa6bad114a /chart2
parente1d7b0973d8318bd7f153350e2e8a38bec3b3e7b (diff)
loplugin:stringloop basctl,chart2,connectivity
Change-Id: I21353dace60705d55b3d70f1e0bc610d55b84d63 Reviewed-on: https://gerrit.libreoffice.org/58210 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/main/ElementSelector.cxx8
-rw-r--r--chart2/source/tools/ExplicitCategoriesProvider.cxx8
-rw-r--r--chart2/source/tools/TitleHelper.cxx8
3 files changed, 11 insertions, 13 deletions
diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx
index a7ce1843d8f1..fd43b5457bf3 100644
--- a/chart2/source/controller/main/ElementSelector.cxx
+++ b/chart2/source/controller/main/ElementSelector.cxx
@@ -61,14 +61,12 @@ void lcl_addObjectsToList( const ObjectHierarchy& rHierarchy, const ObjectIdent
ObjectHierarchy::tChildContainer aChildren( rHierarchy.getChildren(rParent) );
for (auto const& child : aChildren)
{
- ObjectIdentifier aOID = child;
- OUString aCID = aOID.getObjectCID();
ListBoxEntryData aEntry;
- aEntry.OID = aOID;
- aEntry.UIName += ObjectNameProvider::getNameForCID( aCID, xChartDoc );
+ aEntry.OID = child;
+ aEntry.UIName = ObjectNameProvider::getNameForCID( child.getObjectCID(), xChartDoc );
aEntry.nHierarchyDepth = nHierarchyDepth;
rEntries.push_back(aEntry);
- lcl_addObjectsToList( rHierarchy, aOID, rEntries, nHierarchyDepth+1, xChartDoc );
+ lcl_addObjectsToList( rHierarchy, child, rEntries, nHierarchyDepth+1, xChartDoc );
}
}
diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx b/chart2/source/tools/ExplicitCategoriesProvider.cxx
index cab1103655dd..744d2ac2d383 100644
--- a/chart2/source/tools/ExplicitCategoriesProvider.cxx
+++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx
@@ -355,7 +355,7 @@ Sequence< OUString > lcl_getExplicitSimpleCategories(
aRet.realloc(nMaxCategoryCount);
for(sal_Int32 nN=0; nN<nMaxCategoryCount; nN++)
{
- OUString aText;
+ OUStringBuffer aText;
for (auto const& complexCatPerIndex : aComplexCatsPerIndex)
{
if ( static_cast<size_t>(nN) < complexCatPerIndex.size() )
@@ -364,12 +364,12 @@ Sequence< OUString > lcl_getExplicitSimpleCategories(
if( !aAddText.isEmpty() )
{
if(!aText.isEmpty())
- aText += " ";
- aText += aAddText;
+ aText.append(" ");
+ aText.append(aAddText);
}
}
}
- aRet[nN]=aText;
+ aRet[nN]=aText.makeStringAndClear();
}
}
return aRet;
diff --git a/chart2/source/tools/TitleHelper.cxx b/chart2/source/tools/TitleHelper.cxx
index f93798d4aee4..0487fa6f51e2 100644
--- a/chart2/source/tools/TitleHelper.cxx
+++ b/chart2/source/tools/TitleHelper.cxx
@@ -300,13 +300,13 @@ uno::Reference< XTitle > TitleHelper::createTitle(
OUString TitleHelper::getCompleteString( const uno::Reference< XTitle >& xTitle )
{
- OUString aRet;
if(!xTitle.is())
- return aRet;
+ return OUString();
+ OUStringBuffer aRet;
uno::Sequence< uno::Reference< XFormattedString > > aStringList = xTitle->getText();
for( sal_Int32 nN=0; nN<aStringList.getLength();nN++ )
- aRet += aStringList[nN]->getString();
- return aRet;
+ aRet.append( aStringList[nN]->getString() );
+ return aRet.makeStringAndClear();
}
void TitleHelper::setCompleteString( const OUString& rNewText