[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - drawinglayer/inc drawinglayer/source solenv/clang-format

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 14 20:49:43 UTC 2020


 drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx    |  142 ++---
 drawinglayer/source/primitive2d/texteffectprimitive2d.cxx |  383 ++++++--------
 solenv/clang-format/excludelist                           |    2 
 3 files changed, 257 insertions(+), 270 deletions(-)

New commits:
commit 27485323abca79251692d18acc0e03f9675f9623
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Jul 14 22:44:13 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Jul 14 22:44:13 2020 +0200

    remove texteffectprimitive2d.{cxx,hxx} from clang-format blacklist
    
    Change-Id: I57a47358d5e4f1e41fc1c89884b7603d8afdc3bd

diff --git a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
index a39256453f17..9a856c9f6f59 100644
--- a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
@@ -20,81 +20,79 @@
 #pragma once
 
 #include <drawinglayer/drawinglayerdllapi.h>
-
 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
 
-
-namespace drawinglayer
+namespace drawinglayer::primitive2d
 {
-    namespace primitive2d
-    {
-        /** TextEffectStyle2D definition */
-        enum class TextEffectStyle2D
-        {
-            ReliefEmbossedDefault,
-            ReliefEngravedDefault,
-            ReliefEmbossed,
-            ReliefEngraved,
-            Outline
-        };
-
-        /** TextEffectPrimitive2D class
-
-            This primitive embeds text primitives (normally, as can be seen can
-            also be used for any other primitives) which have some TextEffect applied
-            and create the needed geometry and embedding on decomposition.
-        */
-        class TextEffectPrimitive2D final : public BufferedDecompositionPrimitive2D
-        {
-        private:
-            /// the text (or other) content
-            Primitive2DContainer                               maTextContent;
-
-            /// the style to apply, the direction and the rotation center
-            const basegfx::B2DPoint                         maRotationCenter;
-            double                                          mfDirection;
-            TextEffectStyle2D                               meTextEffectStyle2D;
-
-            /** the last used object to view transformtion used from getDecomposition
-                for decide buffering
-             */
-            basegfx::B2DHomMatrix                           maLastObjectToViewTransformation;
-
-            /// create local decomposition
-            virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
-
-        public:
-            /// constructor
-            TextEffectPrimitive2D(
-                const Primitive2DContainer& rTextContent,
-                const basegfx::B2DPoint& rRotationCenter,
-                double fDirection,
-                TextEffectStyle2D eTextEffectStyle2D);
-
-            /// data read access
-            const Primitive2DContainer& getTextContent() const { return maTextContent; }
-            const basegfx::B2DPoint& getRotationCenter() const { return maRotationCenter; }
-            double getDirection() const { return mfDirection; }
-            TextEffectStyle2D getTextEffectStyle2D() const { return meTextEffectStyle2D; }
-
-            /// compare operator
-            virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
-
-            /** own get range implementation to solve more effective. Content is by definition displaced
-                by a fixed discrete unit, thus the contained geometry needs only once be asked for its
-                own basegfx::B2DRange
-             */
-            virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override;
-
-            /// provide unique ID
-            virtual sal_uInt32 getPrimitive2DID() const override;
-
-            /// Override standard getDecomposition to be view-dependent here
-            virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override;
-        };
-    } // end of namespace primitive2d
-} // end of namespace drawinglayer
-
+/** TextEffectStyle2D definition */
+enum class TextEffectStyle2D
+{
+    ReliefEmbossedDefault,
+    ReliefEngravedDefault,
+    ReliefEmbossed,
+    ReliefEngraved,
+    Outline
+};
+
+/** TextEffectPrimitive2D class
+
+    This primitive embeds text primitives (normally, as can be seen can
+    also be used for any other primitives) which have some TextEffect applied
+    and create the needed geometry and embedding on decomposition.
+*/
+class TextEffectPrimitive2D final : public BufferedDecompositionPrimitive2D
+{
+private:
+    /// the text (or other) content
+    Primitive2DContainer maTextContent;
+
+    /// the style to apply, the direction and the rotation center
+    const basegfx::B2DPoint maRotationCenter;
+    double mfDirection;
+    TextEffectStyle2D meTextEffectStyle2D;
+
+    /** the last used object to view transformtion used from getDecomposition
+        for decide buffering
+     */
+    basegfx::B2DHomMatrix maLastObjectToViewTransformation;
+
+    /// create local decomposition
+    virtual void
+    create2DDecomposition(Primitive2DContainer& rContainer,
+                          const geometry::ViewInformation2D& rViewInformation) const override;
+
+public:
+    /// constructor
+    TextEffectPrimitive2D(const Primitive2DContainer& rTextContent,
+                          const basegfx::B2DPoint& rRotationCenter, double fDirection,
+                          TextEffectStyle2D eTextEffectStyle2D);
+
+    /// data read access
+    const Primitive2DContainer& getTextContent() const { return maTextContent; }
+    const basegfx::B2DPoint& getRotationCenter() const { return maRotationCenter; }
+    double getDirection() const { return mfDirection; }
+    TextEffectStyle2D getTextEffectStyle2D() const { return meTextEffectStyle2D; }
+
+    /// compare operator
+    virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
+
+    /** own get range implementation to solve more effective. Content is by definition displaced
+        by a fixed discrete unit, thus the contained geometry needs only once be asked for its
+        own basegfx::B2DRange
+     */
+    virtual basegfx::B2DRange
+    getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override;
+
+    /// provide unique ID
+    virtual sal_uInt32 getPrimitive2DID() const override;
+
+    /// Override standard getDecomposition to be view-dependent here
+    virtual void
+    get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor,
+                       const geometry::ViewInformation2D& rViewInformation) const override;
+};
+
+} // end of namespace primitive2d::drawinglayer
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx b/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx
index abfe28e3ecca..fbd3dfd14332 100644
--- a/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx
@@ -24,222 +24,213 @@
 #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
 
