summaryrefslogtreecommitdiff
path: root/sw/source/core/text
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-01-28 11:01:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-28 11:11:28 +0100
commit1da69081732c8a429840edaaf10cfb789ea68df8 (patch)
treef343c9559e9dfb0263f7e33fe4306f81ec60e3fa /sw/source/core/text
parentb3737c638671ab39c5e6aaeaf5426d102392cc0a (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 'sw/source/core/text')
-rw-r--r--sw/source/core/text/txtfrm.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index c06ea3ef2713..6a63cc26500b 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -918,7 +918,7 @@ static TextFrameIndex UpdateMergedParaForInsert(MergedPara & rMerged,
if (it->nStart <= nIndex && nIndex <= it->nEnd)
{ // note: this can happen only once
text.insert(nTFIndex + (nIndex - it->nStart),
- rNode.GetText().copy(nIndex, nLen));
+ rNode.GetText().subView(nIndex, nLen));
it->nEnd += nLen;
nInserted = nLen;
assert(!bInserted);
@@ -945,7 +945,7 @@ static TextFrameIndex UpdateMergedParaForInsert(MergedPara & rMerged,
if (nIndex < it->nStart)
{
text.insert(nTFIndex,
- rNode.GetText().copy(nIndex, it->nStart - nIndex));
+ rNode.GetText().subView(nIndex, it->nStart - nIndex));
nInserted += it->nStart - nIndex;
it->nStart = nIndex;
bInserted = true;
@@ -963,7 +963,7 @@ static TextFrameIndex UpdateMergedParaForInsert(MergedPara & rMerged,
if (pNext && pNext->nStart <= nIndex + nLen)
{
text.insert(nTFIndex,
- rNode.GetText().copy(it->nEnd, pNext->nStart - it->nEnd));
+ rNode.GetText().subView(it->nEnd, pNext->nStart - it->nEnd));
nTFIndex += pNext->nStart - it->nEnd;
nInserted += pNext->nStart - it->nEnd;
pNext->nStart = it->nStart;
@@ -972,7 +972,7 @@ static TextFrameIndex UpdateMergedParaForInsert(MergedPara & rMerged,
else
{
text.insert(nTFIndex,
- rNode.GetText().copy(it->nEnd, nIndex + nLen - it->nEnd));
+ rNode.GetText().subView(it->nEnd, nIndex + nLen - it->nEnd));
nTFIndex += nIndex + nLen - it->nEnd;
nInserted += nIndex + nLen - it->nEnd;
it->nEnd = nIndex + nLen;
@@ -1000,7 +1000,7 @@ static TextFrameIndex UpdateMergedParaForInsert(MergedPara & rMerged,
if (!bInserted)
{ // must be in a gap
rMerged.extents.emplace(itInsert, const_cast<SwTextNode*>(&rNode), nIndex, nIndex + nLen);
- text.insert(nTFIndex, rNode.GetText().copy(nIndex, nLen));
+ text.insert(nTFIndex, rNode.GetText().subView(nIndex, nLen));
nInserted = nLen;
if (rMerged.extents.size() == 1 // also if it was empty!
|| rMerged.pParaPropsNode->GetIndex() < rNode.GetIndex())