i18nlangtag/source/languagetag/languagetag.cxx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
New commits: commit 76fe24cf121025ddceb18f3b522d373f7f0256f7 Author: Jelle van der Waa <je...@vdwaa.nl> Date: Sat Aug 24 11:58:40 2013 +0200 fdo#57950: Remove some chained appends in i18nlangtag Change-Id: I1b91f139575a86b19d7a0613d1f563d215b41b9d Reviewed-on: https://gerrit.libreoffice.org/5601 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Eike Rathke <er...@redhat.com> diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx index 62e1d9c1..c2716e4 100644 --- a/i18nlangtag/source/languagetag/languagetag.cxx +++ b/i18nlangtag/source/languagetag/languagetag.cxx @@ -473,10 +473,11 @@ bool LanguageTag::canonicalize() 1 + aCountry.getLength()); aBuf.append( aLanguage); if (!aScript.isEmpty()) - aBuf.append('-').append( aScript); + aBuf.append("-" + aScript); if (!aCountry.isEmpty()) - aBuf.append('-').append( aCountry); + aBuf.append("-" + aCountry); OUString aStr( aBuf.makeStringAndClear()); + if (maBcp47 != aStr) { maBcp47 = aStr; @@ -990,9 +991,7 @@ OUString LanguageTag::getLanguageAndScript() const OUString aScript( getScript()); if (!aScript.isEmpty()) { - OUStringBuffer aBuf( aLanguageScript.getLength() + 1 + aScript.getLength()); - aBuf.append( aLanguageScript).append( '-').append( aScript); - aLanguageScript = aBuf.makeStringAndClear(); + aLanguageScript += "-" + aScript; } return aLanguageScript; } @@ -1414,9 +1413,7 @@ OUString LanguageTag::convertToBcp47( const com::sun::star::lang::Locale& rLocal aBcp47 = rLocale.Language; else { - OUStringBuffer aBuf( rLocale.Language.getLength() + 1 + rLocale.Country.getLength()); - aBuf.append( rLocale.Language).append( '-').append( rLocale.Country); - aBcp47 = aBuf.makeStringAndClear(); + aBcp47 = rLocale.Language + "-" + rLocale.Country; } } return aBcp47; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits