summaryrefslogtreecommitdiff
path: root/svgio
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-05-29 12:24:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-29 19:15:03 +0200
commitd286a820fac4dbac993e13afda52dde79b310af4 (patch)
treee7299ea3108c20a75155189fc6ada73446457ee3 /svgio
parent1959d451da06f501dd3446ebfe9c631b5400af26 (diff)
we can std::move the data out of TextBreakupHelper
and save some copying Change-Id: I34cbc2edfd53fcc440d1765dba471fcbb05b2b7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135088 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svgio')
-rw-r--r--svgio/source/svgreader/svgcharacternode.cxx7
-rw-r--r--svgio/source/svgreader/svgtextpathnode.cxx8
2 files changed, 7 insertions, 8 deletions
diff --git a/svgio/source/svgreader/svgcharacternode.cxx b/svgio/source/svgreader/svgcharacternode.cxx
index 0aba14c0bbd7..bdd0c4f3471b 100644
--- a/svgio/source/svgreader/svgcharacternode.cxx
+++ b/svgio/source/svgreader/svgcharacternode.cxx
@@ -515,13 +515,12 @@ namespace svgio::svgreader
if(pCandidate)
{
- const localTextBreakupHelper alocalTextBreakupHelper(*pCandidate, rSvgTextPosition);
- const Primitive2DContainer& aResult(
- alocalTextBreakupHelper.getResult());
+ localTextBreakupHelper alocalTextBreakupHelper(*pCandidate, rSvgTextPosition);
+ Primitive2DContainer aResult = alocalTextBreakupHelper.extractResult();
if(!aResult.empty())
{
- rTarget.append(aResult);
+ rTarget.append(std::move(aResult));
}
// also consume for the implied single space
diff --git a/svgio/source/svgreader/svgtextpathnode.cxx b/svgio/source/svgreader/svgtextpathnode.cxx
index 9b177383677f..129b2c280b88 100644
--- a/svgio/source/svgreader/svgtextpathnode.cxx
+++ b/svgio/source/svgreader/svgtextpathnode.cxx
@@ -412,19 +412,19 @@ namespace svgio::svgreader
if(pCandidate)
{
- const pathTextBreakupHelper aPathTextBreakupHelper(
+ pathTextBreakupHelper aPathTextBreakupHelper(
*pCandidate,
aPolygon,
fBasegfxPathLength,
fPosition,
rTextStart);
- const drawinglayer::primitive2d::Primitive2DContainer& aResult(
- aPathTextBreakupHelper.getResult());
+ drawinglayer::primitive2d::Primitive2DContainer aResult =
+ aPathTextBreakupHelper.extractResult();
if(!aResult.empty())
{
- rTarget.append(aResult);
+ rTarget.append(std::move(aResult));
}
// advance position to consumed