From 943060836339f9640c612e9724f20e79db616e6e Mon Sep 17 00:00:00 2001 From: Noel Date: Thu, 28 Jan 2021 12:38:01 +0200 Subject: simplify code, use more subView() Change-Id: I569c7f34acbdf8451cd5c9acf1abd334637072d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110051 Tested-by: Jenkins Reviewed-by: Noel Grandin --- .../source/characterclassification/cclass_unicode_parser.cxx | 12 ++++++------ i18npool/source/nativenumber/nativenumbersupplier.cxx | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'i18npool') 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(¤t, 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(¤t, 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(); } -- cgit