diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2018-07-25 19:25:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-27 08:27:36 +0200 |
commit | ea7e6dd4afd7154f51c5344eb6ab1825fc92a293 (patch) | |
tree | 5c8e23a53db8bc4e42f59af9253f8598de22d059 /i18npool | |
parent | a8ed578f92cdfbd6236c74bc118beeebf806a84b (diff) |
use OUStringBuffer in some loops
Change-Id: Ib32fb5ddc04df1c090f9d7b319e4ff9be0c285f9
Reviewed-on: https://gerrit.libreoffice.org/58007
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/characterclassification/cclass_unicode_parser.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/i18npool/source/characterclassification/cclass_unicode_parser.cxx b/i18npool/source/characterclassification/cclass_unicode_parser.cxx index a5cb1b680984..cdf9821776c2 100644 --- a/i18npool/source/characterclassification/cclass_unicode_parser.cxx +++ b/i18npool/source/characterclassification/cclass_unicode_parser.cxx @@ -691,7 +691,7 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32 eState = ssGetChar; //! All the variables below (plus ParseResult) have to be resetted on ssRewindFromValue! - OUString aSymbol; + OUStringBuffer aSymbol; bool isFirst(true); sal_Int32 index(nPos); // index of next code point after current sal_Int32 postSymbolIndex(index); // index of code point following last quote @@ -880,13 +880,13 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32 { if ( cLast == '\\' ) { // escaped - aSymbol += rText.copy(postSymbolIndex, nextCharIndex - postSymbolIndex - 2); - aSymbol += OUString(¤t, 1); + aSymbol.append(rText.getStr() + postSymbolIndex, nextCharIndex - postSymbolIndex - 2); + aSymbol.append(OUString(¤t, 1)); } else { eState = ssStop; - aSymbol += rText.copy(postSymbolIndex, nextCharIndex - postSymbolIndex - 1); + aSymbol.append(rText.getStr() + postSymbolIndex, nextCharIndex - postSymbolIndex - 1); } postSymbolIndex = nextCharIndex; } @@ -905,13 +905,13 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32 { if ( cLast == '\\' ) { // escaped - aSymbol += rText.copy(postSymbolIndex, nextCharIndex - postSymbolIndex - 2); - aSymbol += OUString(¤t, 1); + aSymbol.append(rText.getStr() + postSymbolIndex, nextCharIndex - postSymbolIndex - 2); + aSymbol.append(OUString(¤t, 1)); } else if (current == nextChar && !(nContTypes & KParseTokens::TWO_DOUBLE_QUOTES_BREAK_STRING) ) { // "" => literal " escaped - aSymbol += rText.copy(postSymbolIndex, nextCharIndex - postSymbolIndex); + aSymbol.append(rText.getStr() + postSymbolIndex, nextCharIndex - postSymbolIndex); nextCharIndex = index; if (index < rText.getLength()) { ++nCodePoints; } nextChar = (index < rText.getLength()) ? rText.iterateCodePoints(&index) : 0; @@ -919,7 +919,7 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32 else { eState = ssStop; - aSymbol += rText.copy(postSymbolIndex, nextCharIndex - postSymbolIndex - 1); + aSymbol.append(rText.getStr() + postSymbolIndex, nextCharIndex - postSymbolIndex - 1); } postSymbolIndex = nextCharIndex; } @@ -945,7 +945,7 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32 index = nPos; postSymbolIndex = nPos; nextCharIndex = nPos; - aSymbol.clear(); + aSymbol.setLength(0); current = (index < rText.getLength()) ? rText.iterateCodePoints(&index) : 0; nCodePoints = (nPos < rText.getLength()) ? 1 : 0; isFirst = true; @@ -1028,10 +1028,10 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32 { if (postSymbolIndex < nextCharIndex) { //! open quote - aSymbol += rText.copy(postSymbolIndex, nextCharIndex - postSymbolIndex - 1); + aSymbol.append(rText.getStr() + postSymbolIndex, nextCharIndex - postSymbolIndex - 1); r.TokenType |= KParseType::MISSING_QUOTE; } - r.DequotedNameOrString = aSymbol; + r.DequotedNameOrString = aSymbol.toString(); } } |