diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-28 18:01:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-30 11:06:14 +0200 |
commit | 70bfdd828b01e9db0713b87645ffe39f3dc21c7e (patch) | |
tree | b53e22d4c582e7cad6155f2c0c2536241cadb0f5 /svx | |
parent | dead246b1955a99b66b0a69e8da3db1a61f3ab88 (diff) |
loplugin:stringloop in sfx2..svx
Change-Id: Ie4ca2421f00259f974b6d94f883adfa11600b1fe
Reviewed-on: https://gerrit.libreoffice.org/58251
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/ClassificationCommon.cxx | 8 | ||||
-rw-r--r-- | svx/source/fmcomp/fmgridcl.cxx | 8 | ||||
-rw-r--r-- | svx/source/form/fmobj.cxx | 3 | ||||
-rw-r--r-- | svx/source/gallery2/galbrws1.cxx | 12 |
4 files changed, 10 insertions, 21 deletions
diff --git a/svx/source/dialog/ClassificationCommon.cxx b/svx/source/dialog/ClassificationCommon.cxx index 66d68ff66fa9..cd5dc7324d02 100644 --- a/svx/source/dialog/ClassificationCommon.cxx +++ b/svx/source/dialog/ClassificationCommon.cxx @@ -20,7 +20,7 @@ namespace classification { OUString convertClassificationResultToString(std::vector<svx::ClassificationResult> const& rResults) { - OUString sRepresentation = ""; + OUStringBuffer sRepresentation; for (svx::ClassificationResult const& rResult : rResults) { @@ -30,15 +30,15 @@ OUString convertClassificationResultToString(std::vector<svx::ClassificationResu case svx::ClassificationType::INTELLECTUAL_PROPERTY_PART: case svx::ClassificationType::MARKING: case svx::ClassificationType::TEXT: - sRepresentation += rResult.msName; + sRepresentation.append(rResult.msName); break; case svx::ClassificationType::PARAGRAPH: - sRepresentation += " "; + sRepresentation.append(" "); break; } } - return sRepresentation; + return sRepresentation.makeStringAndClear(); } OUString getProperty(uno::Reference<beans::XPropertyContainer> const& rxPropertyContainer, diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index 2d957ad19c5c..9c6668fa0ea1 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -563,8 +563,6 @@ IMPL_LINK_NOARG( FmGridHeader, OnAsyncExecuteDrop, void*, void ) if (bDateNTimeCol) { - OUString sRealName,sPurePostfix; - OUString aPostfix[] = { SvxResId(RID_STR_POSTFIX_DATE), SvxResId(RID_STR_POSTFIX_TIME) @@ -572,12 +570,10 @@ IMPL_LINK_NOARG( FmGridHeader, OnAsyncExecuteDrop, void*, void ) for ( size_t i=0; i<2; ++i ) { - sPurePostfix = comphelper::string::stripStart(aPostfix[i], ' '); + OUString sPurePostfix = comphelper::string::stripStart(aPostfix[i], ' '); sPurePostfix = comphelper::string::stripStart(sPurePostfix, '('); sPurePostfix = comphelper::string::stripEnd(sPurePostfix, ')'); - sRealName = sFieldName; - sRealName += "_"; - sRealName += sPurePostfix; + OUString sRealName = sFieldName + "_" + sPurePostfix; if (i) xSecondCol->setPropertyValue(FM_PROP_NAME, makeAny(sRealName)); else diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx index cb9b4ca44c29..4b335e8b0e96 100644 --- a/svx/source/form/fmobj.cxx +++ b/svx/source/form/fmobj.cxx @@ -408,14 +408,13 @@ namespace // while the current content is a form OUString sReturn; - OUString sCurrentIndex; while (xChild.is()) { // get the content's relative pos within its parent container sal_Int32 nPos = getElementPos(xParent, xChild); // prepend this current relative pos - sCurrentIndex = OUString::number(nPos); + OUString sCurrentIndex = OUString::number(nPos); if (!sReturn.isEmpty()) { sCurrentIndex += "\\"; diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index a860ad8ac592..bce9abbdbb0b 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -293,9 +293,7 @@ void GalleryBrowser1::ImplEndGalleryThemeProperties(bool bCreateNew) while( mpGallery->HasTheme( aTitle ) && ( nCount++ < 16000 ) ) { - aTitle = mpExchangeData->aEditedTitle; - aTitle += " "; - aTitle += OUString::number( nCount ); + aTitle = mpExchangeData->aEditedTitle + " " + OUString::number( nCount ); } mpGallery->RenameTheme( aName, aTitle ); @@ -375,9 +373,7 @@ void GalleryBrowser1::ImplExecute(const OString &rIdent) while( mpGallery->HasTheme( aName ) && ( nCount++ < 16000 ) ) { - aName = aNewName; - aName += " "; - aName += OUString::number( nCount ); + aName = aNewName + " " + OUString::number( nCount ); } mpGallery->RenameTheme( aOldName, aName ); @@ -597,9 +593,7 @@ IMPL_LINK_NOARG(GalleryBrowser1, ClickNewThemeHdl, Button*, void) while( mpGallery->HasTheme( aName ) && ( nCount++ < 16000 ) ) { - aName = aNewTheme; - aName += " "; - aName += OUString::number( nCount ); + aName = aNewTheme + " " + OUString::number( nCount ); } if( !mpGallery->HasTheme( aName ) && mpGallery->CreateTheme( aName ) ) |