summaryrefslogtreecommitdiff
path: root/UnoControls
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-26 13:15:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-27 11:15:46 +0200
commitc8fa03b1f565461364b9f6423b65680e09281c14 (patch)
tree78ff35dfeb569354b41e89b9d55d77b46f7d3d95 /UnoControls
parent82a4ef72d6e34c2f5075069a1b353f7fd41c7595 (diff)
new loplugin:stringloop, and applied in various
look for OUString being appended to in a loop, better to use OUStringBuffer to accumulate the results. Change-Id: Ia36e06e2781a7c546ce9cbad62727aa4c5f10c4b Reviewed-on: https://gerrit.libreoffice.org/58092 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'UnoControls')
-rw-r--r--UnoControls/source/controls/progressmonitor.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/UnoControls/source/controls/progressmonitor.cxx b/UnoControls/source/controls/progressmonitor.cxx
index b43afd5d6e73..c7da6f15ab17 100644
--- a/UnoControls/source/controls/progressmonitor.cxx
+++ b/UnoControls/source/controls/progressmonitor.cxx
@@ -721,31 +721,31 @@ void ProgressMonitor::impl_rebuildFixedText ()
// Rebuild left site of text
if (m_xTopic_Top.is())
{
- OUString aCollectString;
+ OUStringBuffer aCollectString;
// Collect all topics from list and format text.
// "\n" MUST BE at the end of line!!! => Else ... topic and his text are not in the same line!!!
for (auto const & pSearchItem : maTextlist_Top)
{
- aCollectString += pSearchItem->sTopic + "\n";
+ aCollectString.append(pSearchItem->sTopic).append("\n");
}
- m_xTopic_Top->setText ( aCollectString );
+ m_xTopic_Top->setText ( aCollectString.makeStringAndClear() );
}
// Rebuild right site of text
if (m_xText_Top.is())
{
- OUString aCollectString;
+ OUStringBuffer aCollectString;
// Collect all topics from list and format text.
// "\n" MUST BE at the end of line!!! => Else ... topic and his text are not in the same line!!!
for (auto const & pSearchItem : maTextlist_Top)
{
- aCollectString += pSearchItem->sText + "\n";
+ aCollectString.append(pSearchItem->sText).append("\n");
}
- m_xText_Top->setText ( aCollectString );
+ m_xText_Top->setText ( aCollectString.makeStringAndClear() );
}
// Rebuild fixedtext below progress
@@ -753,31 +753,31 @@ void ProgressMonitor::impl_rebuildFixedText ()
// Rebuild left site of text
if (m_xTopic_Bottom.is())
{
- OUString aCollectString;
+ OUStringBuffer aCollectString;
// Collect all topics from list and format text.
// "\n" MUST BE at the end of line!!! => Else ... topic and his text are not in the same line!!!
for (auto const & pSearchItem : maTextlist_Bottom)
{
- aCollectString += pSearchItem->sTopic + "\n";
+ aCollectString.append(pSearchItem->sTopic).append("\n");
}
- m_xTopic_Bottom->setText ( aCollectString );
+ m_xTopic_Bottom->setText ( aCollectString.makeStringAndClear() );
}
// Rebuild right site of text
if (m_xText_Bottom.is())
{
- OUString aCollectString;
+ OUStringBuffer aCollectString;
// Collect all topics from list and format text.
// "\n" MUST BE at the end of line!!! => Else ... topic and his text are not in the same line!!!
for (auto const & pSearchItem : maTextlist_Bottom)
{
- aCollectString += pSearchItem->sText + "\n";
+ aCollectString.append(pSearchItem->sText).append("\n");
}
- m_xText_Bottom->setText ( aCollectString );
+ m_xText_Bottom->setText ( aCollectString.makeStringAndClear() );
}
}