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 /sc | |
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 'sc')
-rw-r--r-- | sc/source/core/tool/address.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/compiler.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/rangeutl.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/dif/difimp.cxx | 8 |
4 files changed, 7 insertions, 7 deletions
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index c7a16a8aeb49..f3ab5f917f9d 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -57,7 +57,7 @@ const sal_Unicode* parseQuotedNameWithBuffer( const sal_Unicode* pStart, const s // Push all the characters up to the current, but skip the very first // character which is the opening quote. - OUStringBuffer aBuf(OUString(pStart+1, p-pStart-1)); + OUStringBuffer aBuf(std::u16string_view(pStart+1, p-pStart-1)); ++p; // Skip the 2nd quote. sal_Unicode cPrev = 0; diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 32ff094ab348..24c594667231 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -1551,7 +1551,7 @@ struct ConventionXL_OOX : public ConventionXL_A1 { rBuffer.append('\''); ConventionXL_OOX::makeExternalDocStr( rBuffer, nFileId); - rBuffer.append( aQuotedTab.copy(1)); + rBuffer.append( aQuotedTab.subView(1)); } else { diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx index dfcdb30875ee..401ad6ad5722 100644 --- a/sc/source/core/tool/rangeutl.cxx +++ b/sc/source/core/tool/rangeutl.cxx @@ -809,7 +809,7 @@ void ScRangeStringConverter::GetStringFromXMLRangeString( OUString& rString, con { // initialize buffer with table name... sal_Int32 nDotPos = IndexOf(aBeginCell, '.', 0); - OUStringBuffer aBuf = aBeginCell.copy(0, nDotPos); + OUStringBuffer aBuf(aBeginCell.subView(0, nDotPos)); if (nEndCellDotPos == 0) { diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx index be95f26b06a4..2e68d4ba57ec 100644 --- a/sc/source/filter/dif/difimp.cxx +++ b/sc/source/filter/dif/difimp.cxx @@ -358,7 +358,7 @@ TOPIC DifParser::GetNextTopic() OSL_ENSURE( aLine.getLength() >= 2, "+GetNextTopic(): <String> is too short!" ); if( aLine.getLength() > 2 ) - m_aData.append(aLine.copy(1, aLine.getLength() - 2)); + m_aData.append(aLine.subView(1, aLine.getLength() - 2)); else m_aData.truncate(); eS = S_END; @@ -530,7 +530,7 @@ DATASET DifParser::GetNextDataset() // Single line string if( nLineLength >= 2 && pLine[nLineLength - 1] == '"' ) { - m_aData = aLine.copy( 1, nLineLength - 2 ); + m_aData = aLine.subView( 1, nLineLength - 2 ); lcl_DeEscapeQuotesDif(m_aData); eRet = D_STRING; } @@ -538,7 +538,7 @@ DATASET DifParser::GetNextDataset() else { // Multiline string - m_aData = aLine.copy( 1 ); + m_aData = aLine.subView( 1 ); bool bContinue = true; while ( bContinue ) { @@ -557,7 +557,7 @@ DATASET DifParser::GetNextDataset() } else if( pLine[nLineLength - 1] == '"' ) { - m_aData.append(aLine.copy(0, nLineLength -1)); + m_aData.append(aLine.subView(0, nLineLength -1)); lcl_DeEscapeQuotesDif(m_aData); eRet = D_STRING; } |