-
 namespace drawinglayer::primitive2d
 {
-        const double fDiscreteSize(1.1);
+const double fDiscreteSize(1.1);
 
-        void TextEffectPrimitive2D::create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const
+void TextEffectPrimitive2D::create2DDecomposition(
+    Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const
+{
+    // get the distance of one discrete units from target display. Use between 1.0 and sqrt(2) to
+    // have good results on rotated objects, too
+    const basegfx::B2DVector aDistance(rViewInformation.getInverseObjectToViewTransformation()
+                                       * basegfx::B2DVector(fDiscreteSize, fDiscreteSize));
+    const basegfx::B2DVector aDiagonalDistance(aDistance * (1.0 / 1.44));
+
+    switch (getTextEffectStyle2D())
+    {
+        case TextEffectStyle2D::ReliefEmbossed:
+        case TextEffectStyle2D::ReliefEngraved:
+        case TextEffectStyle2D::ReliefEmbossedDefault:
+        case TextEffectStyle2D::ReliefEngravedDefault:
         {
-            // get the distance of one discrete units from target display. Use between 1.0 and sqrt(2) to
-            // have good results on rotated objects, too
-            const basegfx::B2DVector aDistance(rViewInformation.getInverseObjectToViewTransformation() *
-                basegfx::B2DVector(fDiscreteSize, fDiscreteSize));
-            const basegfx::B2DVector aDiagonalDistance(aDistance * (1.0 / 1.44));
-
-            switch(getTextEffectStyle2D())
+            // prepare transform of sub-group back to (0,0) and align to X-Axis
+            basegfx::B2DHomMatrix aBackTransform(basegfx::utils::createTranslateB2DHomMatrix(
+                -getRotationCenter().getX(), -getRotationCenter().getY()));
+            aBackTransform.rotate(-getDirection());
+
+            // prepare transform of sub-group back to its position and rotation
+            basegfx::B2DHomMatrix aForwardTransform(
+                basegfx::utils::createRotateB2DHomMatrix(getDirection()));
+            aForwardTransform.translate(getRotationCenter().getX(), getRotationCenter().getY());
+
+            // create transformation for one discrete unit
+            const bool bEmbossed(TextEffectStyle2D::ReliefEmbossed == getTextEffectStyle2D()
+                                 || TextEffectStyle2D::ReliefEmbossedDefault
+                                        == getTextEffectStyle2D());
+            const bool bDefaultTextColor(
+                TextEffectStyle2D::ReliefEmbossedDefault == getTextEffectStyle2D()
+                || TextEffectStyle2D::ReliefEngravedDefault == getTextEffectStyle2D());
+            basegfx::B2DHomMatrix aTransform(aBackTransform);
+
+            if (bEmbossed)
             {
-                case TextEffectStyle2D::ReliefEmbossed:
-                case TextEffectStyle2D::ReliefEngraved:
-                case TextEffectStyle2D::ReliefEmbossedDefault:
-                case TextEffectStyle2D::ReliefEngravedDefault:
-                {
-                    // prepare transform of sub-group back to (0,0) and align to X-Axis
-                    basegfx::B2DHomMatrix aBackTransform(basegfx::utils::createTranslateB2DHomMatrix(
-                        -getRotationCenter().getX(), -getRotationCenter().getY()));
-                    aBackTransform.rotate(-getDirection());
-
-                    // prepare transform of sub-group back to its position and rotation
-                    basegfx::B2DHomMatrix aForwardTransform(basegfx::utils::createRotateB2DHomMatrix(getDirection()));
-                    aForwardTransform.translate(getRotationCenter().getX(), getRotationCenter().getY());
-
-                    // create transformation for one discrete unit
-                    const bool bEmbossed(
-                        TextEffectStyle2D::ReliefEmbossed  == getTextEffectStyle2D()
-                        || TextEffectStyle2D::ReliefEmbossedDefault == getTextEffectStyle2D());
-                    const bool bDefaultTextColor(
-                        TextEffectStyle2D::ReliefEmbossedDefault == getTextEffectStyle2D()
-                        || TextEffectStyle2D::ReliefEngravedDefault == getTextEffectStyle2D());
-                    basegfx::B2DHomMatrix aTransform(aBackTransform);
-
-                    if(bEmbossed)
-                    {
-                        // to bottom-right
-                        aTransform.translate(aDiagonalDistance.getX(), aDiagonalDistance.getY());
-                    }
-                    else
-                    {
-                        // to top-left
-                        aTransform.translate(-aDiagonalDistance.getX(), -aDiagonalDistance.getY());
-                    }
-
-                    aTransform *= aForwardTransform;
-
-                    if(bDefaultTextColor)
-                    {
-                        // emboss/engrave in black, original forced to white
-                        const basegfx::BColorModifierSharedPtr aBColorModifierToGray =
-                            std::make_shared<basegfx::BColorModifier_replace>(
-                                basegfx::BColor(0.0));
-                        const Primitive2DReference xModifiedColor(
-                            new ModifiedColorPrimitive2D(
-                                getTextContent(),
-                                aBColorModifierToGray));
-
-                        rContainer.push_back(
-                            new TransformPrimitive2D(
-                                aTransform,
-                                Primitive2DContainer { xModifiedColor }));
-
-                        // add original, too
-                        const basegfx::BColorModifierSharedPtr aBColorModifierToWhite =
-                            std::make_shared<basegfx::BColorModifier_replace>(
-                                basegfx::BColor(1.0));
-
-                        rContainer.push_back(
-                            new ModifiedColorPrimitive2D(
-                                getTextContent(),
-                                aBColorModifierToWhite));
-                    }
-                    else
-                    {
-                        // emboss/engrave in gray, keep original's color
-                        const basegfx::BColorModifierSharedPtr aBColorModifierToGray =
-                            std::make_shared<basegfx::BColorModifier_replace>(
-                                basegfx::BColor(0.75)); // 192
-                        const Primitive2DReference xModifiedColor(
-                            new ModifiedColorPrimitive2D(
-                                getTextContent(),
-                                aBColorModifierToGray));
-
-                        rContainer.push_back(
-                            new TransformPrimitive2D(
-                                aTransform,
-                                Primitive2DContainer { xModifiedColor }));
-
-                        // add original, too
-                        rContainer.push_back(new GroupPrimitive2D(getTextContent()));
-                    }
-
-                    break;
-                }
-                case TextEffectStyle2D::Outline:
-                {
-                    // create transform primitives in all directions
-                    basegfx::B2DHomMatrix aTransform;
-
-                    aTransform.set(0, 2, aDistance.getX());
-                    aTransform.set(1, 2, 0.0);
-                    rContainer.push_back(new TransformPrimitive2D(aTransform, getTextContent()));
-
-                    aTransform.set(0, 2, aDiagonalDistance.getX());
-                    aTransform.set(1, 2, aDiagonalDistance.getY());
-                    rContainer.push_back(new TransformPrimitive2D(aTransform, getTextContent()));
-
-                    aTransform.set(0, 2, 0.0);
-                    aTransform.set(1, 2, aDistance.getY());
-                    rContainer.push_back(new TransformPrimitive2D(aTransform, getTextContent()));
-
-                    aTransform.set(0, 2, -aDiagonalDistance.getX());
-                    aTransform.set(1, 2, aDiagonalDistance.getY());
-                    rContainer.push_back(new TransformPrimitive2D(aTransform, getTextContent()));
-
-                    aTransform.set(0, 2, -aDistance.getX());
-                    aTransform.set(1, 2, 0.0);
-                    rContainer.push_back(new TransformPrimitive2D(aTransform, getTextContent()));
-
-                    aTransform.set(0, 2, -aDiagonalDistance.getX());
-                    aTransform.set(1, 2, -aDiagonalDistance.getY());
-                    rContainer.push_back(new TransformPrimitive2D(aTransform, getTextContent()));
-
-                    aTransform.set(0, 2, 0.0);
-                    aTransform.set(1, 2, -aDistance.getY());
-                    rContainer.push_back(new TransformPrimitive2D(aTransform, getTextContent()));
-
-                    aTransform.set(0, 2, aDiagonalDistance.getX());
-                    aTransform.set(1, 2, -aDiagonalDistance.getY());
-                    rContainer.push_back(new TransformPrimitive2D(aTransform, getTextContent()));
-
-                    // at last, place original over it, but force to white
-                    const basegfx::BColorModifierSharedPtr aBColorModifierToWhite =
-                        std::make_shared<basegfx::BColorModifier_replace>(
-                            basegfx::BColor(1.0, 1.0, 1.0));
-                    rContainer.push_back(
-                        new ModifiedColorPrimitive2D(
-                            getTextContent(),
-                            aBColorModifierToWhite));
-
-                    break;
-                }
+                // to bottom-right
+                aTransform.translate(aDiagonalDistance.getX(), aDiagonalDistance.getY());
+            }
+            else
+            {
+                // to top-left
+                aTransform.translate(-aDiagonalDistance.getX(), -aDiagonalDistance.getY());
             }
-        }
 
-        TextEffectPrimitive2D::TextEffectPrimitive2D(
-            const Primitive2DContainer& rTextContent,
-            const basegfx::B2DPoint& rRotationCenter,
-            double fDirection,
-            TextEffectStyle2D eTextEffectStyle2D)
-        :   BufferedDecompositionPrimitive2D(),
-            maTextContent(rTextContent),
-            maRotationCenter(rRotationCenter),
-            mfDirection(fDirection),
-            meTextEffectStyle2D(eTextEffectStyle2D)
-        {
-        }
+            aTransform *= aForwardTransform;
 
-        bool TextEffectPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
-        {
-            if(BasePrimitive2D::operator==(rPrimitive))
+            if (bDefaultTextColor)
             {
-                const TextEffectPrimitive2D& rCompare = static_cast<const TextEffectPrimitive2D&>(rPrimitive);
+                // emboss/engrave in black, original forced to white
+                const basegfx::BColorModifierSharedPtr aBColorModifierToGray
+                    = std::make_shared<basegfx::BColorModifier_replace>(basegfx::BColor(0.0));
+                const Primitive2DReference xModifiedColor(
+                    new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToGray));
 
-                return (getTextContent() == rCompare.getTextContent()
-                    && getRotationCenter() == rCompare.getRotationCenter()
-                    && getDirection() == rCompare.getDirection()
-                    && getTextEffectStyle2D() == rCompare.getTextEffectStyle2D());
+                rContainer.push_back(
+                    new TransformPrimitive2D(aTransform, Primitive2DContainer{ xModifiedColor }));
+
+                // add original, too
+                const basegfx::BColorModifierSharedPtr aBColorModifierToWhite
+                    = std::make_shared<basegfx::BColorModifier_replace>(basegfx::BColor(1.0));
+
+                rContainer.push_back(
+                    new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToWhite));
+            }
+            else
+            {
+                // emboss/engrave in gray, keep original's color
+                const basegfx::BColorModifierSharedPtr aBColorModifierToGray
+                    = std::make_shared<basegfx::BColorModifier_replace>(
+                        basegfx::BColor(0.75)); // 192
+                const Primitive2DReference xModifiedColor(
+                    new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToGray));
+
+                rContainer.push_back(
+                    new TransformPrimitive2D(aTransform, Primitive2DContainer{ xModifiedColor }));
+
+                // add original, too
+                rContainer.push_back(new GroupPrimitive2D(getTextContent()));
             }
 
-            return false;
+            break;
         }
-
-        basegfx::B2DRange TextEffectPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
+        case TextEffectStyle2D::Outline:
         {
-            // get range of content and grow by used fDiscreteSize. That way it is not necessary to ask
-            // the whole decomposition for its ranges (which may be expensive with outline mode which
-            // then will ask 9 times at nearly the same content. This may even be refined here using the
-            // TextEffectStyle information, e.g. for TEXTEFFECTSTYLE2D_RELIEF the grow needs only to
-            // be in two directions
-            basegfx::B2DRange aRetval(getTextContent().getB2DRange(rViewInformation));
-            aRetval.grow(fDiscreteSize);
-
-            return aRetval;
-        }
+            // create transform primitives in all directions
+            basegfx::B2DHomMatrix aTransform;
 
-        void TextEffectPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const
-        {
-            ::osl::MutexGuard aGuard( m_aMutex );
+            aTransform.set(0, 2, aDistance.getX());
+            aTransform.set(1, 2, 0.0);
+            rContainer.push_back(new TransformPrimitive2D(aTransform, getTextContent()));
 
-            if(!getBuffered2DDecomposition().empty())
-            {
-                if(maLastObjectToViewTransformation != rViewInformation.getObjectToViewTransformation())
-                {
-                    // conditions of last local decomposition have changed, delete
-                    const_cast< TextEffectPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DContainer());
-                }
-            }
+            aTransform.set(0, 2, aDiagonalDistance.getX());
+            aTransform.set(1, 2, aDiagonalDistance.getY());
+            rContainer.push_back(new TransformPrimitive2D(aTransform, getTextContent()));
 
-            if(getBuffered2DDecomposition().empty())
-            {
-                // remember ViewRange and ViewTransformation
-                const_cast< TextEffectPrimitive2D* >(this)->maLastObjectToViewTransformation = rViewInformation.getObjectToViewTransformation();
-            }
+            aTransform.set(0, 2, 0.0);
+            aTransform.set(1, 2, aDistance.getY());
+            rContainer.push_back(new TransformPrimitive2D(aTransform, getTextContent()));
+
+            aTransform.set(0, 2, -aDiagonalDistance.getX());
+            aTransform.set(1, 2, aDiagonalDistance.getY());
+            rContainer.push_back(new TransformPrimitive2D(aTransform, getTextContent()));
+
+            aTransform.set(0, 2, -aDistance.getX());
+            aTransform.set(1, 2, 0.0);
+            rContainer.push_back(new TransformPrimitive2D(aTransform, getTextContent()));
+
+            aTransform.set(0, 2, -aDiagonalDistance.getX());
+            aTransform.set(1, 2, -aDiagonalDistance.getY());
+            rContainer.push_back(new TransformPrimitive2D(aTransform, getTextContent()));
+
+            aTransform.set(0, 2, 0.0);
+            aTransform.set(1, 2, -aDistance.getY());
+            rContainer.push_back(new TransformPrimitive2D(aTransform, getTextContent()));
+
+            aTransform.set(0, 2, aDiagonalDistance.getX());
+            aTransform.set(1, 2, -aDiagonalDistance.getY());
+            rContainer.push_back(new TransformPrimitive2D(aTransform, getTextContent()));
+
+            // at last, place original over it, but force to white
+            const basegfx::BColorModifierSharedPtr aBColorModifierToWhite
+                = std::make_shared<basegfx::BColorModifier_replace>(basegfx::BColor(1.0, 1.0, 1.0));
+            rContainer.push_back(
+                new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToWhite));
+
+            break;
+        }
+    }
+}
+
+TextEffectPrimitive2D::TextEffectPrimitive2D(const Primitive2DContainer& rTextContent,
+                                             const basegfx::B2DPoint& rRotationCenter,
+                                             double fDirection,
+                                             TextEffectStyle2D eTextEffectStyle2D)
+    : BufferedDecompositionPrimitive2D()
+    , maTextContent(rTextContent)
+    , maRotationCenter(rRotationCenter)
+    , mfDirection(fDirection)
+    , meTextEffectStyle2D(eTextEffectStyle2D)
+{
+}
 
