summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-09-23 15:35:34 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-24 11:33:32 +0200
commitc8d2fa176a15a7ae76d6a4b76aea5f108313c2ec (patch)
tree96cee630060986d6d2ab68b1ce2ca09a6a4fe922 /sw
parente1600348e49e1538459a0374fd97cd3173d4a4b9 (diff)
reduce copying in drawinglayer
by passing PrimitiveContainer&& around. There are lots of place where we were preparing a local variable of type PrimitiveContainer, and then copying it someplace else, then throwing it away. Change-Id: Iacfd983640c9e55da25800ccc01734dfc8b4d64a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/layout/paintfrm.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 1ff9e4eda7db..a16051590406 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -226,7 +226,7 @@ class BorderLines
{
drawinglayer::primitive2d::Primitive2DContainer m_Lines;
public:
- void AddBorderLines(const drawinglayer::primitive2d::Primitive2DContainer& rContainer);
+ void AddBorderLines(drawinglayer::primitive2d::Primitive2DContainer&& rContainer);
drawinglayer::primitive2d::Primitive2DContainer GetBorderLines_Clear()
{
drawinglayer::primitive2d::Primitive2DContainer lines;
@@ -504,11 +504,11 @@ SwSavePaintStatics::~SwSavePaintStatics()
gProp.aSScaleY = aSScaleY;
}
-void BorderLines::AddBorderLines(const drawinglayer::primitive2d::Primitive2DContainer& rContainer)
+void BorderLines::AddBorderLines(drawinglayer::primitive2d::Primitive2DContainer&& rContainer)
{
if(!rContainer.empty())
{
- m_Lines.append(rContainer);
+ m_Lines.append(std::move(rContainer));
}
}
@@ -4938,7 +4938,7 @@ void PaintCharacterBorder(
aStyleRight,
aStyleBottom,
aStyleLeft)));
- gProp.pBLines->AddBorderLines(aBorderLineTarget);
+ gProp.pBLines->AddBorderLines(std::move(aBorderLineTarget));
}
/// #i15844#
@@ -5323,7 +5323,7 @@ void SwFrame::PaintSwFrameShadowAndBorder(
aStyleRight,
aStyleBottom,
aStyleLeft)));
- gProp.pBLines->AddBorderLines(aBorderLineTarget);
+ gProp.pBLines->AddBorderLines(std::move(aBorderLineTarget));
}
}