diff options
author | Jelle van der Waa <jelle@vdwaa.nl> | 2013-08-24 11:58:40 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-08-28 13:17:54 +0000 |
commit | 76fe24cf121025ddceb18f3b522d373f7f0256f7 (patch) | |
tree | 82a1d0fd6cf6b6b6db757c75af394e31dbdeae02 | |
parent | 6bdd62ac7b089cb4e622c632111bdea40517b3a7 (diff) |
fdo#57950: Remove some chained appends in i18nlangtag
Change-Id: I1b91f139575a86b19d7a0613d1f563d215b41b9d
Reviewed-on: https://gerrit.libreoffice.org/5601
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r-- | i18nlangtag/source/languagetag/languagetag.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx index 62e1d9c15938..c2716e4a6a9f 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; |