From 70519a43e0d89a6b5d89859a6851f8c757c6b0c7 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 11 Jan 2019 11:21:46 +0100 Subject: Replace OUStringBuffer::appendCopy with append(std::u16string_view) ...which is more general Change-Id: I94f28f8eda887120cf5f143b4549e0339b60e6a7 Reviewed-on: https://gerrit.libreoffice.org/66155 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- vcl/source/edit/texteng.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'vcl/source/edit/texteng.cxx') diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index cdc1d4cbd11a..c4402d48924b 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -63,6 +63,7 @@ #include #include #include +#include #include using namespace ::com::sun::star; @@ -272,7 +273,7 @@ OUString TextEngine::GetTextLines( LineEnd aSeparator ) const for ( size_t nL = 0; nL < nLines; ++nL ) { TextLine& rLine = pTEParaPortion->GetLines()[nL]; - aText.appendCopy( pTEParaPortion->GetNode()->GetText(), rLine.GetStart(), rLine.GetEnd() - rLine.GetStart() ); + aText.append( std::u16string_view(pTEParaPortion->GetNode()->GetText()).substr(rLine.GetStart(), rLine.GetEnd() - rLine.GetStart()) ); if ( pSep && ( ( (nP+1) < nParas ) || ( (nL+1) < nLines ) ) ) aText.append(pSep); } @@ -409,7 +410,7 @@ OUString TextEngine::GetText( const TextSelection& rSel, LineEnd aSeparator ) co if ( nNode == nEndPara ) // may also be == nStart! nEndPos = aSel.GetEnd().GetIndex(); - aText.appendCopy(pNode->GetText(), nStartPos, nEndPos-nStartPos); + aText.append(std::u16string_view(pNode->GetText()).substr(nStartPos, nEndPos-nStartPos)); if ( nNode < nEndPara ) aText.append(pSep); } -- cgit