drawinglayer/source/primitive2d/animatedprimitive2d.cxx | 14 +-- drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx | 4 - drawinglayer/source/primitive2d/baseprimitive2d.cxx | 38 ++++++++-- drawinglayer/source/primitive2d/controlprimitive2d.cxx | 4 - drawinglayer/source/primitive2d/cropprimitive2d.cxx | 6 - drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx | 6 - drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx | 10 +- drawinglayer/source/primitive2d/gridprimitive2d.cxx | 4 - drawinglayer/source/primitive2d/groupprimitive2d.cxx | 4 - drawinglayer/source/primitive2d/helplineprimitive2d.cxx | 4 - drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx | 2 drawinglayer/source/primitive2d/patternfillprimitive2d.cxx | 4 - drawinglayer/source/primitive2d/polygonprimitive2d.cxx | 4 - drawinglayer/source/primitive2d/primitivetools2d.cxx | 16 ++-- drawinglayer/source/primitive2d/sceneprimitive2d.cxx | 4 - drawinglayer/source/primitive2d/shadowprimitive2d.cxx | 4 - drawinglayer/source/primitive2d/texteffectprimitive2d.cxx | 4 - drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx | 6 - drawinglayer/source/processor2d/hittestprocessor2d.cxx | 2 include/drawinglayer/primitive2d/animatedprimitive2d.hxx | 6 - include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx | 2 include/drawinglayer/primitive2d/baseprimitive2d.hxx | 22 ++++- include/drawinglayer/primitive2d/controlprimitive2d.hxx | 2 include/drawinglayer/primitive2d/cropprimitive2d.hxx | 2 include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx | 2 include/drawinglayer/primitive2d/gridprimitive2d.hxx | 2 include/drawinglayer/primitive2d/groupprimitive2d.hxx | 4 - include/drawinglayer/primitive2d/helplineprimitive2d.hxx | 2 include/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx | 2 include/drawinglayer/primitive2d/patternfillprimitive2d.hxx | 2 include/drawinglayer/primitive2d/polygonprimitive2d.hxx | 2 include/drawinglayer/primitive2d/primitivetools2d.hxx | 8 +- include/drawinglayer/primitive2d/sceneprimitive2d.hxx | 2 include/drawinglayer/primitive2d/shadowprimitive2d.hxx | 2 include/drawinglayer/primitive2d/texteffectprimitive2d.hxx | 2 include/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx | 2 svx/inc/sdr/primitive2d/sdrole2primitive2d.hxx | 2 svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx | 2 svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx | 6 - svx/source/sdr/primitive2d/sdrole2primitive2d.cxx | 4 - svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx | 4 - sw/source/core/draw/dflyobj.cxx | 6 - 42 files changed, 134 insertions(+), 96 deletions(-)
New commits: commit cc15806b527cc02c57bd92211fda259e33963106 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Mon Nov 14 09:11:35 2016 +0200 convert BasePrimitive2D::get2DDecomposition to use a visitor which lets us avoid constructing the decomposition when we are only interesting in the bounding box, e.g. for hit testing Change-Id: Icd8d430b75d207063f1db70e5a0822d5d82a7d00 Reviewed-on: https://gerrit.libreoffice.org/30835 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/drawinglayer/source/primitive2d/animatedprimitive2d.cxx b/drawinglayer/source/primitive2d/animatedprimitive2d.cxx index 13564af..63c2527 100644 --- a/drawinglayer/source/primitive2d/animatedprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/animatedprimitive2d.cxx @@ -64,7 +64,7 @@ namespace drawinglayer return false; } - void AnimatedSwitchPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void AnimatedSwitchPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { if(!getChildren().empty()) { @@ -78,7 +78,7 @@ namespace drawinglayer } const Primitive2DReference xRef(getChildren()[nIndex], uno::UNO_QUERY_THROW); - rContainer.push_back(xRef); + rVisitor.append(xRef); } } @@ -100,7 +100,7 @@ namespace drawinglayer { } - void AnimatedBlinkPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void AnimatedBlinkPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { if(!getChildren().empty()) { @@ -108,7 +108,7 @@ namespace drawinglayer if(fState < 0.5) { - getChildren(rContainer); + getChildren(rVisitor); } } } @@ -141,7 +141,7 @@ namespace drawinglayer } } - void AnimatedInterpolatePrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void AnimatedInterpolatePrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { const sal_uInt32 nSize(maMatrixStack.size()); @@ -188,11 +188,11 @@ namespace drawinglayer // create new transform primitive reference, return new sequence const Primitive2DReference xRef(new TransformPrimitive2D(aTargetTransform, getChildren())); - rContainer.push_back(xRef); + rVisitor.append(xRef); } else { - getChildren(rContainer); + getChildren(rVisitor); } } diff --git a/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx b/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx index 20afb0d..00ef47f 100644 --- a/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx @@ -70,7 +70,7 @@ namespace drawinglayer return rViewInformation.getViewport(); } - void BackgroundColorPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void BackgroundColorPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { ::osl::MutexGuard aGuard( m_aMutex ); @@ -87,7 +87,7 @@ namespace drawinglayer } // use parent implementation - BufferedDecompositionPrimitive2D::get2DDecomposition(rContainer, rViewInformation); + BufferedDecompositionPrimitive2D::get2DDecomposition(rVisitor, rViewInformation); } // provide unique ID diff --git a/drawinglayer/source/primitive2d/baseprimitive2d.cxx b/drawinglayer/source/primitive2d/baseprimitive2d.cxx index bcc96c7..31f495c 100644 --- a/drawinglayer/source/primitive2d/baseprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/baseprimitive2d.cxx @@ -36,6 +36,8 @@ namespace drawinglayer { namespace primitive2d { + Primitive2DDecompositionVisitor::~Primitive2DDecompositionVisitor() {} + BasePrimitive2D::BasePrimitive2D() : BasePrimitive2DImplBase(m_aMutex) { @@ -50,14 +52,31 @@ namespace drawinglayer return (getPrimitive2DID() == rPrimitive.getPrimitive2DID()); } + // Visitor class to get the B2D range from a tree of Primitive2DReference's + // + class B2DRangeVisitor : public Primitive2DDecompositionVisitor { + public: + const geometry::ViewInformation2D& mrViewInformation; + basegfx::B2DRange maRetval; + B2DRangeVisitor(const geometry::ViewInformation2D& rViewInformation) : mrViewInformation(rViewInformation) {} + virtual void append(const Primitive2DReference& r) override { + maRetval.expand(getB2DRangeFromPrimitive2DReference(r, mrViewInformation)); + } + virtual void append(const Primitive2DContainer& r) override { + maRetval.expand(r.getB2DRange(mrViewInformation)); + } + virtual void append(Primitive2DContainer&& r) override { + maRetval.expand(r.getB2DRange(mrViewInformation)); + } + }; basegfx::B2DRange BasePrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const { - Primitive2DContainer aContainer; - get2DDecomposition(aContainer, rViewInformation); - return aContainer.getB2DRange(rViewInformation); + B2DRangeVisitor aVisitor(rViewInformation); + get2DDecomposition(aVisitor, rViewInformation); + return aVisitor.maRetval; } - void BasePrimitive2D::get2DDecomposition(Primitive2DContainer& /*rContainer*/, const geometry::ViewInformation2D& /*rViewInformation*/) const + void BasePrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& /*rVisitor*/, const geometry::ViewInformation2D& /*rViewInformation*/) const { } @@ -98,7 +117,7 @@ namespace drawinglayer { } - void BufferedDecompositionPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void BufferedDecompositionPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { ::osl::MutexGuard aGuard( m_aMutex ); @@ -109,7 +128,7 @@ namespace drawinglayer const_cast< BufferedDecompositionPrimitive2D* >(this)->setBuffered2DDecomposition(aNewSequence); } - rContainer.insert(rContainer.end(), getBuffered2DDecomposition().begin(), getBuffered2DDecomposition().end()); + rVisitor.append(getBuffered2DDecomposition()); } } // end of namespace primitive2d } // end of namespace drawinglayer @@ -248,6 +267,13 @@ namespace drawinglayer return true; } + Primitive2DContainer::~Primitive2DContainer() {} + + void Primitive2DContainer::append(const Primitive2DReference& rSource) + { + push_back(rSource); + } + void Primitive2DContainer::append(const Primitive2DContainer& rSource) { insert(end(), rSource.begin(), rSource.end()); diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx b/drawinglayer/source/primitive2d/controlprimitive2d.cxx index 8463055..5786376 100644 --- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx @@ -326,7 +326,7 @@ namespace drawinglayer return aRetval; } - void ControlPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void ControlPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { // this primitive is view-dependent related to the scaling. If scaling has changed, // destroy existing decomposition. To detect change, use size of unit size in view coordinates @@ -349,7 +349,7 @@ namespace drawinglayer } // use parent implementation - BufferedDecompositionPrimitive2D::get2DDecomposition(rContainer, rViewInformation); + BufferedDecompositionPrimitive2D::get2DDecomposition(rVisitor, rViewInformation); } // provide unique ID diff --git a/drawinglayer/source/primitive2d/cropprimitive2d.cxx b/drawinglayer/source/primitive2d/cropprimitive2d.cxx index c3644e2..0088e2f 100644 --- a/drawinglayer/source/primitive2d/cropprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/cropprimitive2d.cxx @@ -66,7 +66,7 @@ namespace drawinglayer return false; } - void CropPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& /*rViewInformation*/) const + void CropPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& /*rViewInformation*/) const { if(!getChildren().empty()) { @@ -126,7 +126,7 @@ namespace drawinglayer { // the new range is completely inside the old range (unit range), // so no masking is needed - rContainer.push_back(xTransformPrimitive); + rVisitor.append(xTransformPrimitive); } else { @@ -140,7 +140,7 @@ namespace drawinglayer aMaskPolyPolygon, Primitive2DContainer { xTransformPrimitive })); - rContainer.push_back(xMask); + rVisitor.append(xMask); } } } diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx index c5eb913..464a4e1 100644 --- a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx @@ -176,7 +176,7 @@ namespace drawinglayer return getOutputRange(); } - void FillHatchPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void FillHatchPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { ::osl::MutexGuard aGuard( m_aMutex ); bool bAdaptDistance(0 != getFillHatch().getMinimalDiscreteDistance()); @@ -184,12 +184,12 @@ namespace drawinglayer if(bAdaptDistance) { // behave view-dependent - DiscreteMetricDependentPrimitive2D::get2DDecomposition(rContainer, rViewInformation); + DiscreteMetricDependentPrimitive2D::get2DDecomposition(rVisitor, rViewInformation); } else { // behave view-independent - BufferedDecompositionPrimitive2D::get2DDecomposition(rContainer, rViewInformation); + BufferedDecompositionPrimitive2D::get2DDecomposition(rVisitor, rViewInformation); } } diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx index 4c48cf7..0164e4b 100644 --- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx @@ -323,7 +323,7 @@ namespace drawinglayer virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; /// override to deliver the correct expected frame dependent of timing - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; }; AnimatedGraphicPrimitive2D::AnimatedGraphicPrimitive2D( @@ -392,7 +392,7 @@ namespace drawinglayer && getGraphic() == pCompare->getGraphic()); } - void AnimatedGraphicPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void AnimatedGraphicPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { if (isValidData()) { @@ -413,7 +413,7 @@ namespace drawinglayer if (aRetval.is()) { - rContainer.push_back(aRetval); + rVisitor.append(aRetval); return; } @@ -432,14 +432,14 @@ namespace drawinglayer if (aRetval.is()) { - rContainer.push_back(aRetval); + rVisitor.append(aRetval); return; } // did not work (not buffered and not 1st frame), create from buffer aRetval = createFromBuffer(); - rContainer.push_back(aRetval); + rVisitor.append(aRetval); } } diff --git a/drawinglayer/source/primitive2d/gridprimitive2d.cxx b/drawinglayer/source/primitive2d/gridprimitive2d.cxx index 49594f45..cbc49dd 100644 --- a/drawinglayer/source/primitive2d/gridprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/gridprimitive2d.cxx @@ -309,7 +309,7 @@ namespace drawinglayer return aUnitRange; } - void GridPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void GridPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { ::osl::MutexGuard aGuard( m_aMutex ); @@ -330,7 +330,7 @@ namespace drawinglayer } // use parent implementation - BufferedDecompositionPrimitive2D::get2DDecomposition(rContainer, rViewInformation); + BufferedDecompositionPrimitive2D::get2DDecomposition(rVisitor, rViewInformation); } // provide unique ID diff --git a/drawinglayer/source/primitive2d/groupprimitive2d.cxx b/drawinglayer/source/primitive2d/groupprimitive2d.cxx index fb3f6b9..1b86f15 100644 --- a/drawinglayer/source/primitive2d/groupprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/groupprimitive2d.cxx @@ -51,9 +51,9 @@ namespace drawinglayer } /// default: just return children, so all renderers not supporting group will use its content - void GroupPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& /*rViewInformation*/) const + void GroupPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& /*rViewInformation*/) const { - getChildren(rContainer); + getChildren(rVisitor); } sal_Int64 SAL_CALL GroupPrimitive2D::estimateUsage() diff --git a/drawinglayer/source/primitive2d/helplineprimitive2d.cxx b/drawinglayer/source/primitive2d/helplineprimitive2d.cxx index b8cc0df..85bd171 100644 --- a/drawinglayer/source/primitive2d/helplineprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/helplineprimitive2d.cxx @@ -162,7 +162,7 @@ namespace drawinglayer return false; } - void HelplinePrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void HelplinePrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { ::osl::MutexGuard aGuard( m_aMutex ); @@ -183,7 +183,7 @@ namespace drawinglayer } // use parent implementation - BufferedDecompositionPrimitive2D::get2DDecomposition(rContainer, rViewInformation); + BufferedDecompositionPrimitive2D::get2DDecomposition(rVisitor, rViewInformation); } // provide unique ID diff --git a/drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx b/drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx index f437a3f..12d7343 100644 --- a/drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx @@ -39,7 +39,7 @@ namespace drawinglayer return getChildren().getB2DRange(rViewInformation); } - void HiddenGeometryPrimitive2D::get2DDecomposition(Primitive2DContainer& /*rContainer*/, const geometry::ViewInformation2D& /*rViewInformation*/) const + void HiddenGeometryPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& /*rVisitor*/, const geometry::ViewInformation2D& /*rViewInformation*/) const { } diff --git a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx index f4ea853..7484a1e 100644 --- a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx @@ -251,7 +251,7 @@ namespace drawinglayer return getMask().getB2DRange(); } - void PatternFillPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void PatternFillPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { // The existing bufferd decomposition uses a buffer in the remembered // size or none if sizes are zero. Get new needed sizes which depend on @@ -307,7 +307,7 @@ namespace drawinglayer } // call parent - BufferedDecompositionPrimitive2D::get2DDecomposition(rContainer, rViewInformation); + BufferedDecompositionPrimitive2D::get2DDecomposition(rVisitor, rViewInformation); } sal_Int64 SAL_CALL PatternFillPrimitive2D::estimateUsage() diff --git a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx index 2ebd32a..8040594 100644 --- a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx @@ -168,7 +168,7 @@ namespace drawinglayer return aRetval; } - void PolygonMarkerPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void PolygonMarkerPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { ::osl::MutexGuard aGuard( m_aMutex ); bool bNeedNewDecomposition(false); @@ -195,7 +195,7 @@ namespace drawinglayer } // use parent implementation - BufferedDecompositionPrimitive2D::get2DDecomposition(rContainer, rViewInformation); + BufferedDecompositionPrimitive2D::get2DDecomposition(rVisitor, rViewInformation); } // provide unique ID diff --git a/drawinglayer/source/primitive2d/primitivetools2d.cxx b/drawinglayer/source/primitive2d/primitivetools2d.cxx index 494a8cd..e98daad 100644 --- a/drawinglayer/source/primitive2d/primitivetools2d.cxx +++ b/drawinglayer/source/primitive2d/primitivetools2d.cxx @@ -26,7 +26,7 @@ namespace drawinglayer { namespace primitive2d { - void DiscreteMetricDependentPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void DiscreteMetricDependentPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { ::osl::MutexGuard aGuard( m_aMutex ); @@ -47,7 +47,7 @@ namespace drawinglayer } // call base implementation - BufferedDecompositionPrimitive2D::get2DDecomposition(rContainer, rViewInformation); + BufferedDecompositionPrimitive2D::get2DDecomposition(rVisitor, rViewInformation); } } // end of namespace primitive2d } // end of namespace drawinglayer @@ -57,7 +57,7 @@ namespace drawinglayer { namespace primitive2d { - void ViewportDependentPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void ViewportDependentPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { ::osl::MutexGuard aGuard( m_aMutex ); @@ -77,7 +77,7 @@ namespace drawinglayer } // call base implementation - BufferedDecompositionPrimitive2D::get2DDecomposition(rContainer, rViewInformation); + BufferedDecompositionPrimitive2D::get2DDecomposition(rVisitor, rViewInformation); } } // end of namespace primitive2d } // end of namespace drawinglayer @@ -87,7 +87,7 @@ namespace drawinglayer { namespace primitive2d { - void ViewTransformationDependentPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void ViewTransformationDependentPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { ::osl::MutexGuard aGuard( m_aMutex ); @@ -107,7 +107,7 @@ namespace drawinglayer } // call base implementation - BufferedDecompositionPrimitive2D::get2DDecomposition(rContainer, rViewInformation); + BufferedDecompositionPrimitive2D::get2DDecomposition(rVisitor, rViewInformation); } } // end of namespace primitive2d } // end of namespace drawinglayer @@ -117,7 +117,7 @@ namespace drawinglayer { namespace primitive2d { - void ObjectAndViewTransformationDependentPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void ObjectAndViewTransformationDependentPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { ::osl::MutexGuard aGuard( m_aMutex ); @@ -147,7 +147,7 @@ namespace drawinglayer } // call base implementation - BufferedDecompositionPrimitive2D::get2DDecomposition(rContainer, rViewInformation); + BufferedDecompositionPrimitive2D::get2DDecomposition(rVisitor, rViewInformation); } } // end of namespace primitive2d } // end of namespace drawinglayer diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx index 73fd8cb..bbf6774 100644 --- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx @@ -632,7 +632,7 @@ namespace drawinglayer return aRetval; } - void ScenePrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void ScenePrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { ::osl::MutexGuard aGuard( m_aMutex ); @@ -689,7 +689,7 @@ namespace drawinglayer } // use parent implementation - BufferedDecompositionPrimitive2D::get2DDecomposition(rContainer, rViewInformation); + BufferedDecompositionPrimitive2D::get2DDecomposition(rVisitor, rViewInformation); } // provide unique ID diff --git a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx index f1e4b9f..4375319 100644 --- a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx @@ -64,7 +64,7 @@ namespace drawinglayer return aRetval; } - void ShadowPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& /*rViewInformation*/) const + void ShadowPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& /*rViewInformation*/) const { if(!getChildren().empty()) { @@ -79,7 +79,7 @@ namespace drawinglayer const Primitive2DContainer aSequenceB { xRefA }; // build transformed primitiveVector with shadow offset and add to target - rContainer.push_back(new TransformPrimitive2D(getShadowTransform(), aSequenceB)); + rVisitor.append(new TransformPrimitive2D(getShadowTransform(), aSequenceB)); } } diff --git a/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx b/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx index c0965a5..858be59 100644 --- a/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx @@ -217,7 +217,7 @@ namespace drawinglayer return aRetval; } - void TextEffectPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void TextEffectPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { ::osl::MutexGuard aGuard( m_aMutex ); @@ -237,7 +237,7 @@ namespace drawinglayer } // use parent implementation - BufferedDecompositionPrimitive2D::get2DDecomposition(rContainer, rViewInformation); + BufferedDecompositionPrimitive2D::get2DDecomposition(rVisitor, rViewInformation); } // provide unique ID diff --git a/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx index cce531f..24f0773 100644 --- a/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx @@ -61,12 +61,12 @@ namespace drawinglayer return getChildren().getB2DRange( rViewInformation); } - void UnifiedTransparencePrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void UnifiedTransparencePrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { if(0.0 == getTransparence()) { // no transparence used, so just use the content - getChildren(rContainer); + getChildren(rVisitor); } else if(getTransparence() > 0.0 && getTransparence() < 1.0) { @@ -95,7 +95,7 @@ namespace drawinglayer aTransparenceContent[1] = Primitive2DReference(new PolygonHairlinePrimitive2D(aPolygon, aGray)); // create sub-transparence group with a gray-colored rectangular fill polygon - rContainer.push_back(new TransparencePrimitive2D(getChildren(), aTransparenceContent)); + rVisitor.append(new TransparencePrimitive2D(getChildren(), aTransparenceContent)); } else { diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx index 214259c..6376156 100644 --- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx +++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx @@ -429,7 +429,7 @@ namespace drawinglayer if(!getHitTextOnly()) { // The recently added BitmapEx::GetTransparency() makes it easy to extend - // the BitmapPrimitive2D HitTest to take the contained BotmapEx and it's + // the BitmapPrimitive2D HitTest to take the contained BitmapEx and it's // transparency into account const basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D())); diff --git a/include/drawinglayer/primitive2d/animatedprimitive2d.hxx b/include/drawinglayer/primitive2d/animatedprimitive2d.hxx index 0e86019..db873c5 100644 --- a/include/drawinglayer/primitive2d/animatedprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/animatedprimitive2d.hxx @@ -99,7 +99,7 @@ namespace drawinglayer depends on the point in time, so the default implementation is not useful here, it needs to be handled locally */ - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; }; } // end of namespace primitive2d } // end of namespace drawinglayer @@ -125,7 +125,7 @@ namespace drawinglayer const Primitive2DContainer& rChildren); /// create local decomposition - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; /// provide unique ID DeclPrimitive2DIDBlock() @@ -160,7 +160,7 @@ namespace drawinglayer const Primitive2DContainer& rChildren); /// create local decomposition - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; /// provide unique ID DeclPrimitive2DIDBlock() diff --git a/include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx b/include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx index 35d0221..8ccc433 100644 --- a/include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx @@ -77,7 +77,7 @@ namespace drawinglayer DeclPrimitive2DIDBlock() /// Override standard getDecomposition call to be view-dependent here - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; }; } // end of namespace primitive2d } // end of namespace drawinglayer diff --git a/include/drawinglayer/primitive2d/baseprimitive2d.hxx b/include/drawinglayer/primitive2d/baseprimitive2d.hxx index 66250bb..0bf92ce 100644 --- a/include/drawinglayer/primitive2d/baseprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/baseprimitive2d.hxx @@ -58,20 +58,32 @@ namespace drawinglayer { namespace primitive2d { typedef css::uno::Reference< css::graphic::XPrimitive2D > Primitive2DReference; typedef css::uno::Sequence< Primitive2DReference > Primitive2DSequence; + class Primitive2DContainer; + // Visitor class for walking a tree of Primitive2DReference in BasePrimitive2D::get2DDecomposition + class DRAWINGLAYER_DLLPUBLIC Primitive2DDecompositionVisitor { + public: + virtual void append(const Primitive2DReference&) = 0; + virtual void append(const Primitive2DContainer&) = 0; + virtual void append(Primitive2DContainer&&) = 0; + virtual ~Primitive2DDecompositionVisitor(); + }; - class SAL_WARN_UNUSED DRAWINGLAYER_DLLPUBLIC Primitive2DContainer : public std::deque< Primitive2DReference > + class SAL_WARN_UNUSED DRAWINGLAYER_DLLPUBLIC Primitive2DContainer : public std::deque< Primitive2DReference >, + public Primitive2DDecompositionVisitor { public: explicit Primitive2DContainer() {} explicit Primitive2DContainer( size_type count ) : deque(count) {} + virtual ~Primitive2DContainer() override; Primitive2DContainer( const Primitive2DContainer& other ) : deque(other) {} Primitive2DContainer( const Primitive2DContainer&& other ) : deque(other) {} Primitive2DContainer( const std::deque< Primitive2DReference >& other ) : deque(other) {} Primitive2DContainer( std::initializer_list<Primitive2DReference> init ) : deque(init) {} - void append(const Primitive2DContainer& rSource); + virtual void append(const Primitive2DReference&) override; + virtual void append(const Primitive2DContainer& rSource) override; + virtual void append(Primitive2DContainer&& rSource) override; void append(const Primitive2DSequence& rSource); - void append(Primitive2DContainer&& rSource); Primitive2DContainer& operator=(const Primitive2DContainer& r) { deque::operator=(r); return *this; } Primitive2DContainer& operator=(const Primitive2DContainer&& r) { deque::operator=(r); return *this; } bool operator==(const Primitive2DContainer& rB) const; @@ -190,7 +202,7 @@ namespace drawinglayer virtual sal_uInt32 getPrimitive2DID() const = 0; /// The default implementation will return an empty sequence - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const; // Methods from XPrimitive2D @@ -279,7 +291,7 @@ namespace drawinglayer overridden and the ViewInformation2D for the last decomposition need to be remembered, too, and be used in the next call to decide if the buffered decomposition may be reused or not. */ - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; }; } // end of namespace primitive2d } // end of namespace drawinglayer diff --git a/include/drawinglayer/primitive2d/controlprimitive2d.hxx b/include/drawinglayer/primitive2d/controlprimitive2d.hxx index 554d92d..9286c14 100644 --- a/include/drawinglayer/primitive2d/controlprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/controlprimitive2d.hxx @@ -100,7 +100,7 @@ namespace drawinglayer DeclPrimitive2DIDBlock() /// Override standard getDecomposition to be view-dependent here - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; }; } // end of namespace primitive2d } // end of namespace drawinglayer diff --git a/include/drawinglayer/primitive2d/cropprimitive2d.hxx b/include/drawinglayer/primitive2d/cropprimitive2d.hxx index 124d050..9a71e9c 100644 --- a/include/drawinglayer/primitive2d/cropprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/cropprimitive2d.hxx @@ -86,7 +86,7 @@ namespace drawinglayer virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; /// local decomposition - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; /// provide unique ID DeclPrimitive2DIDBlock() diff --git a/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx b/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx index e320b3f..4291cbb 100644 --- a/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx @@ -93,7 +93,7 @@ namespace drawinglayer virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override; /// Override standard getDecomposition to be view-dependent here - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; /// provide unique ID DeclPrimitive2DIDBlock() diff --git a/include/drawinglayer/primitive2d/gridprimitive2d.hxx b/include/drawinglayer/primitive2d/gridprimitive2d.hxx index 51ef795..4e55030 100644 --- a/include/drawinglayer/primitive2d/gridprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/gridprimitive2d.hxx @@ -107,7 +107,7 @@ namespace drawinglayer DeclPrimitive2DIDBlock() /// Override standard getDecomposition to be view-dependent here - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; }; } // end of namespace primitive2d } // end of namespace drawinglayer diff --git a/include/drawinglayer/primitive2d/groupprimitive2d.hxx b/include/drawinglayer/primitive2d/groupprimitive2d.hxx index 1928be1..f08e032 100644 --- a/include/drawinglayer/primitive2d/groupprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/groupprimitive2d.hxx @@ -76,13 +76,13 @@ namespace drawinglayer /// data read access const Primitive2DContainer& getChildren() const { return maChildren; } - void getChildren(Primitive2DContainer& rContainer) const { rContainer.insert(rContainer.end(), maChildren.begin(), maChildren.end()); } + void getChildren(Primitive2DDecompositionVisitor& rVisitor) const { rVisitor.append(maChildren); } /// compare operator virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override; /// local decomposition. Implementation will just return children - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; /// provide unique ID DeclPrimitive2DIDBlock() diff --git a/include/drawinglayer/primitive2d/helplineprimitive2d.hxx b/include/drawinglayer/primitive2d/helplineprimitive2d.hxx index fbc67fe..fd48f0a 100644 --- a/include/drawinglayer/primitive2d/helplineprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/helplineprimitive2d.hxx @@ -102,7 +102,7 @@ namespace drawinglayer DeclPrimitive2DIDBlock() /// Override standard getDecomposition to be view-dependent here - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; }; } // end of namespace primitive2d } // end of namespace drawinglayer diff --git a/include/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx b/include/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx index 788d09d..10e5581 100644 --- a/include/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx @@ -48,7 +48,7 @@ namespace drawinglayer virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override; /// local decomposition. Implementation will return empty Primitive2DSequence - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; // provide unique ID DeclPrimitive2DIDBlock() diff --git a/include/drawinglayer/primitive2d/patternfillprimitive2d.hxx b/include/drawinglayer/primitive2d/patternfillprimitive2d.hxx index 11d0647..800c377 100644 --- a/include/drawinglayer/primitive2d/patternfillprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/patternfillprimitive2d.hxx @@ -83,7 +83,7 @@ namespace drawinglayer virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override; /// overload to react on evtl. buffered content - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; /// provide unique ID DeclPrimitive2DIDBlock() diff --git a/include/drawinglayer/primitive2d/polygonprimitive2d.hxx b/include/drawinglayer/primitive2d/polygonprimitive2d.hxx index 2a41ac9..e92276c 100644 --- a/include/drawinglayer/primitive2d/polygonprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/polygonprimitive2d.hxx @@ -133,7 +133,7 @@ namespace drawinglayer virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override; /// Override standard getDecomposition to be view-dependent here - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; /// provide unique ID DeclPrimitive2DIDBlock() diff --git a/include/drawinglayer/primitive2d/primitivetools2d.hxx b/include/drawinglayer/primitive2d/primitivetools2d.hxx index 289fc77..d127b60 100644 --- a/include/drawinglayer/primitive2d/primitivetools2d.hxx +++ b/include/drawinglayer/primitive2d/primitivetools2d.hxx @@ -58,7 +58,7 @@ namespace drawinglayer double getDiscreteUnit() const { return mfDiscreteUnit; } /// Override standard getDecomposition to be view-dependent here - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; }; } // end of namespace primitive2d } // end of namespace drawinglayer @@ -96,7 +96,7 @@ namespace drawinglayer const basegfx::B2DRange& getViewport() const { return maViewport; } /// Override standard getDecomposition to be view-dependent here - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; }; } // end of namespace primitive2d } // end of namespace drawinglayer @@ -134,7 +134,7 @@ namespace drawinglayer const basegfx::B2DHomMatrix& getViewTransformation() const { return maViewTransformation; } /// Override standard getDecomposition to be view-dependent here - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; }; } // end of namespace primitive2d } // end of namespace drawinglayer @@ -176,7 +176,7 @@ namespace drawinglayer const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; } /// Override standard getDecomposition to be view-dependent here - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; }; } // end of namespace primitive2d } // end of namespace drawinglayer diff --git a/include/drawinglayer/primitive2d/sceneprimitive2d.hxx b/include/drawinglayer/primitive2d/sceneprimitive2d.hxx index ba55c31..141bd68 100644 --- a/include/drawinglayer/primitive2d/sceneprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/sceneprimitive2d.hxx @@ -145,7 +145,7 @@ namespace drawinglayer DeclPrimitive2DIDBlock() /// get local decomposition. Override since this decomposition is view-dependent - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; }; } // end of namespace primitive2d } // end of namespace drawinglayer diff --git a/include/drawinglayer/primitive2d/shadowprimitive2d.hxx b/include/drawinglayer/primitive2d/shadowprimitive2d.hxx index 13461f8..b216aca 100644 --- a/include/drawinglayer/primitive2d/shadowprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/shadowprimitive2d.hxx @@ -72,7 +72,7 @@ namespace drawinglayer virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override; /// create decomposition - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; /// provide unique ID DeclPrimitive2DIDBlock() diff --git a/include/drawinglayer/primitive2d/texteffectprimitive2d.hxx b/include/drawinglayer/primitive2d/texteffectprimitive2d.hxx index 733234f..a8da738 100644 --- a/include/drawinglayer/primitive2d/texteffectprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/texteffectprimitive2d.hxx @@ -93,7 +93,7 @@ namespace drawinglayer DeclPrimitive2DIDBlock() /// Override standard getDecomposition to be view-dependent here - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; }; } // end of namespace primitive2d } // end of namespace drawinglayer diff --git a/include/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx b/include/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx index e24f8f3..df6ac0e 100644 --- a/include/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx @@ -60,7 +60,7 @@ namespace drawinglayer virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override; /// create decomposition - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; /// provide unique ID DeclPrimitive2DIDBlock() diff --git a/svx/inc/sdr/primitive2d/sdrole2primitive2d.hxx b/svx/inc/sdr/primitive2d/sdrole2primitive2d.hxx index 0855f02..c6b22ff 100644 --- a/svx/inc/sdr/primitive2d/sdrole2primitive2d.hxx +++ b/svx/inc/sdr/primitive2d/sdrole2primitive2d.hxx @@ -54,7 +54,7 @@ namespace drawinglayer virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; // local decomposition. - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& aViewInformation) const override; // provide unique ID DeclPrimitive2DIDBlock() diff --git a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx index 523d70f..3da7cc1 100644 --- a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx +++ b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx @@ -92,7 +92,7 @@ namespace drawinglayer // own get2DDecomposition to take aspect of decomposition with or without spell checker // into account - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; // transformed clone operator virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const = 0; diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index 817fb16..a0488a3 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -781,7 +781,7 @@ namespace sdr { namespace contact { protected: virtual void get2DDecomposition( - ::drawinglayer::primitive2d::Primitive2DContainer& rContainer, + ::drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor, const ::drawinglayer::geometry::ViewInformation2D& rViewInformation ) const override; @@ -1529,7 +1529,7 @@ namespace sdr { namespace contact { } - void LazyControlCreationPrimitive2D::get2DDecomposition( ::drawinglayer::primitive2d::Primitive2DContainer& rContainer, const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const + void LazyControlCreationPrimitive2D::get2DDecomposition( ::drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor, const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const { #if OSL_DEBUG_LEVEL > 0 ::basegfx::B2DVector aScale, aTranslate; @@ -1538,7 +1538,7 @@ namespace sdr { namespace contact { #endif if ( m_pVOCImpl->hasControl() ) impl_positionAndZoomControl( _rViewInformation ); - BufferedDecompositionPrimitive2D::get2DDecomposition( rContainer, _rViewInformation ); + BufferedDecompositionPrimitive2D::get2DDecomposition( rVisitor, _rViewInformation ); } diff --git a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx index 7fe161f..e69f009 100644 --- a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx @@ -66,7 +66,7 @@ namespace drawinglayer return false; } - void SdrOle2Primitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& /*aViewInformation*/) const + void SdrOle2Primitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& /*aViewInformation*/) const { // to take care of getSdrLFSTAttribute() later, the same as in SdrGrafPrimitive2D::create2DDecomposition // should happen. For the moment we only need the OLE itself @@ -170,7 +170,7 @@ namespace drawinglayer getSdrLFSTAttribute().getShadow()); } - rContainer.insert(rContainer.end(), aRetval.begin(), aRetval.end()); + rVisitor.append(aRetval); } // provide unique ID diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx index ab8ca84..943775b 100644 --- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx @@ -137,7 +137,7 @@ namespace drawinglayer return false; } - void SdrTextPrimitive2D::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void SdrTextPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { uno::Reference< drawing::XDrawPage > xCurrentlyVisualizingPage; bool bCurrentlyVisualizingPageIsSet(false); @@ -234,7 +234,7 @@ namespace drawinglayer } // call parent - BufferedDecompositionPrimitive2D::get2DDecomposition(rContainer, rViewInformation); + BufferedDecompositionPrimitive2D::get2DDecomposition(rVisitor, rViewInformation); } } // end of namespace primitive2d } // end of namespace drawinglayer diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index bd38e86..59ab8b1 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -167,7 +167,7 @@ namespace drawinglayer virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override; // override to allow callbacks to wrap_DoPaintObject - virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; // data read access const SwVirtFlyDrawObj& getSwVirtFlyDrawObj() const { return mrSwVirtFlyDrawObj; } @@ -218,7 +218,7 @@ namespace drawinglayer return getOuterRange(); } - void SwVirtFlyDrawObjPrimitive::get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const + void SwVirtFlyDrawObjPrimitive::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const { // This is the callback to keep the FlyFrame painting in SW alive as long as it // is not changed to primitives. This is the method which will be called by the processors @@ -228,7 +228,7 @@ namespace drawinglayer getSwVirtFlyDrawObj().wrap_DoPaintObject(rViewInformation); // call parent - BufferedDecompositionPrimitive2D::get2DDecomposition(rContainer, rViewInformation); + BufferedDecompositionPrimitive2D::get2DDecomposition(rVisitor, rViewInformation); } // provide unique ID _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits