summaryrefslogtreecommitdiff
path: root/i18nlangtag
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-07-11 22:10:48 +0200
committerEike Rathke <erack@redhat.com>2013-07-12 00:10:13 +0200
commit642f458c23eefc9fcf5447362a049329b489adf0 (patch)
treee11f27cd7ead1190f620812f8dde734b8fd67112 /i18nlangtag
parent562c39d73fb473f0eaec227ed0f607de4b7d8322 (diff)
use OUStringBuffer
Change-Id: If82c2114a1145e1bfdede9205461717c04043db2
Diffstat (limited to 'i18nlangtag')
-rw-r--r--i18nlangtag/source/languagetag/languagetag.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx
index 0309ca1c0d4f..c1319dd70b51 100644
--- a/i18nlangtag/source/languagetag/languagetag.cxx
+++ b/i18nlangtag/source/languagetag/languagetag.cxx
@@ -467,11 +467,14 @@ bool LanguageTag::canonicalize()
if (eExt == EXTRACTED_LSC)
{
// Rebuild bcp47 with proper casing of tags.
- OUString aStr( aLanguage);
+ OUStringBuffer aBuf( aLanguage.getLength() + 1 + aScript.getLength() +
+ 1 + aCountry.getLength());
+ aBuf.append( aLanguage);
if (!aScript.isEmpty())
- aStr += "-" + aScript;
+ aBuf.append('-').append( aScript);
if (!aCountry.isEmpty())
- aStr += "-" + aCountry;
+ aBuf.append('-').append( aCountry);
+ OUString aStr( aBuf.makeStringAndClear());
if (maBcp47 != aStr)
{
maBcp47 = aStr;