From c8d2fa176a15a7ae76d6a4b76aea5f108313c2ec Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 23 Sep 2021 15:35:34 +0200 Subject: 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 --- .../inc/primitive2d/graphicprimitivehelper2d.hxx | 2 +- .../inc/primitive2d/texteffectprimitive2d.hxx | 2 +- .../source/primitive2d/graphicprimitive2d.cxx | 2 +- .../primitive2d/graphicprimitivehelper2d.cxx | 4 +- .../source/primitive2d/pagepreviewprimitive2d.cxx | 4 +- .../source/primitive2d/patternfillprimitive2d.cxx | 4 +- .../primitive2d/textdecoratedprimitive2d.cxx | 4 +- .../source/primitive2d/texteffectprimitive2d.cxx | 4 +- .../source/primitive2d/textprimitive2d.cxx | 4 +- .../primitive2d/pagepreviewprimitive2d.hxx | 2 +- .../primitive2d/patternfillprimitive2d.hxx | 2 +- include/svx/sdr/animation/animationstate.hxx | 2 +- .../overlay/overlayprimitive2dsequenceobject.hxx | 2 +- include/svx/svddrgmt.hxx | 3 +- sd/source/ui/animations/motionpathtag.cxx | 2 +- svgio/inc/svgstyleattributes.hxx | 4 +- svgio/inc/svgtextnode.hxx | 2 +- svgio/source/svgreader/svganode.cxx | 2 +- svgio/source/svgreader/svgcirclenode.cxx | 2 +- svgio/source/svgreader/svgellipsenode.cxx | 2 +- svgio/source/svgreader/svggnode.cxx | 2 +- svgio/source/svgreader/svgimagenode.cxx | 2 +- svgio/source/svgreader/svglinenode.cxx | 2 +- svgio/source/svgreader/svgpathnode.cxx | 2 +- svgio/source/svgreader/svgpolynode.cxx | 2 +- svgio/source/svgreader/svgrectnode.cxx | 2 +- svgio/source/svgreader/svgstyleattributes.cxx | 10 +- svgio/source/svgreader/svgtextnode.cxx | 16 +- .../sdr/primitive2d/sdrcustomshapeprimitive2d.hxx | 2 +- svx/inc/sdr/primitive2d/sdrdecompositiontools.hxx | 4 +- svx/inc/sdr/primitive2d/sdrole2primitive2d.hxx | 2 +- svx/source/engine3d/view3d.cxx | 2 +- svx/source/sdr/animation/animationstate.cxx | 4 +- .../sdr/contact/viewcontactofsdrobjcustomshape.cxx | 2 +- svx/source/sdr/contact/viewobjectcontact.cxx | 3 +- .../sdr/contact/viewobjectcontactofpageobj.cxx | 2 +- .../overlay/overlayprimitive2dsequenceobject.cxx | 4 +- .../sdr/primitive2d/sdrcaptionprimitive2d.cxx | 2 +- .../sdr/primitive2d/sdrconnectorprimitive2d.cxx | 2 +- .../sdr/primitive2d/sdrcustomshapeprimitive2d.cxx | 8 +- .../sdr/primitive2d/sdrdecompositiontools.cxx | 166 ++++++++++----------- .../sdr/primitive2d/sdrellipseprimitive2d.cxx | 4 +- svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx | 6 +- .../sdr/primitive2d/sdrmeasureprimitive2d.cxx | 2 +- svx/source/sdr/primitive2d/sdrole2primitive2d.cxx | 6 +- svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx | 2 +- .../sdr/primitive2d/sdrrectangleprimitive2d.cxx | 2 +- svx/source/svdraw/svdcrtv.cxx | 2 +- svx/source/svdraw/svddrgmt.cxx | 8 +- svx/source/svdraw/svdhdl.cxx | 2 +- svx/source/table/viewcontactoftableobj.cxx | 4 +- sw/source/core/layout/paintfrm.cxx | 10 +- 52 files changed, 169 insertions(+), 175 deletions(-) diff --git a/drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx b/drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx index 001ff3159305..cecb1d8f1564 100644 --- a/drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx +++ b/drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx @@ -44,7 +44,7 @@ namespace drawinglayer::primitive2d applied. */ Primitive2DContainer create2DColorModifierEmbeddingsAsNeeded( - const Primitive2DContainer& rChildren, + Primitive2DContainer&& rChildren, GraphicDrawMode aGraphicDrawMode, double fLuminance = 0.0, // [-1.0 .. 1.0] double fContrast = 0.0, // [-1.0 .. 1.0] diff --git a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx index ce62b3110199..c586c6f23509 100644 --- a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx +++ b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx @@ -63,7 +63,7 @@ private: public: /// constructor - TextEffectPrimitive2D(const Primitive2DContainer& rTextContent, + TextEffectPrimitive2D(Primitive2DContainer&& rTextContent, const basegfx::B2DPoint& rRotationCenter, double fDirection, TextEffectStyle2D eTextEffectStyle2D); diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx index ac1ba3d5657e..0d57512f2f86 100644 --- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx @@ -114,7 +114,7 @@ void GraphicPrimitive2D::create2DDecomposition(Primitive2DContainer& rContainer, // embed to needed ModifiedColorPrimitive2D's if necessary. Do this for // adjustments and draw mode specials aRetval = create2DColorModifierEmbeddingsAsNeeded( - aRetval, aSuppressGraphicAttr.GetDrawMode(), + std::move(aRetval), aSuppressGraphicAttr.GetDrawMode(), std::clamp(aSuppressGraphicAttr.GetLuminance() * 0.01, -1.0, 1.0), std::clamp(aSuppressGraphicAttr.GetContrast() * 0.01, -1.0, 1.0), std::clamp(aSuppressGraphicAttr.GetChannelR() * 0.01, -1.0, 1.0), diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx index 37539685a8cd..c91dd683106b 100644 --- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx @@ -576,7 +576,7 @@ namespace drawinglayer::primitive2d } Primitive2DContainer create2DColorModifierEmbeddingsAsNeeded( - const Primitive2DContainer& rChildren, + Primitive2DContainer&& rChildren, GraphicDrawMode aGraphicDrawMode, double fLuminance, double fContrast, @@ -596,7 +596,7 @@ namespace drawinglayer::primitive2d // set child content as retval; that is what will be used as child content in all // embeddings from here - aRetval = rChildren; + aRetval = std::move(rChildren); if(GraphicDrawMode::Watermark == aGraphicDrawMode) { diff --git a/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx b/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx index 83468b36d46e..7aa1a440555e 100644 --- a/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx @@ -105,9 +105,9 @@ namespace drawinglayer::primitive2d const basegfx::B2DHomMatrix& rTransform, double fContentWidth, double fContentHeight, - const Primitive2DContainer& rPageContent) + Primitive2DContainer&& rPageContent) : mxDrawPage(rxDrawPage), - maPageContent(rPageContent), + maPageContent(std::move(rPageContent)), maTransform(rTransform), mfContentWidth(fContentWidth), mfContentHeight(fContentHeight) diff --git a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx index 8add9d587c6d..fc0538564896 100644 --- a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx @@ -262,10 +262,10 @@ namespace drawinglayer::primitive2d PatternFillPrimitive2D::PatternFillPrimitive2D( const basegfx::B2DPolyPolygon& rMask, - const Primitive2DContainer& rChildren, + Primitive2DContainer&& rChildren, const basegfx::B2DRange& rReferenceRange) : maMask(rMask), - maChildren(rChildren), + maChildren(std::move(rChildren)), maReferenceRange(rReferenceRange), mnDiscreteWidth(0), mnDiscreteHeight(0) diff --git a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx index 05417f55c505..7c11edfc14dc 100644 --- a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx @@ -271,7 +271,7 @@ namespace drawinglayer::primitive2d } Primitive2DReference aNewTextEffect(new TextEffectPrimitive2D( - aRetval, + std::move(aRetval), aDecTrans.getTranslate(), aDecTrans.getRotate(), aTextEffectStyle2D)); @@ -282,7 +282,7 @@ namespace drawinglayer::primitive2d // create outline using an own helper primitive since this will // be view-dependent Primitive2DReference aNewTextEffect(new TextEffectPrimitive2D( - aRetval, + std::move(aRetval), aDecTrans.getTranslate(), aDecTrans.getRotate(), TextEffectStyle2D::Outline)); diff --git a/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx b/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx index 5d6425fc77e5..2a3f9e849eca 100644 --- a/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx @@ -168,11 +168,11 @@ void TextEffectPrimitive2D::create2DDecomposition( } } -TextEffectPrimitive2D::TextEffectPrimitive2D(const Primitive2DContainer& rTextContent, +TextEffectPrimitive2D::TextEffectPrimitive2D(Primitive2DContainer&& rTextContent, const basegfx::B2DPoint& rRotationCenter, double fDirection, TextEffectStyle2D eTextEffectStyle2D) - : maTextContent(rTextContent) + : maTextContent(std::move(rTextContent)) , maRotationCenter(rRotationCenter) , mfDirection(fDirection) , meTextEffectStyle2D(eTextEffectStyle2D) diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx index 67deaed3649f..15b0868ee3fb 100644 --- a/drawinglayer/source/primitive2d/textprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx @@ -189,8 +189,8 @@ void TextSimplePortionPrimitive2D::create2DDecomposition( aPolygonTransform.decompose(aScale, aTranslate, fRotate, fShearX); // create outline text effect with current content and replace - Primitive2DReference aNewTextEffect( - new TextEffectPrimitive2D(aRetval, aTranslate, fRotate, TextEffectStyle2D::Outline)); + Primitive2DReference aNewTextEffect(new TextEffectPrimitive2D( + std::move(aRetval), aTranslate, fRotate, TextEffectStyle2D::Outline)); aRetval = Primitive2DContainer{ aNewTextEffect }; } diff --git a/include/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx b/include/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx index e54c883b0945..6ee1475575c0 100644 --- a/include/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx @@ -66,7 +66,7 @@ namespace drawinglayer::primitive2d const basegfx::B2DHomMatrix& rTransform, double fContentWidth, double fContentHeight, - const Primitive2DContainer& rPageContent); + Primitive2DContainer&& rPageContent); /// data read access const css::uno::Reference< css::drawing::XDrawPage >& getXDrawPage() const { return mxDrawPage; } diff --git a/include/drawinglayer/primitive2d/patternfillprimitive2d.hxx b/include/drawinglayer/primitive2d/patternfillprimitive2d.hxx index f9c183f41ad6..63a3e6d8d274 100644 --- a/include/drawinglayer/primitive2d/patternfillprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/patternfillprimitive2d.hxx @@ -64,7 +64,7 @@ namespace drawinglayer::primitive2d /// constructor PatternFillPrimitive2D( const basegfx::B2DPolyPolygon& rMask, - const Primitive2DContainer& rChildren, + Primitive2DContainer&& rChildren, const basegfx::B2DRange& rReferenceRange); /// data read access diff --git a/include/svx/sdr/animation/animationstate.hxx b/include/svx/sdr/animation/animationstate.hxx index 078cc6342801..92878897e072 100644 --- a/include/svx/sdr/animation/animationstate.hxx +++ b/include/svx/sdr/animation/animationstate.hxx @@ -42,7 +42,7 @@ namespace sdr::animation public: // basic constructor. - PrimitiveAnimation(sdr::contact::ViewObjectContact& rVOContact, const drawinglayer::primitive2d::Primitive2DContainer& rAnimatedPrimitives); + PrimitiveAnimation(sdr::contact::ViewObjectContact& rVOContact, drawinglayer::primitive2d::Primitive2DContainer&& rAnimatedPrimitives); // destructor virtual ~PrimitiveAnimation() override; diff --git a/include/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx b/include/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx index fd5a87ac6404..06e7428de191 100644 --- a/include/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx +++ b/include/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx @@ -35,7 +35,7 @@ namespace sdr::overlay virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; public: - explicit OverlayPrimitive2DSequenceObject(const drawinglayer::primitive2d::Primitive2DContainer& rSequence); + explicit OverlayPrimitive2DSequenceObject(drawinglayer::primitive2d::Primitive2DContainer&& rSequence); virtual ~OverlayPrimitive2DSequenceObject() override; }; diff --git a/include/svx/svddrgmt.hxx b/include/svx/svddrgmt.hxx index 626467f18465..dec7c1b8c42e 100644 --- a/include/svx/svddrgmt.hxx +++ b/include/svx/svddrgmt.hxx @@ -90,8 +90,7 @@ private: drawinglayer::primitive2d::Primitive2DContainer maPrimitive2DSequence; public: - SdrDragEntryPrimitive2DSequence( - const drawinglayer::primitive2d::Primitive2DContainer& rSequence); + SdrDragEntryPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DContainer&& rSequence); virtual ~SdrDragEntryPrimitive2DSequence() override; virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod) override; diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx index 360c709ac7ad..72bf2d1620b4 100644 --- a/sd/source/ui/animations/motionpathtag.cxx +++ b/sd/source/ui/animations/motionpathtag.cxx @@ -301,7 +301,7 @@ void SdPathHdl::CreateB2dIAObject() { const sdr::contact::ViewContact& rVC = mpPathObj->GetViewContact(); const drawinglayer::primitive2d::Primitive2DContainer& aSequence = rVC.getViewIndependentPrimitive2DContainer(); - std::unique_ptr pNew(new sdr::overlay::OverlayPrimitive2DSequenceObject(aSequence)); + std::unique_ptr pNew(new sdr::overlay::OverlayPrimitive2DSequenceObject(drawinglayer::primitive2d::Primitive2DContainer(aSequence))); // OVERLAYMANAGER insertNewlyCreatedOverlayObjectForSdrHdl( diff --git a/svgio/inc/svgstyleattributes.hxx b/svgio/inc/svgstyleattributes.hxx index 05f3ef085fd3..3fbb7a2ff324 100644 --- a/svgio/inc/svgstyleattributes.hxx +++ b/svgio/inc/svgstyleattributes.hxx @@ -282,14 +282,14 @@ namespace svgio::svgreader /// helper which does the necessary with a given path void add_text( drawinglayer::primitive2d::Primitive2DContainer& rTarget, - drawinglayer::primitive2d::Primitive2DContainer const & rSource) const; + drawinglayer::primitive2d::Primitive2DContainer&& rSource) const; void add_path( const basegfx::B2DPolyPolygon& rPath, drawinglayer::primitive2d::Primitive2DContainer& rTarget, const basegfx::utils::PointIndexSet* pHelpPointIndices) const; void add_postProcess( drawinglayer::primitive2d::Primitive2DContainer& rTarget, - const drawinglayer::primitive2d::Primitive2DContainer& rSource, + drawinglayer::primitive2d::Primitive2DContainer&& rSource, const std::optional& pTransform) const; /// helper to set mpCssStyleParent temporarily for CSS style hierarchies diff --git a/svgio/inc/svgtextnode.hxx b/svgio/inc/svgtextnode.hxx index 9ff73d66d104..b72d1043b8c0 100644 --- a/svgio/inc/svgtextnode.hxx +++ b/svgio/inc/svgtextnode.hxx @@ -46,7 +46,7 @@ namespace svgio::svgreader static void addTextPrimitives( const SvgNode& rCandidate, drawinglayer::primitive2d::Primitive2DContainer& rTarget, - drawinglayer::primitive2d::Primitive2DContainer const & rSource); + drawinglayer::primitive2d::Primitive2DContainer&& rSource); public: SvgTextNode( diff --git a/svgio/source/svgreader/svganode.cxx b/svgio/source/svgreader/svganode.cxx index 358282d143e9..aa473eb9187f 100644 --- a/svgio/source/svgreader/svganode.cxx +++ b/svgio/source/svgreader/svganode.cxx @@ -93,7 +93,7 @@ namespace svgio::svgreader if(!aContent.empty()) { - pStyle->add_postProcess(rTarget, aContent, getTransform()); + pStyle->add_postProcess(rTarget, std::move(aContent), getTransform()); } } } diff --git a/svgio/source/svgreader/svgcirclenode.cxx b/svgio/source/svgreader/svgcirclenode.cxx index 8577ba2726f6..a9f8fa75941e 100644 --- a/svgio/source/svgreader/svgcirclenode.cxx +++ b/svgio/source/svgreader/svgcirclenode.cxx @@ -135,7 +135,7 @@ namespace svgio::svgreader if(!aNewTarget.empty()) { - pStyle->add_postProcess(rTarget, aNewTarget, getTransform()); + pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform()); } } } // end of namespace svgio::svgreader diff --git a/svgio/source/svgreader/svgellipsenode.cxx b/svgio/source/svgreader/svgellipsenode.cxx index b1646b30d929..2317648ef808 100644 --- a/svgio/source/svgreader/svgellipsenode.cxx +++ b/svgio/source/svgreader/svgellipsenode.cxx @@ -150,7 +150,7 @@ namespace svgio::svgreader if(!aNewTarget.empty()) { - pStyle->add_postProcess(rTarget, aNewTarget, getTransform()); + pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform()); } } } // end of namespace svgio::svgreader diff --git a/svgio/source/svgreader/svggnode.cxx b/svgio/source/svgreader/svggnode.cxx index 8e2c1a2486da..02341d459147 100644 --- a/svgio/source/svgreader/svggnode.cxx +++ b/svgio/source/svgreader/svggnode.cxx @@ -108,7 +108,7 @@ namespace svgio::svgreader if(!aContent.empty()) { - pStyle->add_postProcess(rTarget, aContent, getTransform()); + pStyle->add_postProcess(rTarget, std::move(aContent), getTransform()); } } } diff --git a/svgio/source/svgreader/svgimagenode.cxx b/svgio/source/svgreader/svgimagenode.cxx index 15d48916eae5..2390f74dac03 100644 --- a/svgio/source/svgreader/svgimagenode.cxx +++ b/svgio/source/svgreader/svgimagenode.cxx @@ -346,7 +346,7 @@ namespace svgio::svgreader } // embed and add to rTarget, take local extra-transform into account - pStyle->add_postProcess(rTarget, aNewTarget, getTransform()); + pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform()); } } diff --git a/svgio/source/svgreader/svglinenode.cxx b/svgio/source/svgreader/svglinenode.cxx index 4259c4b1ca95..d593155fa38c 100644 --- a/svgio/source/svgreader/svglinenode.cxx +++ b/svgio/source/svgreader/svglinenode.cxx @@ -145,7 +145,7 @@ namespace svgio::svgreader if(!aNewTarget.empty()) { - pStyle->add_postProcess(rTarget, aNewTarget, getTransform()); + pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform()); } } } // end of namespace svgio::svgreader diff --git a/svgio/source/svgreader/svgpathnode.cxx b/svgio/source/svgreader/svgpathnode.cxx index f3637bcf410f..1a5f931dea64 100644 --- a/svgio/source/svgreader/svgpathnode.cxx +++ b/svgio/source/svgreader/svgpathnode.cxx @@ -108,7 +108,7 @@ namespace svgio::svgreader if(!aNewTarget.empty()) { - pStyle->add_postProcess(rTarget, aNewTarget, getTransform()); + pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform()); } } } diff --git a/svgio/source/svgreader/svgpolynode.cxx b/svgio/source/svgreader/svgpolynode.cxx index 0956dcd2dad5..64d1949d7d63 100644 --- a/svgio/source/svgreader/svgpolynode.cxx +++ b/svgio/source/svgreader/svgpolynode.cxx @@ -106,7 +106,7 @@ namespace svgio::svgreader if(!aNewTarget.empty()) { - pStyle->add_postProcess(rTarget, aNewTarget, getTransform()); + pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform()); } } } diff --git a/svgio/source/svgreader/svgrectnode.cxx b/svgio/source/svgreader/svgrectnode.cxx index 27c1042edcfc..2bb1f166f595 100644 --- a/svgio/source/svgreader/svgrectnode.cxx +++ b/svgio/source/svgreader/svgrectnode.cxx @@ -207,7 +207,7 @@ namespace svgio::svgreader if(!aNewTarget.empty()) { - pStyle->add_postProcess(rTarget, aNewTarget, getTransform()); + pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform()); } } } // end of namespace svgio::svgreader diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx index 4d2b155f3ff8..3ad148c4624c 100644 --- a/svgio/source/svgreader/svgstyleattributes.cxx +++ b/svgio/source/svgreader/svgstyleattributes.cxx @@ -258,7 +258,7 @@ namespace svgio::svgreader void SvgStyleAttributes::add_text( drawinglayer::primitive2d::Primitive2DContainer& rTarget, - drawinglayer::primitive2d::Primitive2DContainer const & rSource) const + drawinglayer::primitive2d::Primitive2DContainer&& rSource) const { if(rSource.empty()) return; @@ -321,7 +321,7 @@ namespace svgio::svgreader else if(pFill) { // add the already prepared primitives for single color fill - rTarget.append(rSource); + rTarget.append(std::move(rSource)); } // add stroke @@ -588,7 +588,7 @@ namespace svgio::svgreader rTarget.push_back( new drawinglayer::primitive2d::PatternFillPrimitive2D( rPath, - aPrimitives, + std::move(aPrimitives), aReferenceRange)); } @@ -1148,7 +1148,7 @@ namespace svgio::svgreader void SvgStyleAttributes::add_postProcess( drawinglayer::primitive2d::Primitive2DContainer& rTarget, - const drawinglayer::primitive2d::Primitive2DContainer& rSource, + drawinglayer::primitive2d::Primitive2DContainer&& rSource, const std::optional& pTransform) const { if(rSource.empty()) @@ -1161,7 +1161,7 @@ namespace svgio::svgreader return; } - drawinglayer::primitive2d::Primitive2DContainer aSource(rSource); + drawinglayer::primitive2d::Primitive2DContainer aSource(std::move(rSource)); if(basegfx::fTools::less(fOpacity, 1.0)) { diff --git a/svgio/source/svgreader/svgtextnode.cxx b/svgio/source/svgreader/svgtextnode.cxx index bda316cae4a4..25ad066e9bbc 100644 --- a/svgio/source/svgreader/svgtextnode.cxx +++ b/svgio/source/svgreader/svgtextnode.cxx @@ -83,7 +83,7 @@ namespace svgio::svgreader void SvgTextNode::addTextPrimitives( const SvgNode& rCandidate, drawinglayer::primitive2d::Primitive2DContainer& rTarget, - drawinglayer::primitive2d::Primitive2DContainer const & rSource) + drawinglayer::primitive2d::Primitive2DContainer&& rSource) { if(rSource.empty()) return; @@ -93,13 +93,13 @@ namespace svgio::svgreader if(pAttributes) { // add text with taking all Fill/Stroke attributes into account - pAttributes->add_text(rTarget, rSource); + pAttributes->add_text(rTarget, std::move(rSource)); } else { // should not happen, every subnode from SvgTextNode will at least // return the attributes from SvgTextNode. Nonetheless, add text - rTarget.append(rSource); + rTarget.append(std::move(rSource)); } } @@ -144,7 +144,7 @@ namespace svgio::svgreader if(!aNewTarget.empty()) { - addTextPrimitives(rCandidate, rTarget, aNewTarget); + addTextPrimitives(rCandidate, rTarget, std::move(aNewTarget)); } } @@ -171,7 +171,7 @@ namespace svgio::svgreader if(!aNewTarget.empty()) { - addTextPrimitives(rCandidate, rTarget, aNewTarget); + addTextPrimitives(rCandidate, rTarget, std::move(aNewTarget)); } } break; @@ -200,7 +200,7 @@ namespace svgio::svgreader if(!aNewTarget.empty()) { - addTextPrimitives(rCandidate, rTarget, aNewTarget); + addTextPrimitives(rCandidate, rTarget, std::move(aNewTarget)); } } } @@ -245,13 +245,13 @@ namespace svgio::svgreader { drawinglayer::primitive2d::Primitive2DContainer aNewTarget2; - addTextPrimitives(*this, aNewTarget2, aNewTarget); + addTextPrimitives(*this, aNewTarget2, std::move(aNewTarget)); aNewTarget = aNewTarget2; } if(!aNewTarget.empty()) { - pStyle->add_postProcess(rTarget, aNewTarget, getTransform()); + pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform()); } } diff --git a/svx/inc/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx index e84ef0a4d3e8..f5ed1f6b2276 100644 --- a/svx/inc/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx +++ b/svx/inc/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx @@ -53,7 +53,7 @@ namespace drawinglayer::primitive2d public: SdrCustomShapePrimitive2D( const attribute::SdrEffectsTextAttribute& rSdrSTAttribute, - const Primitive2DContainer& rSubPrimitives, + Primitive2DContainer&& rSubPrimitives, const basegfx::B2DHomMatrix& rTextBox, bool bWordWrap, bool b3DShape, diff --git a/svx/inc/sdr/primitive2d/sdrdecompositiontools.hxx b/svx/inc/sdr/primitive2d/sdrdecompositiontools.hxx index 01888e60d141..ac65e0eda30f 100644 --- a/svx/inc/sdr/primitive2d/sdrdecompositiontools.hxx +++ b/svx/inc/sdr/primitive2d/sdrdecompositiontools.hxx @@ -69,13 +69,13 @@ namespace drawinglayer::primitive2d bool bWordWrap); Primitive2DContainer SVXCORE_DLLPUBLIC createEmbeddedShadowPrimitive( - const Primitive2DContainer& rContent, + Primitive2DContainer&& rContent, const attribute::SdrShadowAttribute& rShadow, const basegfx::B2DHomMatrix& rObjectMatrix = basegfx::B2DHomMatrix(), const Primitive2DContainer* pContentForShadow = nullptr); Primitive2DContainer SVXCORE_DLLPUBLIC createEmbeddedGlowPrimitive( - const Primitive2DContainer& rContent, + Primitive2DContainer&& rContent, const attribute::SdrGlowAttribute& rGlow); Primitive2DContainer SVXCORE_DLLPUBLIC createEmbeddedSoftEdgePrimitive( diff --git a/svx/inc/sdr/primitive2d/sdrole2primitive2d.hxx b/svx/inc/sdr/primitive2d/sdrole2primitive2d.hxx index 2618f75b03b2..615eb3299def 100644 --- a/svx/inc/sdr/primitive2d/sdrole2primitive2d.hxx +++ b/svx/inc/sdr/primitive2d/sdrole2primitive2d.hxx @@ -39,7 +39,7 @@ namespace drawinglayer::primitive2d public: SdrOle2Primitive2D( - const Primitive2DContainer& rOLEContent, + Primitive2DContainer&& rOLEContent, const basegfx::B2DHomMatrix& rTransform, const attribute::SdrLineFillEffectsTextAttribute& rSdrLFSTAttribute); diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index 33f1162cb3f9..920dc42645d8 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -175,7 +175,7 @@ void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirr drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparencePrimitive2D(new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(std::move(aContent), 0.5)); aContent = drawinglayer::primitive2d::Primitive2DContainer { aUnifiedTransparencePrimitive2D }; - std::unique_ptr pNew(new sdr::overlay::OverlayPrimitive2DSequenceObject(aContent)); + std::unique_ptr pNew(new sdr::overlay::OverlayPrimitive2DSequenceObject(std::move(aContent))); xTargetOverlay->add(*pNew); maObjects.append(std::move(pNew)); diff --git a/svx/source/sdr/animation/animationstate.cxx b/svx/source/sdr/animation/animationstate.cxx index 38c24711c849..074f2082e460 100644 --- a/svx/source/sdr/animation/animationstate.cxx +++ b/svx/source/sdr/animation/animationstate.cxx @@ -99,9 +99,9 @@ namespace sdr::animation mrVOContact.GetObjectContact().getPrimitiveAnimator().InsertEvent(*this); } - PrimitiveAnimation::PrimitiveAnimation(sdr::contact::ViewObjectContact& rVOContact, const drawinglayer::primitive2d::Primitive2DContainer& rAnimatedPrimitives) + PrimitiveAnimation::PrimitiveAnimation(sdr::contact::ViewObjectContact& rVOContact, drawinglayer::primitive2d::Primitive2DContainer&& rAnimatedPrimitives) : mrVOContact(rVOContact), - maAnimatedPrimitives(rAnimatedPrimitives) + maAnimatedPrimitives(std::move(rAnimatedPrimitives)) { if (!comphelper::LibreOfficeKit::isActive()) // setup initially diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx index f676bd89b739..a28e06f589e3 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx @@ -227,7 +227,7 @@ namespace sdr::contact const drawinglayer::primitive2d::Primitive2DReference xReference( new drawinglayer::primitive2d::SdrCustomShapePrimitive2D( aAttribute, - xGroup, + std::move(xGroup), aTextBoxMatrix, bWordWrap, b3DShape, diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx index 00674a200bf1..22eb52a99af4 100644 --- a/svx/source/sdr/contact/viewobjectcontact.cxx +++ b/svx/source/sdr/contact/viewobjectcontact.cxx @@ -67,6 +67,7 @@ public: // data access const drawinglayer::primitive2d::Primitive2DContainer& getPrimitive2DSequence() const { return maPrimitive2DSequence; } + drawinglayer::primitive2d::Primitive2DContainer extractPrimitive2DSequence() const { return std::move(maPrimitive2DSequence); } }; AnimatedExtractingProcessor2D::AnimatedExtractingProcessor2D( @@ -283,7 +284,7 @@ void ViewObjectContact::checkForPrimitive2DAnimations() if(!aAnimatedExtractor.getPrimitive2DSequence().empty()) { // derived primitiveList is animated, setup new PrimitiveAnimation - mpPrimitiveAnimation.reset( new sdr::animation::PrimitiveAnimation(*this, aAnimatedExtractor.getPrimitive2DSequence()) ); + mpPrimitiveAnimation.reset( new sdr::animation::PrimitiveAnimation(*this, aAnimatedExtractor.extractPrimitive2DSequence()) ); } } } diff --git a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx index 023d46bfba80..07b133b123af 100644 --- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx @@ -262,7 +262,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewObjectContactOfPageObj::crea { const uno::Reference< drawing::XDrawPage > xDrawPage(GetXDrawPageForSdrPage(const_cast< SdrPage*>(pPage))); const drawinglayer::primitive2d::Primitive2DReference xPagePreview(new drawinglayer::primitive2d::PagePreviewPrimitive2D( - xDrawPage, aPageObjectTransform, fPageWidth, fPageHeight, xPageContent)); + xDrawPage, aPageObjectTransform, fPageWidth, fPageHeight, std::move(xPageContent))); xRetval = drawinglayer::primitive2d::Primitive2DContainer { xPagePreview }; } } diff --git a/svx/source/sdr/overlay/overlayprimitive2dsequenceobject.cxx b/svx/source/sdr/overlay/overlayprimitive2dsequenceobject.cxx index 9b589ed04fba..eabd290f821a 100644 --- a/svx/source/sdr/overlay/overlayprimitive2dsequenceobject.cxx +++ b/svx/source/sdr/overlay/overlayprimitive2dsequenceobject.cxx @@ -28,9 +28,9 @@ namespace sdr::overlay return maSequence; } - OverlayPrimitive2DSequenceObject::OverlayPrimitive2DSequenceObject(const drawinglayer::primitive2d::Primitive2DContainer& rSequence) + OverlayPrimitive2DSequenceObject::OverlayPrimitive2DSequenceObject(drawinglayer::primitive2d::Primitive2DContainer&& rSequence) : OverlayObjectWithBasePosition(basegfx::B2DPoint(), COL_BLACK), - maSequence(rSequence) + maSequence(std::move(rSequence)) { } diff --git a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx index 69e7225f1fb0..507f9ae0f4e3 100644 --- a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx @@ -114,7 +114,7 @@ namespace drawinglayer::primitive2d // add shadow if(!getSdrLFSTAttribute().getShadow().isDefault()) { - aRetval = createEmbeddedShadowPrimitive(aRetval, getSdrLFSTAttribute().getShadow()); + aRetval = createEmbeddedShadowPrimitive(std::move(aRetval), getSdrLFSTAttribute().getShadow()); } rContainer.insert(rContainer.end(), aRetval.begin(), aRetval.end()); diff --git a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx index 60eaa006714a..21d48e9b1eab 100644 --- a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx @@ -68,7 +68,7 @@ namespace drawinglayer::primitive2d if(!getSdrLSTAttribute().getShadow().isDefault()) { aRetval = createEmbeddedShadowPrimitive( - aRetval, + std::move(aRetval), getSdrLSTAttribute().getShadow()); } diff --git a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx index 50a2061ef9e9..040ed2ccf482 100644 --- a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx @@ -61,7 +61,7 @@ namespace drawinglayer::primitive2d if (!aRetval.empty() && !getSdrSTAttribute().getGlow().isDefault()) { // glow - aRetval = createEmbeddedGlowPrimitive(aRetval, getSdrSTAttribute().getGlow()); + aRetval = createEmbeddedGlowPrimitive(std::move(aRetval), getSdrSTAttribute().getGlow()); } // add shadow @@ -79,7 +79,7 @@ namespace drawinglayer::primitive2d // shadow will be correct (using ColorModifierStack), but expensive. if(!get3DShape()) { - aRetval = createEmbeddedShadowPrimitive(aRetval, getSdrSTAttribute().getShadow(), + aRetval = createEmbeddedShadowPrimitive(std::move(aRetval), getSdrSTAttribute().getShadow(), maTransform); } } @@ -89,13 +89,13 @@ namespace drawinglayer::primitive2d SdrCustomShapePrimitive2D::SdrCustomShapePrimitive2D( const attribute::SdrEffectsTextAttribute& rSdrSTAttribute, - const Primitive2DContainer& rSubPrimitives, + Primitive2DContainer&& rSubPrimitives, const basegfx::B2DHomMatrix& rTextBox, bool bWordWrap, bool b3DShape, const basegfx::B2DHomMatrix& rTransform) : maSdrSTAttribute(rSdrSTAttribute), - maSubPrimitives(rSubPrimitives), + maSubPrimitives(std::move(rSubPrimitives)), maTextBox(rTextBox), mbWordWrap(bWordWrap), mb3DShape(b3DShape), diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx index 1f74149b0b9a..7c04f1c54e0a 100644 --- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx +++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx @@ -537,117 +537,111 @@ basegfx::B2DRange getTextAnchorRange(const attribute::SdrTextAttribute& rText, } Primitive2DContainer createEmbeddedShadowPrimitive( - const Primitive2DContainer& rContent, + Primitive2DContainer&& rContent, const attribute::SdrShadowAttribute& rShadow, const basegfx::B2DHomMatrix& rObjectMatrix, const Primitive2DContainer* pContentForShadow) { - if(!rContent.empty()) - { - basegfx::B2DHomMatrix aShadowOffset; + if(rContent.empty()) + return std::move(rContent); - { - if(rShadow.getSize().getX() != 100000) - { - basegfx::B2DTuple aScale; - basegfx::B2DTuple aTranslate; - double fRotate = 0; - double fShearX = 0; - rObjectMatrix.decompose(aScale, aTranslate, fRotate, fShearX); - // Scale the shadow - double nTranslateX = aTranslate.getX(); - double nTranslateY = aTranslate.getY(); - - // The origin for scaling is the top left corner by default. A negative - // shadow offset changes the origin. - if (rShadow.getOffset().getX() < 0) - nTranslateX += aScale.getX(); - if (rShadow.getOffset().getY() < 0) - nTranslateY += aScale.getY(); - - aShadowOffset.translate(-nTranslateX, -nTranslateY); - aShadowOffset.scale(rShadow.getSize().getX() * 0.00001, rShadow.getSize().getY() * 0.00001); - aShadowOffset.translate(nTranslateX, nTranslateY); - } + basegfx::B2DHomMatrix aShadowOffset; - aShadowOffset.translate(rShadow.getOffset().getX(), rShadow.getOffset().getY()); - } + if(rShadow.getSize().getX() != 100000) + { + basegfx::B2DTuple aScale; + basegfx::B2DTuple aTranslate; + double fRotate = 0; + double fShearX = 0; + rObjectMatrix.decompose(aScale, aTranslate, fRotate, fShearX); + // Scale the shadow + double nTranslateX = aTranslate.getX(); + double nTranslateY = aTranslate.getY(); + + // The origin for scaling is the top left corner by default. A negative + // shadow offset changes the origin. + if (rShadow.getOffset().getX() < 0) + nTranslateX += aScale.getX(); + if (rShadow.getOffset().getY() < 0) + nTranslateY += aScale.getY(); + + aShadowOffset.translate(-nTranslateX, -nTranslateY); + aShadowOffset.scale(rShadow.getSize().getX() * 0.00001, rShadow.getSize().getY() * 0.00001); + aShadowOffset.translate(nTranslateX, nTranslateY); + } + + aShadowOffset.translate(rShadow.getOffset().getX(), rShadow.getOffset().getY()); - // create shadow primitive and add content - const Primitive2DContainer& rContentForShadow + // create shadow primitive and add content + const Primitive2DContainer& rContentForShadow = pContentForShadow ? *pContentForShadow : rContent; - int nContentWithTransparence = std::count_if( - rContentForShadow.begin(), rContentForShadow.end(), - [](const Primitive2DReference& xChild) { - auto pChild = dynamic_cast(xChild.get()); - return pChild && pChild->getTransparenceForShadow() != 0; - }); - if (nContentWithTransparence == 0) + int nContentWithTransparence = std::count_if( + rContentForShadow.begin(), rContentForShadow.end(), + [](const Primitive2DReference& xChild) { + auto pChild = dynamic_cast(xChild.get()); + return pChild && pChild->getTransparenceForShadow() != 0; + }); + if (nContentWithTransparence == 0) + { + Primitive2DContainer aRetval(2); + aRetval[0] = Primitive2DReference( + new ShadowPrimitive2D( + aShadowOffset, + rShadow.getColor(), + rShadow.getBlur(), + Primitive2DContainer(pContentForShadow ? *pContentForShadow : rContent))); + + if (0.0 != rShadow.getTransparence()) { - Primitive2DContainer aRetval(2); - aRetval[0] = Primitive2DReference( - new ShadowPrimitive2D( - aShadowOffset, - rShadow.getColor(), - rShadow.getBlur(), - Primitive2DContainer(pContentForShadow ? *pContentForShadow : rContent))); - - if (0.0 != rShadow.getTransparence()) - { - // create SimpleTransparencePrimitive2D - Primitive2DContainer aTempContent{ aRetval[0] }; + // create SimpleTransparencePrimitive2D + Primitive2DContainer aTempContent{ aRetval[0] }; - aRetval[0] = Primitive2DReference( - new UnifiedTransparencePrimitive2D( - std::move(aTempContent), - rShadow.getTransparence())); - } - - aRetval[1] = Primitive2DReference(new GroupPrimitive2D(Primitive2DContainer(rContent))); - return aRetval; + aRetval[0] = Primitive2DReference( + new UnifiedTransparencePrimitive2D( + std::move(aTempContent), + rShadow.getTransparence())); } - Primitive2DContainer aRetval; - for (const auto& xChild : rContentForShadow) + aRetval[1] = Primitive2DReference(new GroupPrimitive2D(std::move(rContent))); + return aRetval; + } + + Primitive2DContainer aRetval; + for (const auto& xChild : rContentForShadow) + { + double fChildTransparence = 0.0; + auto pChild = dynamic_cast(xChild.get()); + if (pChild) { - double fChildTransparence = 0.0; - auto pChild = dynamic_cast(xChild.get()); - if (pChild) - { fChildTransparence = pChild->getTransparenceForShadow(); fChildTransparence /= 100; - } - aRetval.push_back(Primitive2DReference( - new ShadowPrimitive2D(aShadowOffset, rShadow.getColor(), rShadow.getBlur(), - Primitive2DContainer({ xChild })))); - if (rShadow.getTransparence() != 0.0 || fChildTransparence != 0.0) - { - Primitive2DContainer aTempContent{ aRetval.back() }; + } + aRetval.push_back(Primitive2DReference( + new ShadowPrimitive2D(aShadowOffset, rShadow.getColor(), rShadow.getBlur(), + Primitive2DContainer({ xChild })))); + if (rShadow.getTransparence() != 0.0 || fChildTransparence != 0.0) + { + Primitive2DContainer aTempContent{ aRetval.back() }; - double fChildAlpha = 1.0 - fChildTransparence; - double fShadowAlpha = 1.0 - rShadow.getTransparence(); - double fTransparence = 1.0 - fChildAlpha * fShadowAlpha; - aRetval.back() = Primitive2DReference(new UnifiedTransparencePrimitive2D( + double fChildAlpha = 1.0 - fChildTransparence; + double fShadowAlpha = 1.0 - rShadow.getTransparence(); + double fTransparence = 1.0 - fChildAlpha * fShadowAlpha; + aRetval.back() = Primitive2DReference(new UnifiedTransparencePrimitive2D( std::move(aTempContent), fTransparence)); - } } - - aRetval.push_back( - Primitive2DReference(new GroupPrimitive2D(Primitive2DContainer(rContent)))); - return aRetval; - } - else - { - return rContent; } + + aRetval.push_back( + Primitive2DReference(new GroupPrimitive2D(std::move(rContent)))); + return aRetval; } Primitive2DContainer createEmbeddedGlowPrimitive( - const Primitive2DContainer& rContent, + Primitive2DContainer&& rContent, const attribute::SdrGlowAttribute& rGlow) { if(rContent.empty()) - return rContent; + return std::move(rContent); Primitive2DContainer aRetval(2); aRetval[0] = Primitive2DReference( new GlowPrimitive2D(rGlow.getColor(), rGlow.getRadius(), Primitive2DContainer(rContent))); diff --git a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx index fc0fd748ddee..809aec8569d8 100644 --- a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx @@ -101,7 +101,7 @@ namespace drawinglayer::primitive2d if(!getSdrLFSTAttribute().getShadow().isDefault()) { aRetval = createEmbeddedShadowPrimitive( - aRetval, + std::move(aRetval), getSdrLFSTAttribute().getShadow()); } @@ -215,7 +215,7 @@ namespace drawinglayer::primitive2d if(!getSdrLFSTAttribute().getShadow().isDefault()) { aRetval = createEmbeddedShadowPrimitive( - aRetval, + std::move(aRetval), getSdrLFSTAttribute().getShadow()); } diff --git a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx index e996dd977f69..1fc860920638 100644 --- a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx @@ -110,14 +110,14 @@ void SdrGrafPrimitive2D::create2DDecomposition( if (!aRetval.empty() && !getSdrLFSTAttribute().getGlow().isDefault()) { // glow - aRetval = createEmbeddedGlowPrimitive(aRetval, getSdrLFSTAttribute().getGlow()); + aRetval = createEmbeddedGlowPrimitive(std::move(aRetval), getSdrLFSTAttribute().getGlow()); } // add shadow if (!getSdrLFSTAttribute().getShadow().isDefault()) { - aRetval = createEmbeddedShadowPrimitive(aRetval, getSdrLFSTAttribute().getShadow(), - getTransform()); + aRetval = createEmbeddedShadowPrimitive(std::move(aRetval), + getSdrLFSTAttribute().getShadow(), getTransform()); } rContainer.insert(rContainer.end(), aRetval.begin(), aRetval.end()); diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx index f8b77693795a..aba7bf008fd6 100644 --- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx @@ -425,7 +425,7 @@ namespace drawinglayer::primitive2d if(!getSdrLSTAttribute().getShadow().isDefault()) { aRetval = createEmbeddedShadowPrimitive( - aRetval, + std::move(aRetval), getSdrLSTAttribute().getShadow()); } diff --git a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx index ee3178fcf8b5..670cbacbe898 100644 --- a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx @@ -32,10 +32,10 @@ using namespace com::sun::star; namespace drawinglayer::primitive2d { SdrOle2Primitive2D::SdrOle2Primitive2D( - const Primitive2DContainer& rOLEContent, + Primitive2DContainer&& rOLEContent, const basegfx::B2DHomMatrix& rTransform, const attribute::SdrLineFillEffectsTextAttribute& rSdrLFSTAttribute) - : maOLEContent(rOLEContent), + : maOLEContent(std::move(rOLEContent)), maTransform(rTransform), maSdrLFSTAttribute(rSdrLFSTAttribute) { @@ -158,7 +158,7 @@ namespace drawinglayer::primitive2d if(!getSdrLFSTAttribute().getShadow().isDefault()) { aRetval = createEmbeddedShadowPrimitive( - aRetval, + std::move(aRetval), getSdrLFSTAttribute().getShadow()); } diff --git a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx index 9fe99f8ff79a..5df6d9c09e5d 100644 --- a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx @@ -111,7 +111,7 @@ namespace drawinglayer::primitive2d if(!getSdrLFSTAttribute().getShadow().isDefault()) { aRetval = createEmbeddedShadowPrimitive( - aRetval, + std::move(aRetval), getSdrLFSTAttribute().getShadow()); } diff --git a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx index c8862f51dee4..a51e231beabb 100644 --- a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx @@ -104,7 +104,7 @@ namespace drawinglayer::primitive2d if(!getSdrLFSTAttribute().getShadow().isDefault()) { aRetval = createEmbeddedShadowPrimitive( - aRetval, + std::move(aRetval), getSdrLFSTAttribute().getShadow()); } diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx index 9d6dc71b7d4f..2aa9ad42a613 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -144,7 +144,7 @@ void ImpSdrCreateViewExtraData::CreateAndShowOverlay(const SdrCreateView& rView, { const sdr::contact::ViewContact& rVC = pObject->GetViewContact(); const drawinglayer::primitive2d::Primitive2DContainer& aSequence = rVC.getViewIndependentPrimitive2DContainer(); - std::unique_ptr pNew(new sdr::overlay::OverlayPrimitive2DSequenceObject(aSequence)); + std::unique_ptr pNew(new sdr::overlay::OverlayPrimitive2DSequenceObject(drawinglayer::primitive2d::Primitive2DContainer(aSequence))); xOverlayManager->add(*pNew); maObjects.append(std::move(pNew)); diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 5917d1475c44..ef744f881906 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -178,8 +178,8 @@ drawinglayer::primitive2d::Primitive2DContainer SdrDragEntrySdrObject::createPri SdrDragEntryPrimitive2DSequence::SdrDragEntryPrimitive2DSequence( - const drawinglayer::primitive2d::Primitive2DContainer& rSequence) -: maPrimitive2DSequence(rSequence) + drawinglayer::primitive2d::Primitive2DContainer&& rSequence) +: maPrimitive2DSequence(std::move(rSequence)) { // add parts to transparent overlay stuff if necessary setAddToTransparent(true); @@ -778,7 +778,7 @@ void SdrDragMethod::CreateOverlayGeometry( { std::unique_ptr pNewOverlayObject( new sdr::overlay::OverlayPrimitive2DSequenceObject( - aResult)); + std::move(aResult))); insertNewlyCreatedOverlayObjectForSdrDragMethod( std::move(pNewOverlayObject), @@ -793,7 +793,7 @@ void SdrDragMethod::CreateOverlayGeometry( std::unique_ptr pNewOverlayObject( new sdr::overlay::OverlayPrimitive2DSequenceObject( - aResultTransparent)); + std::move(aResultTransparent))); insertNewlyCreatedOverlayObjectForSdrDragMethod( std::move(pNewOverlayObject), diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index ed0331c24a38..c509a069f715 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -2656,7 +2656,7 @@ void SdrCropViewHdl::CreateB2dIAObject() const rtl::Reference< sdr::overlay::OverlayManager >& xManager = rPageWindow.GetOverlayManager(); if(xManager.is()) { - std::unique_ptr pNew(new sdr::overlay::OverlayPrimitive2DSequenceObject(aSequence)); + std::unique_ptr pNew(new sdr::overlay::OverlayPrimitive2DSequenceObject(drawinglayer::primitive2d::Primitive2DContainer(aSequence))); // only informative object, no hit pNew->setHittable(false); diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx index 39762d727089..88b2071b2363 100644 --- a/svx/source/table/viewcontactoftableobj.cxx +++ b/svx/source/table/viewcontactoftableobj.cxx @@ -416,13 +416,13 @@ namespace sdr::contact // with PowerPoint. basegfx::B2DHomMatrix aMatrix; aRetval = drawinglayer::primitive2d::createEmbeddedShadowPrimitive( - aRetval, aNewShadowAttribute, aMatrix, &aRetvalForShadow); + std::move(aRetval), aNewShadowAttribute, aMatrix, &aRetvalForShadow); } else { // Shadow as style: shadow for text, to be backwards-compatible. aRetval = drawinglayer::primitive2d::createEmbeddedShadowPrimitive( - aRetval, aNewShadowAttribute); + std::move(aRetval), aNewShadowAttribute); } } } 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)); } } -- cgit