diff options
Diffstat (limited to 'svx')
27 files changed, 90 insertions, 94 deletions
diff --git a/svx/inc/sdr/primitive2d/sdrdecompositiontools.hxx b/svx/inc/sdr/primitive2d/sdrdecompositiontools.hxx index db1c94c1b7fa..01888e60d141 100644 --- a/svx/inc/sdr/primitive2d/sdrdecompositiontools.hxx +++ b/svx/inc/sdr/primitive2d/sdrdecompositiontools.hxx @@ -79,7 +79,7 @@ namespace drawinglayer::primitive2d const attribute::SdrGlowAttribute& rGlow); Primitive2DContainer SVXCORE_DLLPUBLIC createEmbeddedSoftEdgePrimitive( - const Primitive2DContainer& rContent, + Primitive2DContainer&& aContent, sal_Int32 nRadius); } // end of namespace drawinglayer::primitive2d diff --git a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx index 96402f54b6df..ab1483be7967 100644 --- a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx +++ b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx @@ -75,7 +75,7 @@ namespace drawinglayer::primitive2d protected: // support for XTEXT_PAINTSHAPE_BEGIN/XTEXT_PAINTSHAPE_END Metafile comments - static void encapsulateWithTextHierarchyBlockPrimitive2D(Primitive2DContainer& rContainer, const Primitive2DContainer& rCandidate); + static void encapsulateWithTextHierarchyBlockPrimitive2D(Primitive2DContainer& rContainer, Primitive2DContainer&& aCandidate); public: SdrTextPrimitive2D( diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index 195f09c9a3b5..33f1162cb3f9 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -166,13 +166,13 @@ void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirr if(!aMatrixTransform.isIdentity()) { // embed in transformation group - drawinglayer::primitive2d::Primitive2DReference aTransformPrimitive2D(new drawinglayer::primitive2d::TransformPrimitive2D(aMatrixTransform, aContent)); + drawinglayer::primitive2d::Primitive2DReference aTransformPrimitive2D(new drawinglayer::primitive2d::TransformPrimitive2D(aMatrixTransform, std::move(aContent))); aContent = drawinglayer::primitive2d::Primitive2DContainer { aTransformPrimitive2D }; } // if we have full overlay from selected objects, embed with 50% transparence, the // transformation is added to the OverlayPrimitive2DSequenceObject - drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparencePrimitive2D(new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(aContent, 0.5)); + drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparencePrimitive2D(new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(std::move(aContent), 0.5)); aContent = drawinglayer::primitive2d::Primitive2DContainer { aUnifiedTransparencePrimitive2D }; std::unique_ptr<sdr::overlay::OverlayPrimitive2DSequenceObject> pNew(new sdr::overlay::OverlayPrimitive2DSequenceObject(aContent)); diff --git a/svx/source/sdr/contact/viewcontactofsdrobj.cxx b/svx/source/sdr/contact/viewcontactofsdrobj.cxx index 5009be19f8ba..16a907cb581d 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobj.cxx @@ -172,7 +172,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfSdrObj::embedToObje { const drawinglayer::primitive2d::Primitive2DReference xRef( new drawinglayer::primitive2d::ObjectInfoPrimitive2D( - aSource, + std::move(aSource), GetSdrObject().GetName(), GetSdrObject().GetTitle(), GetSdrObject().GetDescription())); diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx index 0c53ef5a4499..610c483cbec8 100644 --- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx @@ -91,7 +91,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfSdrOle2Obj::createP { // try to get chart primitives and chart range directly from xChartModel basegfx::B2DRange aChartContentRange; - const drawinglayer::primitive2d::Primitive2DContainer aChartSequence( + drawinglayer::primitive2d::Primitive2DContainer aChartSequence( ChartHelper::tryToGetChartContentAsPrimitive2DSequence( GetOle2Obj().getXModel(), aChartContentRange)); @@ -112,7 +112,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfSdrOle2Obj::createP aEmbed = aObjectMatrix * aEmbed; xContent = new drawinglayer::primitive2d::TransformPrimitive2D( aEmbed, - aChartSequence); + std::move(aChartSequence)); } } diff --git a/svx/source/sdr/contact/viewcontactofvirtobj.cxx b/svx/source/sdr/contact/viewcontactofvirtobj.cxx index b2f92bd28be8..dcf10bd1daed 100644 --- a/svx/source/sdr/contact/viewcontactofvirtobj.cxx +++ b/svx/source/sdr/contact/viewcontactofvirtobj.cxx @@ -76,10 +76,10 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfVirtObj::createView if(!xSequenceVirtual.empty()) { // create transform primitive - const drawinglayer::primitive2d::Primitive2DReference xReference( + drawinglayer::primitive2d::Primitive2DReference xReference( new drawinglayer::primitive2d::TransformPrimitive2D( aObjectMatrix, - xSequenceVirtual)); + drawinglayer::primitive2d::Primitive2DContainer(xSequenceVirtual))); return drawinglayer::primitive2d::Primitive2DContainer { xReference }; } diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx index fc43823e0e4a..00674a200bf1 100644 --- a/svx/source/sdr/contact/viewobjectcontact.cxx +++ b/svx/source/sdr/contact/viewobjectcontact.cxx @@ -314,9 +314,9 @@ drawinglayer::primitive2d::Primitive2DContainer ViewObjectContact::createPrimiti std::make_shared<basegfx::BColorModifier_interpolate>( aRGBWhite, 0.5); - const drawinglayer::primitive2d::Primitive2DReference xReference( + drawinglayer::primitive2d::Primitive2DReference xReference( new drawinglayer::primitive2d::ModifiedColorPrimitive2D( - xRetval, + std::move(xRetval), aBColorModifier)); xRetval = drawinglayer::primitive2d::Primitive2DContainer { xReference }; @@ -369,7 +369,7 @@ drawinglayer::primitive2d::Primitive2DContainer const & ViewObjectContact::getPr const drawinglayer::primitive2d::Primitive2DReference aEmbed( new drawinglayer::primitive2d::TransformPrimitive2D( aTranslateGridOffset, - mxPrimitive2DSequence)); + drawinglayer::primitive2d::Primitive2DContainer(mxPrimitive2DSequence))); // Set values at local data. So for now, the mechanism is to reset some of the // defining things (mxPrimitive2DSequence, maGridOffset) and re-create the diff --git a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx index 37070281b5cf..52dd5c30fdab 100644 --- a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx @@ -105,7 +105,7 @@ namespace sdr::contact 0.5); const drawinglayer::primitive2d::Primitive2DReference xReference( new drawinglayer::primitive2d::ModifiedColorPrimitive2D( - xRetval, + std::move(xRetval), aBColorModifier)); xRetval = drawinglayer::primitive2d::Primitive2DContainer { xReference }; diff --git a/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx index b938322cbff9..54076af665b6 100644 --- a/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx @@ -108,7 +108,7 @@ namespace sdr::contact { // get range of MasterPage sub hierarchy const drawinglayer::geometry::ViewInformation2D& rViewInformation2D(GetObjectContact().getViewInformation2D()); - const basegfx::B2DRange aSubHierarchyRange(xMasterPageSequence.getB2DRange(rViewInformation2D)); + basegfx::B2DRange aSubHierarchyRange(xMasterPageSequence.getB2DRange(rViewInformation2D)); if (rPageFillRange.isInside(aSubHierarchyRange)) { @@ -123,7 +123,7 @@ namespace sdr::contact // need to create a clip primitive, add clipped list to target const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::MaskPrimitive2D( - basegfx::B2DPolyPolygon(basegfx::utils::createPolygonFromRect(aCommonArea)), xMasterPageSequence)); + basegfx::B2DPolyPolygon(basegfx::utils::createPolygonFromRect(aCommonArea)), std::move(xMasterPageSequence))); xRetval.push_back(xReference); } } diff --git a/svx/source/sdr/overlay/overlaybitmapex.cxx b/svx/source/sdr/overlay/overlaybitmapex.cxx index 75433989ade7..54ccf788b2e3 100644 --- a/svx/source/sdr/overlay/overlaybitmapex.cxx +++ b/svx/source/sdr/overlay/overlaybitmapex.cxx @@ -37,9 +37,9 @@ namespace sdr::overlay if(basegfx::fTools::more(mfAlpha, 0.0)) { - const drawinglayer::primitive2d::Primitive2DContainer aNewTransPrimitiveVector { aReference }; + drawinglayer::primitive2d::Primitive2DContainer aNewTransPrimitiveVector { aReference }; aReference = drawinglayer::primitive2d::Primitive2DReference( - new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(aNewTransPrimitiveVector, mfAlpha)); + new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(std::move(aNewTransPrimitiveVector), mfAlpha)); } return drawinglayer::primitive2d::Primitive2DContainer { aReference }; diff --git a/svx/source/sdr/overlay/overlayobject.cxx b/svx/source/sdr/overlay/overlayobject.cxx index 02211a192c16..841e241895af 100644 --- a/svx/source/sdr/overlay/overlayobject.cxx +++ b/svx/source/sdr/overlay/overlayobject.cxx @@ -111,10 +111,10 @@ namespace sdr::overlay const basegfx::B2DHomMatrix aTranslateGridOffset( basegfx::utils::createTranslateB2DHomMatrix( getOffset())); - const drawinglayer::primitive2d::Primitive2DReference aEmbed( + drawinglayer::primitive2d::Primitive2DReference aEmbed( new drawinglayer::primitive2d::TransformPrimitive2D( aTranslateGridOffset, - maPrimitive2DSequence)); + std::move(const_cast<drawinglayer::primitive2d::Primitive2DContainer&>(maPrimitive2DSequence)))); const_cast< OverlayObject* >(this)->maPrimitive2DSequence = drawinglayer::primitive2d::Primitive2DContainer { aEmbed }; } diff --git a/svx/source/sdr/overlay/overlayobjectcell.cxx b/svx/source/sdr/overlay/overlayobjectcell.cxx index 68ab8281e334..7ebc257e3fec 100644 --- a/svx/source/sdr/overlay/overlayobjectcell.cxx +++ b/svx/source/sdr/overlay/overlayobjectcell.cxx @@ -65,9 +65,9 @@ namespace sdr::overlay // embed in 50% transparent paint - const drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparence( + drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparence( new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D( - aRetval, + std::move(aRetval), 0.5)); aRetval = drawinglayer::primitive2d::Primitive2DContainer { aUnifiedTransparence }; diff --git a/svx/source/sdr/overlay/overlaypolypolygon.cxx b/svx/source/sdr/overlay/overlaypolypolygon.cxx index 9b6abd8beb8a..69dacf375c2a 100644 --- a/svx/source/sdr/overlay/overlaypolypolygon.cxx +++ b/svx/source/sdr/overlay/overlaypolypolygon.cxx @@ -62,8 +62,8 @@ namespace sdr::overlay sal_uInt8 nTransparency = 255 - getBaseColor().GetAlpha(); if (nTransparency > 0) { - const drawinglayer::primitive2d::Primitive2DReference aTransparencePrimitive( - new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(aReturnContainer, nTransparency / 255.0)); + drawinglayer::primitive2d::Primitive2DReference aTransparencePrimitive( + new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(std::move(aReturnContainer), nTransparency / 255.0)); aReturnContainer = drawinglayer::primitive2d::Primitive2DContainer{ aTransparencePrimitive }; } } diff --git a/svx/source/sdr/overlay/overlayselection.cxx b/svx/source/sdr/overlay/overlayselection.cxx index 8a3968def14c..9896a49ec4e8 100644 --- a/svx/source/sdr/overlay/overlayselection.cxx +++ b/svx/source/sdr/overlay/overlayselection.cxx @@ -118,9 +118,9 @@ namespace sdr::overlay if(bInvert) { // embed all in invert primitive - const drawinglayer::primitive2d::Primitive2DReference aInvert( + drawinglayer::primitive2d::Primitive2DReference aInvert( new drawinglayer::primitive2d::InvertPrimitive2D( - aRetval)); + std::move(aRetval))); aRetval = drawinglayer::primitive2d::Primitive2DContainer { aInvert }; } else if(OverlayType::Transparent == maLastOverlayType) @@ -129,7 +129,7 @@ namespace sdr::overlay const double fTransparence(mnLastTransparence / 100.0); const drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparence( new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D( - aRetval, + std::move(aRetval), fTransparence)); if(mbBorder) @@ -141,9 +141,7 @@ namespace sdr::overlay aRGBColor)); // add both to result - aRetval.resize(2); - aRetval[0] = aUnifiedTransparence; - aRetval[1] = aSelectionOutline; + aRetval = drawinglayer::primitive2d::Primitive2DContainer { aUnifiedTransparence, aSelectionOutline }; } else { diff --git a/svx/source/sdr/overlay/overlaytools.cxx b/svx/source/sdr/overlay/overlaytools.cxx index bb2ac72c3cee..b02775e9a2be 100644 --- a/svx/source/sdr/overlay/overlaytools.cxx +++ b/svx/source/sdr/overlay/overlaytools.cxx @@ -92,7 +92,7 @@ void OverlayStaticRectanglePrimitive::create2DDecomposition(Primitive2DContainer { const Primitive2DReference aFillTransparent( new UnifiedTransparencePrimitive2D( - aPrimitive2DSequence, + std::move(aPrimitive2DSequence), mfTransparence)); aPrimitive2DSequence = Primitive2DContainer { aFillTransparent }; @@ -367,9 +367,9 @@ sal_uInt32 OverlayStaticRectanglePrimitive::getPrimitive2DID() const // embed filled to transparency (if used) if(getTransparence() > 0.0) { - const Primitive2DReference aFillTransparent( + Primitive2DReference aFillTransparent( new UnifiedTransparencePrimitive2D( - aRetval, + std::move(aRetval), getTransparence())); aRetval = Primitive2DContainer { aFillTransparent }; diff --git a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx index 058457f9e72a..50a2061ef9e9 100644 --- a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx @@ -38,7 +38,7 @@ namespace drawinglayer::primitive2d // Soft edges should be before text, since text is not affected by soft edges if (!aRetval.empty() && getSdrSTAttribute().getSoftEdgeRadius()) { - aRetval = createEmbeddedSoftEdgePrimitive(aRetval, + aRetval = createEmbeddedSoftEdgePrimitive(std::move(aRetval), getSdrSTAttribute().getSoftEdgeRadius()); } diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx index e75ad0a3c6a5..bce84bf1eddc 100644 --- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx +++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx @@ -187,26 +187,26 @@ basegfx::B2DRange getTextAnchorRange(const attribute::SdrTextAttribute& rText, if(0.0 != rFill.getTransparence()) { // create simpleTransparencePrimitive, add created fill primitive - const Primitive2DContainer aContent { pNewFillPrimitive }; - return Primitive2DReference(new UnifiedTransparencePrimitive2D(aContent, rFill.getTransparence())); + Primitive2DContainer aContent { pNewFillPrimitive }; + return Primitive2DReference(new UnifiedTransparencePrimitive2D(std::move(aContent), rFill.getTransparence())); } else if(!rFillGradient.isDefault()) { // create sequence with created fill primitive - const Primitive2DContainer aContent { pNewFillPrimitive }; + Primitive2DContainer aContent { pNewFillPrimitive }; // create FillGradientPrimitive2D for transparence and add to new sequence // fillGradientPrimitive is enough here (compared to PolyPolygonGradientPrimitive2D) since float transparence will be masked anyways const basegfx::B2DRange aRange(basegfx::utils::getRange(rPolyPolygon)); - const Primitive2DReference xRefB( + Primitive2DReference xRefB( new FillGradientPrimitive2D( aRange, rDefinitionRange, rFillGradient)); - const Primitive2DContainer aAlpha { xRefB }; + Primitive2DContainer aAlpha { xRefB }; // create TransparencePrimitive2D using alpha and content - return Primitive2DReference(new TransparencePrimitive2D(aContent, aAlpha)); + return Primitive2DReference(new TransparencePrimitive2D(std::move(aContent), std::move(aAlpha))); } else { @@ -242,8 +242,8 @@ basegfx::B2DRange getTextAnchorRange(const attribute::SdrTextAttribute& rText, if(0.0 != rLine.getTransparence()) { // create simpleTransparencePrimitive, add created fill primitive - const Primitive2DContainer aContent { pNewLinePrimitive }; - return Primitive2DReference(new UnifiedTransparencePrimitive2D(aContent, rLine.getTransparence())); + Primitive2DContainer aContent { pNewLinePrimitive }; + return Primitive2DReference(new UnifiedTransparencePrimitive2D(std::move(aContent), rLine.getTransparence())); } else { @@ -406,11 +406,11 @@ basegfx::B2DRange getTextAnchorRange(const attribute::SdrTextAttribute& rText, if(0.0 != aAnimationList.getDuration()) { // create content sequence - const Primitive2DReference xRefA(pNew); - const Primitive2DContainer aContent { xRefA }; + Primitive2DReference xRefA(pNew); + Primitive2DContainer aContent { xRefA }; // create and add animated switch primitive - return Primitive2DReference(new AnimatedBlinkPrimitive2D(aAnimationList, aContent)); + return Primitive2DReference(new AnimatedBlinkPrimitive2D(aAnimationList, std::move(aContent))); } else { @@ -501,14 +501,14 @@ basegfx::B2DRange getTextAnchorRange(const attribute::SdrTextAttribute& rText, std::vector< basegfx::B2DHomMatrix > aMatrixStack; aMatrixStack.push_back(aLeft); aMatrixStack.push_back(aRight); - const Primitive2DReference xRefA(new AnimatedInterpolatePrimitive2D(aMatrixStack, aAnimationList, aAnimSequence)); - const Primitive2DContainer aContent { xRefA }; + Primitive2DReference xRefA(new AnimatedInterpolatePrimitive2D(aMatrixStack, aAnimationList, std::move(aAnimSequence))); + Primitive2DContainer aContent { xRefA }; // scrolling needs an encapsulating clipping primitive const basegfx::B2DRange aClipRange(aClipTopLeft, aClipBottomRight); basegfx::B2DPolygon aClipPolygon(basegfx::utils::createPolygonFromRect(aClipRange)); aClipPolygon.transform(aSRT); - return Primitive2DReference(new MaskPrimitive2D(basegfx::B2DPolyPolygon(aClipPolygon), aContent)); + return Primitive2DReference(new MaskPrimitive2D(basegfx::B2DPolyPolygon(aClipPolygon), std::move(aContent))); } else { @@ -523,11 +523,11 @@ basegfx::B2DRange getTextAnchorRange(const attribute::SdrTextAttribute& rText, // #i97628# // encapsulate with TextHierarchyEditPrimitive2D to allow renderers // to suppress actively edited content if needed - const Primitive2DReference xRefA(pNew); - const Primitive2DContainer aContent { xRefA }; + Primitive2DReference xRefA(pNew); + Primitive2DContainer aContent { xRefA }; // create and add TextHierarchyEditPrimitive2D primitive - return Primitive2DReference(new TextHierarchyEditPrimitive2D(aContent)); + return Primitive2DReference(new TextHierarchyEditPrimitive2D(std::move(aContent))); } else { @@ -580,20 +580,20 @@ basegfx::B2DRange getTextAnchorRange(const attribute::SdrTextAttribute& rText, aShadowOffset, rShadow.getColor(), rShadow.getBlur(), - (pContentForShadow ? *pContentForShadow : rContent))); + Primitive2DContainer(pContentForShadow ? *pContentForShadow : rContent))); if(0.0 != rShadow.getTransparence()) { // create SimpleTransparencePrimitive2D - const Primitive2DContainer aTempContent { aRetval[0] }; + Primitive2DContainer aTempContent { aRetval[0] }; aRetval[0] = Primitive2DReference( new UnifiedTransparencePrimitive2D( - aTempContent, + std::move(aTempContent), rShadow.getTransparence())); } - aRetval[1] = Primitive2DReference(new GroupPrimitive2D(rContent)); + aRetval[1] = Primitive2DReference(new GroupPrimitive2D(Primitive2DContainer(rContent))); return aRetval; } else @@ -610,18 +610,18 @@ basegfx::B2DRange getTextAnchorRange(const attribute::SdrTextAttribute& rText, return rContent; Primitive2DContainer aRetval(2); aRetval[0] = Primitive2DReference( - new GlowPrimitive2D(rGlow.getColor(), rGlow.getRadius(), rContent)); - aRetval[1] = Primitive2DReference(new GroupPrimitive2D(rContent)); + new GlowPrimitive2D(rGlow.getColor(), rGlow.getRadius(), Primitive2DContainer(rContent))); + aRetval[1] = Primitive2DReference(new GroupPrimitive2D(Primitive2DContainer(rContent))); return aRetval; } - Primitive2DContainer createEmbeddedSoftEdgePrimitive(const Primitive2DContainer& rContent, + Primitive2DContainer createEmbeddedSoftEdgePrimitive(Primitive2DContainer&& aContent, sal_Int32 nRadius) { - if (rContent.empty() || !nRadius) - return rContent; + if (aContent.empty() || !nRadius) + return std::move(aContent); Primitive2DContainer aRetval(1); - aRetval[0] = Primitive2DReference(new SoftEdgePrimitive2D(nRadius, rContent)); + aRetval[0] = Primitive2DReference(new SoftEdgePrimitive2D(nRadius, std::move(aContent))); return aRetval; } diff --git a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx index 5d6100e9dce9..e996dd977f69 100644 --- a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx @@ -94,8 +94,8 @@ void SdrGrafPrimitive2D::create2DDecomposition( // Soft edges should be before text, since text is not affected by soft edges if (!aRetval.empty() && getSdrLFSTAttribute().getSoftEdgeRadius()) { - aRetval - = createEmbeddedSoftEdgePrimitive(aRetval, getSdrLFSTAttribute().getSoftEdgeRadius()); + aRetval = createEmbeddedSoftEdgePrimitive(std::move(aRetval), + getSdrLFSTAttribute().getSoftEdgeRadius()); } // add text diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx index 6ee45194ff00..f8b77693795a 100644 --- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx @@ -390,7 +390,7 @@ namespace drawinglayer::primitive2d if(getSdrLSTAttribute().getLine().isDefault()) { // embed line geometry to invisible (100% transparent) line group for HitTest - const Primitive2DReference xHiddenLines(new HiddenGeometryPrimitive2D(aRetval)); + Primitive2DReference xHiddenLines(new HiddenGeometryPrimitive2D(std::move(aRetval))); aRetval = Primitive2DContainer { xHiddenLines }; } diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx index 5bc06f832abe..0ff3a7a4aebd 100644 --- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx @@ -87,9 +87,9 @@ namespace drawinglayer::primitive2d // support for XTEXT_PAINTSHAPE_BEGIN/XTEXT_PAINTSHAPE_END Metafile comments // for slideshow. This uses TextHierarchyBlockPrimitive2D to mark a text block. // ATM there is only one text block per SdrObject, this may get more in the future - void SdrTextPrimitive2D::encapsulateWithTextHierarchyBlockPrimitive2D(Primitive2DContainer& rContainer, const Primitive2DContainer& rCandidate) + void SdrTextPrimitive2D::encapsulateWithTextHierarchyBlockPrimitive2D(Primitive2DContainer& rContainer, Primitive2DContainer&& aCandidate) { - rContainer.push_back(new TextHierarchyBlockPrimitive2D(rCandidate)); + rContainer.push_back(new TextHierarchyBlockPrimitive2D(drawinglayer::primitive2d::Primitive2DContainer(aCandidate))); } SdrTextPrimitive2D::SdrTextPrimitive2D( @@ -241,7 +241,7 @@ namespace drawinglayer::primitive2d Primitive2DContainer aRetval; getSdrText()->GetObject().impDecomposeContourTextPrimitive(aRetval, *this, aViewInformation); - encapsulateWithTextHierarchyBlockPrimitive2D(rContainer, aRetval); + encapsulateWithTextHierarchyBlockPrimitive2D(rContainer, std::move(aRetval)); } SdrContourTextPrimitive2D::SdrContourTextPrimitive2D( @@ -290,7 +290,7 @@ namespace drawinglayer::primitive2d Primitive2DContainer aRetval; getSdrText()->GetObject().impDecomposePathTextPrimitive(aRetval, *this, aViewInformation); - encapsulateWithTextHierarchyBlockPrimitive2D(rContainer, aRetval); + encapsulateWithTextHierarchyBlockPrimitive2D(rContainer, std::move(aRetval)); } SdrPathTextPrimitive2D::SdrPathTextPrimitive2D( @@ -342,7 +342,7 @@ namespace drawinglayer::primitive2d Primitive2DContainer aRetval; getSdrText()->GetObject().impDecomposeBlockTextPrimitive(aRetval, *this, aViewInformation); - encapsulateWithTextHierarchyBlockPrimitive2D(rContainer, aRetval); + encapsulateWithTextHierarchyBlockPrimitive2D(rContainer, std::move(aRetval)); } SdrBlockTextPrimitive2D::SdrBlockTextPrimitive2D( @@ -411,7 +411,7 @@ namespace drawinglayer::primitive2d Primitive2DContainer aRetval; getSdrText()->GetObject().impDecomposeAutoFitTextPrimitive(aRetval, *this, aViewInformation); - encapsulateWithTextHierarchyBlockPrimitive2D(rContainer, aRetval); + encapsulateWithTextHierarchyBlockPrimitive2D(rContainer, std::move(aRetval)); } SdrAutoFitTextPrimitive2D::SdrAutoFitTextPrimitive2D( @@ -465,7 +465,7 @@ namespace drawinglayer::primitive2d Primitive2DContainer aRetval; getSdrText()->GetObject().impDecomposeChainedTextPrimitive(aRetval, *this, aViewInformation); - encapsulateWithTextHierarchyBlockPrimitive2D(rContainer, aRetval); + encapsulateWithTextHierarchyBlockPrimitive2D(rContainer, std::move(aRetval)); } bool SdrChainedTextPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const @@ -497,7 +497,7 @@ namespace drawinglayer::primitive2d Primitive2DContainer aRetval; getSdrText()->GetObject().impDecomposeStretchTextPrimitive(aRetval, *this, aViewInformation); - encapsulateWithTextHierarchyBlockPrimitive2D(rContainer, aRetval); + encapsulateWithTextHierarchyBlockPrimitive2D(rContainer, std::move(aRetval)); } SdrStretchTextPrimitive2D::SdrStretchTextPrimitive2D( diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 92958e1b7750..17376206f8a7 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -194,7 +194,7 @@ drawinglayer::primitive2d::Primitive2DContainer SdrDragEntryPrimitive2DSequence: drawinglayer::primitive2d::Primitive2DReference aTransformPrimitive2D( new drawinglayer::primitive2d::TransformPrimitive2D( rDragMethod.getCurrentTransformation(), - maPrimitive2DSequence)); + drawinglayer::primitive2d::Primitive2DContainer(maPrimitive2DSequence))); return drawinglayer::primitive2d::Primitive2DContainer { aTransformPrimitive2D }; } @@ -788,7 +788,7 @@ void SdrDragMethod::CreateOverlayGeometry( if(!aResultTransparent.empty()) { - drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparencePrimitive2D(new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(aResultTransparent, 0.5)); + drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparencePrimitive2D(new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(std::move(aResultTransparent), 0.5)); aResultTransparent = drawinglayer::primitive2d::Primitive2DContainer { aUnifiedTransparencePrimitive2D }; std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject( diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index 249557f35e26..85d46f99a00e 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -2636,7 +2636,7 @@ void SdrCropViewHdl::CreateB2dIAObject() const drawinglayer::primitive2d::Primitive2DReference aMaskedGraphic( new drawinglayer::primitive2d::MaskPrimitive2D( aCropPolyPolygon, - aCombination)); + std::move(aCombination))); // embed to UnifiedTransparencePrimitive2D const drawinglayer::primitive2d::Primitive2DReference aTransparenceMaskedGraphic( diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 962636ac6a8d..a27db44eca73 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -362,9 +362,9 @@ namespace if(rInfo.mbEndOfBullet) { // embed in TextHierarchyBulletPrimitive2D - const drawinglayer::primitive2d::Primitive2DReference aNewReference(pNewPrimitive); - const drawinglayer::primitive2d::Primitive2DContainer aNewSequence { aNewReference } ; - pNewPrimitive = new drawinglayer::primitive2d::TextHierarchyBulletPrimitive2D(aNewSequence); + drawinglayer::primitive2d::Primitive2DReference aNewReference(pNewPrimitive); + drawinglayer::primitive2d::Primitive2DContainer aNewSequence { aNewReference } ; + pNewPrimitive = new drawinglayer::primitive2d::TextHierarchyBulletPrimitive2D(std::move(aNewSequence)); } if(rInfo.mpFieldData) @@ -465,15 +465,15 @@ namespace meValues.emplace_back("Representation", pURLField->GetRepresentation()); meValues.emplace_back("TargetFrame", pURLField->GetTargetFrame()); meValues.emplace_back("SvxURLFormat", OUString::number(static_cast<sal_uInt16>(pURLField->GetFormat()))); - xRet = new drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D(aSequence, drawinglayer::primitive2d::FIELD_TYPE_URL, &meValues); + xRet = new drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D(std::move(aSequence), drawinglayer::primitive2d::FIELD_TYPE_URL, &meValues); } else if(pPageField) { - xRet = new drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D(aSequence, drawinglayer::primitive2d::FIELD_TYPE_PAGE); + xRet = new drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D(std::move(aSequence), drawinglayer::primitive2d::FIELD_TYPE_PAGE); } else { - xRet = new drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D(aSequence, drawinglayer::primitive2d::FIELD_TYPE_COMMON); + xRet = new drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D(std::move(aSequence), drawinglayer::primitive2d::FIELD_TYPE_COMMON); } } @@ -486,8 +486,7 @@ namespace // empty line primitives (contrary to paragraphs, see below). if(!maTextPortionPrimitives.empty()) { - maLinePrimitives.push_back(new drawinglayer::primitive2d::TextHierarchyLinePrimitive2D(maTextPortionPrimitives)); - maTextPortionPrimitives.clear(); + maLinePrimitives.push_back(new drawinglayer::primitive2d::TextHierarchyLinePrimitive2D(std::move(maTextPortionPrimitives))); } } @@ -504,9 +503,8 @@ namespace // have an empty sub-PrimitiveSequence. maParagraphPrimitives.push_back( new drawinglayer::primitive2d::TextHierarchyParagraphPrimitive2D( - maLinePrimitives, + std::move(maLinePrimitives), nOutlineLevel)); - maLinePrimitives.clear(); } void impTextBreakupHandler::impHandleDrawPortionInfo(const DrawPortionInfo& rInfo) @@ -550,8 +548,8 @@ namespace aGraphicAttr)); // embed in TextHierarchyBulletPrimitive2D - const drawinglayer::primitive2d::Primitive2DContainer aNewSequence { aNewReference }; - rtl::Reference<drawinglayer::primitive2d::BasePrimitive2D> pNewPrimitive = new drawinglayer::primitive2d::TextHierarchyBulletPrimitive2D(aNewSequence); + drawinglayer::primitive2d::Primitive2DContainer aNewSequence { aNewReference }; + rtl::Reference<drawinglayer::primitive2d::BasePrimitive2D> pNewPrimitive = new drawinglayer::primitive2d::TextHierarchyBulletPrimitive2D(std::move(aNewSequence)); // add to output maTextPortionPrimitives.push_back(pNewPrimitive); diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx index 292ad9c2b7b4..66476eecbc75 100644 --- a/svx/source/svdraw/svdotextpathdecomposition.cxx +++ b/svx/source/svdraw/svdotextpathdecomposition.cxx @@ -610,7 +610,7 @@ namespace aNewPrimitives.push_back( new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D( - aStrokePrimitiveSequence, + std::move(aStrokePrimitiveSequence), static_cast<double>(rOutlineAttribute.getTransparence()) / 100.0) ); } else diff --git a/svx/source/table/tablehandles.cxx b/svx/source/table/tablehandles.cxx index cc57ccd030c5..0ce200f14ef5 100644 --- a/svx/source/table/tablehandles.cxx +++ b/svx/source/table/tablehandles.cxx @@ -230,9 +230,9 @@ drawinglayer::primitive2d::Primitive2DContainer OverlayTableEdge::createOverlayO { // embed in HiddenGeometryPrimitive2D to support HitTest of this invisible // overlay object - const drawinglayer::primitive2d::Primitive2DContainer aSequence { aReference }; + drawinglayer::primitive2d::Primitive2DContainer aSequence { aReference }; const drawinglayer::primitive2d::Primitive2DReference aNewReference( - new drawinglayer::primitive2d::HiddenGeometryPrimitive2D(aSequence)); + new drawinglayer::primitive2d::HiddenGeometryPrimitive2D(std::move(aSequence))); aRetval = drawinglayer::primitive2d::Primitive2DContainer { aNewReference }; } } diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx index 5911c00359d8..2d0c513d861c 100644 --- a/svx/source/table/viewcontactoftableobj.cxx +++ b/svx/source/table/viewcontactoftableobj.cxx @@ -340,7 +340,7 @@ namespace sdr::contact } // now create all CellBorderPrimitives - const drawinglayer::primitive2d::Primitive2DContainer aCellBorderPrimitives(aArray.CreateB2DPrimitiveArray()); + drawinglayer::primitive2d::Primitive2DContainer aCellBorderPrimitives(aArray.CreateB2DPrimitiveArray()); if(!aCellBorderPrimitives.empty()) { @@ -380,11 +380,11 @@ namespace sdr::contact aRetval.append( new drawinglayer::primitive2d::TransformPrimitive2D( aTransform, - aCellBorderPrimitives)); + drawinglayer::primitive2d::Primitive2DContainer(aCellBorderPrimitives))); // Borders are always the same for shadow as well. aRetvalForShadow.append(new drawinglayer::primitive2d::TransformPrimitive2D( - aTransform, aCellBorderPrimitives)); + aTransform, std::move(aCellBorderPrimitives))); } } diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 759f61d107ac..1fa0e7d109de 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -740,10 +740,10 @@ uno::Any SvxShape::GetBitmap( bool bMetaFile /* = false */ ) const MapMode(MapUnit::Map100thMM))); // Embed primitives to get them in 100th mm - const drawinglayer::primitive2d::Primitive2DReference xEmbedRef( + drawinglayer::primitive2d::Primitive2DReference xEmbedRef( new drawinglayer::primitive2d::TransformPrimitive2D( aMapTransform, - xPrimitives)); + std::move(xPrimitives))); xPrimitives = drawinglayer::primitive2d::Primitive2DContainer { xEmbedRef }; |