From 1da69081732c8a429840edaaf10cfb789ea68df8 Mon Sep 17 00:00:00 2001 From: Noel Date: Thu, 28 Jan 2021 11:01:28 +0200 Subject: 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 --- xmloff/source/meta/xmlmetai.cxx | 2 +- xmloff/source/style/xmlnumfi.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'xmloff') diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx index 14721440bf9b..6e2a485ca828 100644 --- a/xmloff/source/meta/xmlmetai.cxx +++ b/xmloff/source/meta/xmlmetai.cxx @@ -244,7 +244,7 @@ void SvXMLMetaDocumentContext::setBuildId(OUString const& i_rBuildId, const uno: if ( nEnd != -1 ) { OUStringBuffer sBuffer( - i_rBuildId.copy( nBegin+1, nEnd-nBegin-1 ) ); + i_rBuildId.subView( nBegin+1, nEnd-nBegin-1 ) ); const OUString sBuildCompare( "$Build-" ); nBegin = i_rBuildId.indexOf( sBuildCompare, nEnd ); diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index 1e54872ada83..652ff02b6a2b 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -1832,9 +1832,9 @@ void SvXMLNumFormatContext::AddCurrency( const OUString& rContent, LanguageType // remove both quotes from aFormatCode OUString aOld = aFormatCode.makeStringAndClear(); if ( nFirst > 0 ) - aFormatCode.append( aOld.copy( 0, nFirst ) ); + aFormatCode.append( aOld.subView( 0, nFirst ) ); if ( nLength > nFirst + 2 ) - aFormatCode.append( aOld.copy( nFirst + 1, nLength - nFirst - 2 ) ); + aFormatCode.append( aOld.subView( nFirst + 1, nLength - nFirst - 2 ) ); } } } -- cgit