drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx | 2 +- drawinglayer/source/primitive2d/animatedprimitive2d.cxx | 4 ++-- drawinglayer/source/primitive2d/baseprimitive2d.cxx | 6 +++--- drawinglayer/source/primitive2d/cropprimitive2d.cxx | 4 ++-- drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx | 6 +++--- drawinglayer/source/primitive2d/shadowprimitive2d.cxx | 2 +- drawinglayer/source/primitive2d/softedgeprimitive2d.cxx | 2 +- drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx | 2 +- drawinglayer/source/processor2d/baseprocessor2d.cxx | 6 +++--- include/drawinglayer/primitive2d/Primitive2DContainer.hxx | 10 +++++++--- include/drawinglayer/primitive2d/Primitive2DVisitor.hxx | 6 +++--- include/drawinglayer/primitive2d/groupprimitive2d.hxx | 2 +- include/drawinglayer/processor2d/baseprocessor2d.hxx | 6 +++--- svx/source/sdr/contact/viewobjectcontact.cxx | 2 +- svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx | 2 +- svx/source/sdr/primitive2d/sdrole2primitive2d.cxx | 2 +- 16 files changed, 34 insertions(+), 30 deletions(-)
New commits: commit ca05d480bd4456342f290f975a7353b7d9a63e95 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Dec 3 15:37:26 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Dec 4 11:59:20 2021 +0100 rename Primitive2DDecompositionVisitor methods from "append" to "visit" The current naming comes from when I created this class as replacement for passing Primitive2DContainer around and the naming was meant to reduce code churn. But now that I'm using it more, the naming is an impediment to understanding the code. Change-Id: I4ee0156c7ffb534eac64f1c05eac6b8c67c25ab9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126321 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx b/drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx index 6846a3bcdd26..769b23fb5b80 100644 --- a/drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx +++ b/drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx @@ -43,7 +43,7 @@ void BufferedDecompositionPrimitive2D::get2DDecomposition( std::move(aNewSequence)); } - rVisitor.append(getBuffered2DDecomposition()); + rVisitor.visit(getBuffered2DDecomposition()); } } // end of namespace drawinglayer::primitive2d diff --git a/drawinglayer/source/primitive2d/animatedprimitive2d.cxx b/drawinglayer/source/primitive2d/animatedprimitive2d.cxx index adb66dddb36c..5873ee69a51f 100644 --- a/drawinglayer/source/primitive2d/animatedprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/animatedprimitive2d.cxx @@ -77,7 +77,7 @@ namespace drawinglayer::primitive2d } const Primitive2DReference xRef(getChildren()[nIndex], uno::UNO_SET_THROW); - rVisitor.append(xRef); + rVisitor.visit(xRef); } // provide unique ID @@ -185,7 +185,7 @@ namespace drawinglayer::primitive2d // create new transform primitive reference, return new sequence Primitive2DReference xRef(new TransformPrimitive2D(aTargetTransform, Primitive2DContainer(getChildren()))); - rVisitor.append(xRef); + rVisitor.visit(xRef); } else { diff --git a/drawinglayer/source/primitive2d/baseprimitive2d.cxx b/drawinglayer/source/primitive2d/baseprimitive2d.cxx index 71a13346beff..86eaa37eb976 100644 --- a/drawinglayer/source/primitive2d/baseprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/baseprimitive2d.cxx @@ -112,15 +112,15 @@ public: : mrViewInformation(rViewInformation) { } - virtual void append(const Primitive2DReference& r) override + virtual void visit(const Primitive2DReference& r) override { maRetval.expand(getB2DRangeFromPrimitive2DReference(r, mrViewInformation)); } - virtual void append(const Primitive2DContainer& r) override + virtual void visit(const Primitive2DContainer& r) override { maRetval.expand(r.getB2DRange(mrViewInformation)); } - virtual void append(Primitive2DContainer&& r) override + virtual void visit(Primitive2DContainer&& r) override { maRetval.expand(r.getB2DRange(mrViewInformation)); } diff --git a/drawinglayer/source/primitive2d/cropprimitive2d.cxx b/drawinglayer/source/primitive2d/cropprimitive2d.cxx index 06a7e2726f04..76393ad05507 100644 --- a/drawinglayer/source/primitive2d/cropprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/cropprimitive2d.cxx @@ -126,7 +126,7 @@ namespace drawinglayer::primitive2d { // the new range is completely inside the old range (unit range), // so no masking is needed - rVisitor.append(xTransformPrimitive); + rVisitor.visit(xTransformPrimitive); } else { @@ -140,7 +140,7 @@ namespace drawinglayer::primitive2d aMaskPolyPolygon, Primitive2DContainer { xTransformPrimitive })); - rVisitor.append(xMask); + rVisitor.visit(xMask); } } diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx index c91dd683106b..c8a4da035455 100644 --- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx @@ -442,7 +442,7 @@ namespace drawinglayer::primitive2d if (aRetval.is()) { - rVisitor.append(aRetval); + rVisitor.visit(aRetval); return; } @@ -461,14 +461,14 @@ namespace drawinglayer::primitive2d if (aRetval.is()) { - rVisitor.append(aRetval); + rVisitor.visit(aRetval); return; } // did not work (not buffered and not 1st frame), create from buffer aRetval = createFromBuffer(); - rVisitor.append(aRetval); + rVisitor.visit(aRetval); } } // end of namespace diff --git a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx index 6ea066b35754..758aca3d2f35 100644 --- a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx @@ -80,7 +80,7 @@ namespace drawinglayer::primitive2d Primitive2DContainer aSequenceB { xRefA }; // build transformed primitiveVector with shadow offset and add to target - rVisitor.append(new TransformPrimitive2D(getShadowTransform(), std::move(aSequenceB))); + rVisitor.visit(new TransformPrimitive2D(getShadowTransform(), std::move(aSequenceB))); } // provide unique ID diff --git a/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx b/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx index 98a3bea752eb..59cf59cd7679 100644 --- a/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx @@ -60,7 +60,7 @@ void SoftEdgePrimitive2D::get2DDecomposition( const Primitive2DReference xRef( new ModifiedColorPrimitive2D(Primitive2DContainer(getChildren()), aBColorModifier)); - rVisitor.append(xRef); + rVisitor.visit(xRef); } sal_uInt32 SoftEdgePrimitive2D::getPrimitive2DID() const diff --git a/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx index c50fcb008435..56b284619362 100644 --- a/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx @@ -93,7 +93,7 @@ namespace drawinglayer::primitive2d aTransparenceContent[1] = Primitive2DReference(new PolygonHairlinePrimitive2D(aPolygon, aGray)); // create sub-transparence group with a gray-colored rectangular fill polygon - rVisitor.append(new TransparencePrimitive2D(Primitive2DContainer(getChildren()), std::move(aTransparenceContent))); + rVisitor.visit(new TransparencePrimitive2D(Primitive2DContainer(getChildren()), std::move(aTransparenceContent))); } else { diff --git a/drawinglayer/source/processor2d/baseprocessor2d.cxx b/drawinglayer/source/processor2d/baseprocessor2d.cxx index a078fe882e9e..b4291dd4431c 100644 --- a/drawinglayer/source/processor2d/baseprocessor2d.cxx +++ b/drawinglayer/source/processor2d/baseprocessor2d.cxx @@ -46,16 +46,16 @@ namespace drawinglayer::processor2d } // Primitive2DDecompositionVisitor - void BaseProcessor2D::append(const primitive2d::Primitive2DReference& rCandidate) + void BaseProcessor2D::visit(const primitive2d::Primitive2DReference& rCandidate) { const primitive2d::BasePrimitive2D* pBasePrimitive = static_cast< const primitive2d::BasePrimitive2D* >(rCandidate.get()); processBasePrimitive2D(*pBasePrimitive); } - void BaseProcessor2D::append(const primitive2d::Primitive2DContainer& rContainer) + void BaseProcessor2D::visit(const primitive2d::Primitive2DContainer& rContainer) { process(rContainer); } - void BaseProcessor2D::append(primitive2d::Primitive2DContainer&& rCandidate) + void BaseProcessor2D::visit(primitive2d::Primitive2DContainer&& rCandidate) { process(rCandidate); } diff --git a/include/drawinglayer/primitive2d/Primitive2DContainer.hxx b/include/drawinglayer/primitive2d/Primitive2DContainer.hxx index c62f960bd8d0..3f41e25a2114 100644 --- a/include/drawinglayer/primitive2d/Primitive2DContainer.hxx +++ b/include/drawinglayer/primitive2d/Primitive2DContainer.hxx @@ -71,9 +71,13 @@ public: { } - virtual void append(const Primitive2DReference&) override; - virtual void append(const Primitive2DContainer& rSource) override; - virtual void append(Primitive2DContainer&& rSource) override; + virtual void visit(const Primitive2DReference& rSource) override { append(rSource); } + virtual void visit(const Primitive2DContainer& rSource) override { append(rSource); } + virtual void visit(Primitive2DContainer&& rSource) override { append(std::move(rSource)); } + + void append(const Primitive2DReference&); + void append(const Primitive2DContainer& rSource); + void append(Primitive2DContainer&& rSource); void append(const Primitive2DSequence& rSource); Primitive2DContainer& operator=(const Primitive2DContainer& r) { diff --git a/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx b/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx index dfe04b32a320..70c7171ce010 100644 --- a/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx +++ b/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx @@ -30,9 +30,9 @@ class Primitive2DContainer; class DRAWINGLAYER_DLLPUBLIC Primitive2DDecompositionVisitor { public: - virtual void append(const Primitive2DReference&) = 0; - virtual void append(const Primitive2DContainer&) = 0; - virtual void append(Primitive2DContainer&&) = 0; + virtual void visit(const Primitive2DReference&) = 0; + virtual void visit(const Primitive2DContainer&) = 0; + virtual void visit(Primitive2DContainer&&) = 0; virtual ~Primitive2DDecompositionVisitor() {} }; diff --git a/include/drawinglayer/primitive2d/groupprimitive2d.hxx b/include/drawinglayer/primitive2d/groupprimitive2d.hxx index d2110ed0b3aa..52d4fb4eb13b 100644 --- a/include/drawinglayer/primitive2d/groupprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/groupprimitive2d.hxx @@ -73,7 +73,7 @@ namespace drawinglayer::primitive2d /// data read access const Primitive2DContainer& getChildren() const { return maChildren; } - void getChildren(Primitive2DDecompositionVisitor& rVisitor) const { rVisitor.append(maChildren); } + void getChildren(Primitive2DDecompositionVisitor& rVisitor) const { rVisitor.visit(maChildren); } /// compare operator virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override; diff --git a/include/drawinglayer/processor2d/baseprocessor2d.hxx b/include/drawinglayer/processor2d/baseprocessor2d.hxx index 4f1515109a77..7ab7186308f1 100644 --- a/include/drawinglayer/processor2d/baseprocessor2d.hxx +++ b/include/drawinglayer/processor2d/baseprocessor2d.hxx @@ -176,9 +176,9 @@ namespace drawinglayer::processor2d void process(const primitive2d::BasePrimitive2D& rCandidate); // Primitive2DDecompositionVisitor - virtual void append(const primitive2d::Primitive2DReference&) override final; - virtual void append(const primitive2d::Primitive2DContainer&) override final; - virtual void append(primitive2d::Primitive2DContainer&&) override final; + virtual void visit(const primitive2d::Primitive2DReference&) override final; + virtual void visit(const primitive2d::Primitive2DContainer&) override final; + virtual void visit(primitive2d::Primitive2DContainer&&) override final; public: /// constructor/destructor diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx index f2baca7e5e73..5b0644c0b6c9 100644 --- a/svx/source/sdr/contact/viewobjectcontact.cxx +++ b/svx/source/sdr/contact/viewobjectcontact.cxx @@ -415,7 +415,7 @@ void ViewObjectContact::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInf if(!bVisible) return; - rVisitor.append(xRetval); + rVisitor.visit(xRetval); } void ViewObjectContact::getPrimitive2DSequenceSubHierarchy(DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const diff --git a/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx index 54076af665b6..6b27a1ce8cf0 100644 --- a/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx @@ -129,7 +129,7 @@ namespace sdr::contact } // return grouped primitive - rVisitor.append(xRetval); + rVisitor.visit(xRetval); } } // end of namespace diff --git a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx index 670cbacbe898..04b057a0b6f0 100644 --- a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx @@ -162,7 +162,7 @@ namespace drawinglayer::primitive2d getSdrLFSTAttribute().getShadow()); } - rVisitor.append(aRetval); + rVisitor.visit(aRetval); } // provide unique ID