diff options
Diffstat (limited to 'svx/source/sdr')
15 files changed, 105 insertions, 110 deletions
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<BufferedDecompositionPrimitive2D*>(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<BufferedDecompositionPrimitive2D*>(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<BufferedDecompositionPrimitive2D*>(xChild.get()); + if (pChild) { - double fChildTransparence = 0.0; - auto pChild = dynamic_cast<BufferedDecompositionPrimitive2D*>(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()); } |