summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-01-28 12:38:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-28 17:32:18 +0100
commit943060836339f9640c612e9724f20e79db616e6e (patch)
tree3dc6e7748aef3ef0f2fca86979792162daa443fc /i18npool
parentd249bd5a3dfe13052ce9aa91bad94ec7d60604d4 (diff)
simplify code, use more subView()
Change-Id: I569c7f34acbdf8451cd5c9acf1abd334637072d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110051 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.cxx12
-rw-r--r--i18npool/source/nativenumber/nativenumbersupplier.cxx4
2 files changed, 8 insertions, 8 deletions
diff --git a/i18npool/source/characterclassification/cclass_unicode_parser.cxx b/i18npool/source/characterclassification/cclass_unicode_parser.cxx
index 05ac79ce624c..5b7fb25fe47d 100644
--- a/i18npool/source/characterclassification/cclass_unicode_parser.cxx
+++ b/i18npool/source/characterclassification/cclass_unicode_parser.cxx
@@ -906,13 +906,13 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32
{
if ( cLast == '\\' )
{ // escaped
- aSymbol.append(std::u16string_view(rText).substr(postSymbolIndex, nextCharIndex - postSymbolIndex - 2));
+ aSymbol.append(rText.subView(postSymbolIndex, nextCharIndex - postSymbolIndex - 2));
aSymbol.append(OUString(&current, 1));
}
else
{
eState = ssStop;
- aSymbol.append(std::u16string_view(rText).substr(postSymbolIndex, nextCharIndex - postSymbolIndex - 1));
+ aSymbol.append(rText.subView(postSymbolIndex, nextCharIndex - postSymbolIndex - 1));
}
postSymbolIndex = nextCharIndex;
}
@@ -931,13 +931,13 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32
{
if ( cLast == '\\' )
{ // escaped
- aSymbol.append(std::u16string_view(rText).substr(postSymbolIndex, nextCharIndex - postSymbolIndex - 2));
+ aSymbol.append(rText.subView(postSymbolIndex, nextCharIndex - postSymbolIndex - 2));
aSymbol.append(OUString(&current, 1));
}
else if (current == nextChar &&
!(nContTypes & KParseTokens::TWO_DOUBLE_QUOTES_BREAK_STRING) )
{ // "" => literal " escaped
- aSymbol.append(std::u16string_view(rText).substr(postSymbolIndex, nextCharIndex - postSymbolIndex));
+ aSymbol.append(rText.subView(postSymbolIndex, nextCharIndex - postSymbolIndex));
nextCharIndex = index;
if (index < rText.getLength()) { ++nCodePoints; }
nextChar = (index < rText.getLength()) ? rText.iterateCodePoints(&index) : 0;
@@ -945,7 +945,7 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32
else
{
eState = ssStop;
- aSymbol.append(std::u16string_view(rText).substr(postSymbolIndex, nextCharIndex - postSymbolIndex - 1));
+ aSymbol.append(rText.subView(postSymbolIndex, nextCharIndex - postSymbolIndex - 1));
}
postSymbolIndex = nextCharIndex;
}
@@ -1054,7 +1054,7 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32
{
if (postSymbolIndex < nextCharIndex)
{ //! open quote
- aSymbol.append(std::u16string_view(rText).substr(postSymbolIndex, nextCharIndex - postSymbolIndex - 1));
+ aSymbol.append(rText.subView(postSymbolIndex, nextCharIndex - postSymbolIndex - 1));
r.TokenType |= KParseType::MISSING_QUOTE;
}
r.DequotedNameOrString = aSymbol.toString();
diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index 66a5655deed7..b437edcd198e 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -1086,7 +1086,7 @@ OUString getHebrewNativeNumberString(const OUString& aNumberString, bool useGere
makeHebrewNumber(value, output, true, useGeresh);
if (i < len)
- output.append(std::u16string_view(aNumberString).substr(i));
+ output.append(aNumberString.subView(i));
return output.makeStringAndClear();
}
@@ -1212,7 +1212,7 @@ OUString getCyrillicNativeNumberString(const OUString& aNumberString)
makeCyrillicNumber(value, output, true);
if (i < len)
- output.append(std::u16string_view(aNumberString).substr(i));
+ output.append(aNumberString.subView(i));
return output.makeStringAndClear();
}