-            // use parent implementation
-            BufferedDecompositionPrimitive2D::get2DDecomposition(rVisitor, rViewInformation);
+bool TextEffectPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+{
+    if (BasePrimitive2D::operator==(rPrimitive))
+    {
+        const TextEffectPrimitive2D& rCompare
+            = static_cast<const TextEffectPrimitive2D&>(rPrimitive);
+
+        return (getTextContent() == rCompare.getTextContent()
+                && getRotationCenter() == rCompare.getRotationCenter()
+                && getDirection() == rCompare.getDirection()
+                && getTextEffectStyle2D() == rCompare.getTextEffectStyle2D());
+    }
+
+    return false;
+}
+
+basegfx::B2DRange
+TextEffectPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
+{
+    // get range of content and grow by used fDiscreteSize. That way it is not necessary to ask
+    // the whole decomposition for its ranges (which may be expensive with outline mode which
+    // then will ask 9 times at nearly the same content. This may even be refined here using the
+    // TextEffectStyle information, e.g. for TEXTEFFECTSTYLE2D_RELIEF the grow needs only to
+    // be in two directions
+    basegfx::B2DRange aRetval(getTextContent().getB2DRange(rViewInformation));
+    aRetval.grow(fDiscreteSize);
+
+    return aRetval;
+}
+
+void TextEffectPrimitive2D::get2DDecomposition(
+    Primitive2DDecompositionVisitor& rVisitor,
+    const geometry::ViewInformation2D& rViewInformation) const
+{
+    ::osl::MutexGuard aGuard(m_aMutex);
+
+    if (!getBuffered2DDecomposition().empty())
+    {
+        if (maLastObjectToViewTransformation != rViewInformation.getObjectToViewTransformation())
+        {
+            // conditions of last local decomposition have changed, delete
+            const_cast<TextEffectPrimitive2D*>(this)->setBuffered2DDecomposition(
+                Primitive2DContainer());
         }
+    }
+
+    if (getBuffered2DDecomposition().empty())
+    {
+        // remember ViewRange and ViewTransformation
+        const_cast<TextEffectPrimitive2D*>(this)->maLastObjectToViewTransformation
+            = rViewInformation.getObjectToViewTransformation();
+    }
+
+    // use parent implementation
+    BufferedDecompositionPrimitive2D::get2DDecomposition(rVisitor, rViewInformation);
+}
 
