diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-01-28 11:01:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-01-28 11:11:28 +0100 |
commit | 1da69081732c8a429840edaaf10cfb789ea68df8 (patch) | |
tree | f343c9559e9dfb0263f7e33fe4306f81ec60e3fa /svl | |
parent | b3737c638671ab39c5e6aaeaf5426d102392cc0a (diff) |
add string_view variants of methods to O[U]StringBuffer
and update the stringview loplugin to detect cases where we can
use these new methods.
Change-Id: I998efe02e35c8efcb3abfb4d7186165bbe6dfb2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110046
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/numbers/zformat.cxx | 4 | ||||
-rw-r--r-- | svl/source/numbers/zforscan.cxx | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index df8569b13dc6..85a34f28e842 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -1966,7 +1966,7 @@ OUString SvNumberformat::StripNewCurrencyDelimiters( const OUString& rStr ) sal_Int32 nEnd; if ( (nEnd = GetQuoteEnd( rStr, nPos )) >= 0 ) { - aTmp.append(rStr.copy( nStartPos, ++nEnd - nStartPos )); + aTmp.append(rStr.subView( nStartPos, ++nEnd - nStartPos )); nStartPos = nEnd; } else @@ -2651,7 +2651,7 @@ bool SvNumberformat::ImpGetScientificOutput(double fNumber, ++nExpStart; break; } - ExpStr = sStr.toString().copy( nExpStart ); // part following the "E+" + ExpStr = sStr.subView( nExpStart ); // part following the "E+" sStr.truncate( nExPos ); if ( rInfo.nCntPre != 1 ) // rescale Exp diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 5edbf931b927..c3f97d89c949 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -887,7 +887,7 @@ short ImpSvNumberformatScan::Next_Symbol( const OUString& rStr, { nLen = sKeyword[eType].getLength(); // Preserve a locale's keyword's case as entered. - sSymbolBuffer = rStr.copy( nPos-1, nLen); + sSymbolBuffer = rStr.subView( nPos-1, nLen); } if ((eType == NF_KEY_E || IsAmbiguousE(eType)) && nPos < rStr.getLength()) { |