diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-26 13:15:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-27 11:15:46 +0200 |
commit | c8fa03b1f565461364b9f6423b65680e09281c14 (patch) | |
tree | 78ff35dfeb569354b41e89b9d55d77b46f7d3d95 /svl/source/items/style.cxx | |
parent | 82a4ef72d6e34c2f5075069a1b353f7fd41c7595 (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 'svl/source/items/style.cxx')
-rw-r--r-- | svl/source/items/style.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 5856393f57e9..0ab10a4c7801 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -36,6 +36,7 @@ #include <algorithm> #include <comphelper/servicehelper.hxx> #include <o3tl/make_unique.hxx> +#include <rtl/ustrbuf.hxx> #include <string.h> @@ -328,7 +329,7 @@ bool SfxStyleSheetBase::IsUsed() const OUString SfxStyleSheetBase::GetDescription( MapUnit eMetric ) { SfxItemIter aIter( GetItemSet() ); - OUString aDesc; + OUStringBuffer aDesc; const SfxPoolItem* pItem = aIter.FirstItem(); IntlWrapper aIntlWrapper(SvtSysLocale().GetUILanguageTag()); @@ -341,13 +342,13 @@ OUString SfxStyleSheetBase::GetDescription( MapUnit eMetric ) *pItem, eMetric, aItemPresentation, aIntlWrapper ) ) { if ( !aDesc.isEmpty() && !aItemPresentation.isEmpty() ) - aDesc += " + "; + aDesc.append(" + "); if ( !aItemPresentation.isEmpty() ) - aDesc += aItemPresentation; + aDesc.append(aItemPresentation); } pItem = aIter.NextItem(); } - return aDesc; + return aDesc.makeStringAndClear(); } SfxStyleFamily SfxStyleSheetIterator::GetSearchFamily() const |