use OUStringBuffer

Change-Id: If82c2114a1145e1bfdede9205461717c04043db2
This commit is contained in:
Eike Rathke
2013-07-11 22:10:48 +02:00
parent 562c39d73f
commit 642f458c23

View File

@@ -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;