summaryrefslogtreecommitdiff
path: root/vcl/source/edit/texteng.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-01-11 11:21:46 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-01-11 13:55:14 +0100
commit70519a43e0d89a6b5d89859a6851f8c757c6b0c7 (patch)
treebc1f4a6b6510e3bff75e9dc54eb71e2fa6cfc3c8 /vcl/source/edit/texteng.cxx
parenta0210c5c5e8fd47b55567a8b18788d57d2b7decb (diff)
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 <sbergman@redhat.com>
Diffstat (limited to 'vcl/source/edit/texteng.cxx')
-rw-r--r--vcl/source/edit/texteng.cxx5
1 files changed, 3 insertions, 2 deletions
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 <cstdlib>
#include <memory>
#include <set>
+#include <string_view>
#include <vector>
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);
}