-        // provide unique ID
-        ImplPrimitive2DIDBlock(TextEffectPrimitive2D, PRIMITIVE2D_ID_TEXTEFFECTPRIMITIVE2D)
+// provide unique ID
+ImplPrimitive2DIDBlock(TextEffectPrimitive2D, PRIMITIVE2D_ID_TEXTEFFECTPRIMITIVE2D)
 
 } // end of namespace
 
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 8ad8b6592d2c..ba80759178eb 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -3623,7 +3623,6 @@ drawinglayer/inc/converters.hxx
 drawinglayer/inc/emfplushelper.hxx
 drawinglayer/inc/primitive2d/cropprimitive2d.hxx
 drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx
-drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
 drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
 drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
 drawinglayer/inc/primitive2d/wallpaperprimitive2d.hxx
@@ -3703,7 +3702,6 @@ drawinglayer/source/primitive2d/structuretagprimitive2d.cxx
 drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
 drawinglayer/source/primitive2d/textbreakuphelper.cxx
 drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
-drawinglayer/source/primitive2d/texteffectprimitive2d.cxx
 drawinglayer/source/primitive2d/textenumsprimitive2d.cxx
 drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx
 drawinglayer/source/primitive2d/textlayoutdevice.cxx


More information about the Libreoffice-commits mailing list