diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-01 20:55:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-02 08:00:28 +0200 |
commit | 7934085eb95cc0ff39e948525f0cc2b80edc0169 (patch) | |
tree | db728dddcd2f77103213bf3d46979aa3375768e7 /drawinglayer | |
parent | 7b31f7428a1469fa823538fe5cf9cf36bbe2df68 (diff) |
new loplugin:moveparam
Look for places where we can pass Primitive2DContainer by move reference
and so avoid unnecessary copies.
Change-Id: I1db167feba6d1a616ca6fc39778118ae20106bd1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122964
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx | 4 | ||||
-rw-r--r-- | drawinglayer/source/primitive2d/patternfillprimitive2d.cxx | 6 | ||||
-rw-r--r-- | drawinglayer/source/tools/converters.cxx | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx index 98ca81433f12..abca8a310925 100644 --- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx +++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx @@ -134,11 +134,11 @@ namespace drawinglayer::unorenderer new primitive2d::TransformPrimitive2D( aEmbedding, comphelper::sequenceToContainer<primitive2d::Primitive2DContainer>(aPrimitive2DSequence))); - const primitive2d::Primitive2DContainer xEmbedSeq { xEmbedRef }; + primitive2d::Primitive2DContainer xEmbedSeq { xEmbedRef }; BitmapEx aBitmapEx( convertToBitmapEx( - xEmbedSeq, + std::move(xEmbedSeq), aViewInformation2D, nDiscreteWidth, nDiscreteHeight, diff --git a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx index fc0538564896..cd4c58d11127 100644 --- a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx @@ -133,7 +133,7 @@ namespace drawinglayer::primitive2d const BitmapEx aBitmapEx( convertToBitmapEx( - xEmbedSeq, + std::move(xEmbedSeq), aViewInformation2D, mnDiscreteWidth, mnDiscreteHeight, @@ -191,10 +191,10 @@ namespace drawinglayer::primitive2d new primitive2d::TransformPrimitive2D( basegfx::utils::createScaleB2DHomMatrix(nWidth, nHeight), std::move(aContent))); - const primitive2d::Primitive2DContainer xEmbedSeq { xEmbedRef }; + primitive2d::Primitive2DContainer xEmbedSeq { xEmbedRef }; return convertToBitmapEx( - xEmbedSeq, + std::move(xEmbedSeq), aViewInformation2D, nWidth, nHeight, diff --git a/drawinglayer/source/tools/converters.cxx b/drawinglayer/source/tools/converters.cxx index 1f51384480cd..382b81197526 100644 --- a/drawinglayer/source/tools/converters.cxx +++ b/drawinglayer/source/tools/converters.cxx @@ -36,7 +36,7 @@ namespace drawinglayer { BitmapEx convertToBitmapEx( - const drawinglayer::primitive2d::Primitive2DContainer& rSeq, + drawinglayer::primitive2d::Primitive2DContainer&& rSeq, const geometry::ViewInformation2D& rViewInformation2D, sal_uInt32 nDiscreteWidth, sal_uInt32 nDiscreteHeight, @@ -61,12 +61,12 @@ namespace drawinglayer const drawinglayer::primitive2d::Primitive2DReference aEmbed( new drawinglayer::primitive2d::TransformPrimitive2D( basegfx::utils::createScaleB2DHomMatrix(fReduceFactor, fReduceFactor), - primitive2d::Primitive2DContainer(rSeq))); + std::move(rSeq))); aSequence = drawinglayer::primitive2d::Primitive2DContainer { aEmbed }; } else - aSequence = rSeq; + aSequence = std::move(rSeq); const Point aEmptyPoint; const Size aSizePixel(nDiscreteWidth, nDiscreteHeight); |