summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-26 17:16:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-27 11:35:24 +0200
commitb83cc2b0108a4ec2087221a6150a66578788e5b4 (patch)
treeb3684057b66602ddf01546dcb8306fddbad69a38 /svtools
parent86be39afd5b142f7cbdbe0107b394c5924c414cc (diff)
loplugin:stringloop in basic, framework, sax, svtools
Change-Id: I2bad74a8f103e9dc68c8e0d0e6315697068d2f6d Reviewed-on: https://gerrit.libreoffice.org/58135 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/contnr/fileview.cxx3
-rw-r--r--svtools/source/contnr/svtabbx.cxx16
-rw-r--r--svtools/source/contnr/treelistbox.cxx6
3 files changed, 12 insertions, 13 deletions
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index fc41f053337e..7d3c41bc7045 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -1843,14 +1843,13 @@ void SvtFileView_Impl::CreateDisplayText_Impl()
{
::osl::MutexGuard aGuard( maMutex );
- OUString aValue;
OUString const aTab( "\t" );
OUString const aDateSep( ", " );
for (auto const& elem : maContent)
{
// title, type, size, date
- aValue = elem->GetTitle();
+ OUString aValue = elem->GetTitle();
ReplaceTabWithString( aValue );
aValue += aTab + elem->maType + aTab;
// folders don't have a size
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx
index f1106d6e220b..28495cf5e47b 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -232,7 +232,7 @@ OUString SvTabListBox::GetEntryText( SvTreeListEntry* pEntry ) const
OUString SvTabListBox::GetEntryText( SvTreeListEntry* pEntry, sal_uInt16 nCol )
{
DBG_ASSERT(pEntry,"GetEntryText:Invalid Entry");
- OUString aResult;
+ OUStringBuffer aResult;
if( pEntry )
{
sal_uInt16 nCount = pEntry->ItemCount();
@@ -245,8 +245,8 @@ OUString SvTabListBox::GetEntryText( SvTreeListEntry* pEntry, sal_uInt16 nCol )
if( nCol == 0xffff )
{
if (!aResult.isEmpty())
- aResult += "\t";
- aResult += static_cast<const SvLBoxString&>(rStr).GetText();
+ aResult.append("\t");
+ aResult.append(static_cast<const SvLBoxString&>(rStr).GetText());
}
else
{
@@ -258,7 +258,7 @@ OUString SvTabListBox::GetEntryText( SvTreeListEntry* pEntry, sal_uInt16 nCol )
nCur++;
}
}
- return aResult;
+ return aResult.makeStringAndClear();
}
OUString SvTabListBox::GetEntryText( sal_uLong nPos, sal_uInt16 nCol ) const
@@ -363,7 +363,7 @@ OUString SvTabListBox::GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const
{
SvTreeListEntry* pEntry = SvTreeListBox::GetEntry( nPos );
DBG_ASSERT( pEntry, "GetTabEntryText(): Invalid entry " );
- OUString aResult;
+ OUStringBuffer aResult;
if ( pEntry )
{
sal_uInt16 nCount = pEntry->ItemCount();
@@ -376,8 +376,8 @@ OUString SvTabListBox::GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const
if ( nCol == 0xffff )
{
if (!aResult.isEmpty())
- aResult += "\t";
- aResult += static_cast<const SvLBoxString&>(rBoxItem).GetText();
+ aResult.append("\t");
+ aResult.append(static_cast<const SvLBoxString&>(rBoxItem).GetText());
}
else
{
@@ -394,7 +394,7 @@ OUString SvTabListBox::GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const
++nCur;
}
}
- return aResult;
+ return aResult.makeStringAndClear();
}
SvTreeListEntry* SvTabListBox::GetEntryOnPos( sal_uLong _nEntryPos ) const
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index ea710b2da653..7a930883f51d 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -1314,7 +1314,7 @@ OUString SvTreeListBox::GetEntryLongDescription( SvTreeListEntry* ) const
OUString SvTreeListBox::SearchEntryTextWithHeadTitle( SvTreeListEntry* pEntry )
{
assert(pEntry);
- OUString sRet;
+ OUStringBuffer sRet;
sal_uInt16 nCount = pEntry->ItemCount();
sal_uInt16 nCur = 0;
@@ -1324,14 +1324,14 @@ OUString SvTreeListBox::SearchEntryTextWithHeadTitle( SvTreeListEntry* pEntry )
if ( (rItem.GetType() == SvLBoxItemType::String) &&
!static_cast<SvLBoxString&>( rItem ).GetText().isEmpty() )
{
- sRet += static_cast<SvLBoxString&>( rItem ).GetText() + ",";
+ sRet.append(static_cast<SvLBoxString&>( rItem ).GetText()).append(",");
}
nCur++;
}
if (!sRet.isEmpty())
sRet = sRet.copy(0, sRet.getLength() - 1);
- return sRet;
+ return sRet.makeStringAndClear();
}
SvTreeListBox::~SvTreeListBox()