[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore2' - 4 commits - drawinglayer/Library_drawinglayer.mk drawinglayer/source include/drawinginterface include/drawinglayer include/svx include/vcl sc/source svx/source sw/source vcl/source

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 30 14:08:59 UTC 2021


 drawinglayer/Library_drawinglayer.mk                             |    1 
 drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx     |    2 
 drawinglayer/source/geometry/viewinformation2d.cxx               |  311 +++-------
 drawinglayer/source/primitive2d/Primitive2DContainer.cxx         |  123 ---
 drawinglayer/source/primitive2d/Tools.cxx                        |    6 
 drawinglayer/source/primitive2d/baseprimitive2d.cxx              |    4 
 drawinglayer/source/processor2d/baseprocessor2d.cxx              |    4 
 drawinglayer/source/processor2d/contourextractor2d.cxx           |    3 
 drawinglayer/source/processor2d/hittestprocessor2d.cxx           |    3 
 drawinglayer/source/processor2d/linegeometryextractor2d.cxx      |    3 
 drawinglayer/source/processor2d/textaspolygonextractor2d.cxx     |    3 
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx       |    6 
 drawinglayer/source/processor2d/vclprocessor2d.cxx               |    6 
 include/drawinginterface/BasicPrimitive2D.hxx                    |   26 
 include/drawinglayer/geometry/viewinformation2d.hxx              |   44 -
 include/drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx |    5 
 include/drawinglayer/primitive2d/Primitive2DContainer.hxx        |  115 +++
 include/svx/svdograf.hxx                                         |   13 
 include/svx/svdpage.hxx                                          |    2 
 include/svx/svdpagv.hxx                                          |   16 
 include/vcl/outdev.hxx                                           |    5 
 sc/source/ui/view/output.cxx                                     |    3 
 svx/source/dialog/pagectrl.cxx                                   |    3 
 svx/source/dialog/weldeditview.cxx                               |    3 
 svx/source/sdr/contact/objectcontact.cxx                         |    2 
 svx/source/sdr/contact/objectcontactofobjlistpainter.cxx         |    3 
 svx/source/sdr/contact/objectcontactofpageview.cxx               |    3 
 svx/source/sdr/contact/viewobjectcontactofpageobj.cxx            |    3 
 svx/source/sdr/overlay/overlaymanager.cxx                        |    5 
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx             |    3 
 sw/source/core/doc/notxtfrm.cxx                                  |    3 
 sw/source/core/layout/paintfrm.cxx                               |    6 
 vcl/source/outdev/outdev.cxx                                     |    5 
 33 files changed, 295 insertions(+), 448 deletions(-)

New commits:
commit dc6dc274fd438ef2e0aaebcfdc95c13c6d20309b
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri Jul 23 16:31:02 2021 +0900
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Fri Jul 30 23:08:12 2021 +0900

    drawinglayer: extract Prop. Value conversion from ViewInformation2D
    
    ViewInformation2D doesn't need to know anything about the Sequence
    of PropertyValue that is used for parameters when constructing it
    through UNO API. This can be done outside of ViewInfromation2D and
    it doesn't need to be responsible for that internally inside the
    ViewInformation2D. With this we get ViewInformation2D, which is much
    simpler and isn't prone to YAGNI.
    
    Change-Id: I3836237a1d26e38145b52136c3204931ae7c6b79

diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
index 63b4ffd6986d..98ca81433f12 100644
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
@@ -117,7 +117,7 @@ namespace drawinglayer::unorenderer
                         MaximumQuadraticPixels = 500000;
                     }
 
-                    const geometry::ViewInformation2D aViewInformation2D(aViewInformationSequence);
+                    const auto aViewInformation2D = geometry::createViewInformation2D(aViewInformationSequence);
                     const sal_uInt32 nDiscreteWidth(basegfx::fround(o3tl::convert(fWidth, eRangeUnit, o3tl::Length::in) * DPI_X));
                     const sal_uInt32 nDiscreteHeight(basegfx::fround(o3tl::convert(fHeight, eRangeUnit, o3tl::Length::in) * DPI_Y));
 
diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx b/drawinglayer/source/geometry/viewinformation2d.cxx
index 5b276cf52a59..6698f3b38b1f 100644
--- a/drawinglayer/source/geometry/viewinformation2d.cxx
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -84,162 +84,24 @@ protected:
     // Viewport, VisualizedPage or ViewTime
     uno::Sequence<beans::PropertyValue> mxExtendedInformation;
 
-    void impInterpretPropertyValues(const uno::Sequence<beans::PropertyValue>& rViewParameters)
-    {
-        if (!rViewParameters.hasElements())
-            return;
-
-        const sal_Int32 nCount(rViewParameters.getLength());
-        sal_Int32 nExtendedInsert(0);
-
-        // prepare extended information for filtering. Maximum size is nCount
-        mxExtendedInformation.realloc(nCount);
-
-        for (sal_Int32 a(0); a < nCount; a++)
-        {
-            const beans::PropertyValue& rProp = rViewParameters[a];
-
-            if (rProp.Name == g_PropertyName_ReducedDisplayQuality)
-            {
-                // extra information; add to filtered information
-                mxExtendedInformation[nExtendedInsert++] = rProp;
-
-                // for performance reasons, also cache content locally
-                bool bSalBool(false);
-                rProp.Value >>= bSalBool;
-                mbReducedDisplayQuality = bSalBool;
-            }
-            else if (rProp.Name == g_PropertyName_ObjectTransformation)
-            {
-                css::geometry::AffineMatrix2D aAffineMatrix2D;
-                rProp.Value >>= aAffineMatrix2D;
-                basegfx::unotools::homMatrixFromAffineMatrix(maObjectTransformation,
-                                                             aAffineMatrix2D);
-            }
-            else if (rProp.Name == g_PropertyName_ViewTransformation)
-            {
-                css::geometry::AffineMatrix2D aAffineMatrix2D;
-                rProp.Value >>= aAffineMatrix2D;
-                basegfx::unotools::homMatrixFromAffineMatrix(maViewTransformation, aAffineMatrix2D);
-            }
-            else if (rProp.Name == g_PropertyName_Viewport)
-            {
-                css::geometry::RealRectangle2D aViewport;
-                rProp.Value >>= aViewport;
-                maViewport = basegfx::unotools::b2DRectangleFromRealRectangle2D(aViewport);
-            }
-            else if (rProp.Name == g_PropertyName_Time)
-            {
-                rProp.Value >>= mfViewTime;
-            }
-            else if (rProp.Name == g_PropertyName_VisualizedPage)
-            {
-                rProp.Value >>= mxVisualizedPage;
-            }
-            else
-            {
-                // extra information; add to filtered information
-                mxExtendedInformation[nExtendedInsert++] = rProp;
-            }
-        }
-
-        // extra information size is now known; realloc to final size
-        mxExtendedInformation.realloc(nExtendedInsert);
-    }
-
-    void impFillViewInformationFromContent()
-    {
-        const bool bObjectTransformationUsed(!maObjectTransformation.isIdentity());
-        const bool bViewTransformationUsed(!maViewTransformation.isIdentity());
-        const bool bViewportUsed(!maViewport.isEmpty());
-        const bool bTimeUsed(0.0 < mfViewTime);
-        const bool bVisualizedPageUsed(mxVisualizedPage.is());
-        const bool bReducedDisplayQualityUsed(mbReducedDisplayQuality);
-        const bool bExtraInformation(mxExtendedInformation.hasElements());
-        sal_uInt32 nIndex(0);
-        const sal_uInt32 nCount((bObjectTransformationUsed ? 1 : 0)
-                                + (bViewTransformationUsed ? 1 : 0) + (bViewportUsed ? 1 : 0)
-                                + (bTimeUsed ? 1 : 0) + (bVisualizedPageUsed ? 1 : 0)
-                                + (bReducedDisplayQualityUsed ? 1 : 0)
-                                + (bExtraInformation ? mxExtendedInformation.getLength() : 0));
-
-        mxViewInformation.realloc(nCount);
-
-        if (bObjectTransformationUsed)
-        {
-            css::geometry::AffineMatrix2D aAffineMatrix2D;
-            basegfx::unotools::affineMatrixFromHomMatrix(aAffineMatrix2D, maObjectTransformation);
-            mxViewInformation[nIndex].Name = g_PropertyName_ObjectTransformation;
-            mxViewInformation[nIndex].Value <<= aAffineMatrix2D;
-            nIndex++;
-        }
-
-        if (bViewTransformationUsed)
-        {
-            css::geometry::AffineMatrix2D aAffineMatrix2D;
-            basegfx::unotools::affineMatrixFromHomMatrix(aAffineMatrix2D, maViewTransformation);
-            mxViewInformation[nIndex].Name = g_PropertyName_ViewTransformation;
-            mxViewInformation[nIndex].Value <<= aAffineMatrix2D;
-            nIndex++;
-        }
-
-        if (bViewportUsed)
-        {
-            const css::geometry::RealRectangle2D aViewport(
-                basegfx::unotools::rectangle2DFromB2DRectangle(maViewport));
-            mxViewInformation[nIndex].Name = g_PropertyName_Viewport;
-            mxViewInformation[nIndex].Value <<= aViewport;
-            nIndex++;
-        }
-
-        if (bTimeUsed)
-        {
-            mxViewInformation[nIndex].Name = g_PropertyName_Time;
-            mxViewInformation[nIndex].Value <<= mfViewTime;
-            nIndex++;
-        }
-
-        if (bVisualizedPageUsed)
-        {
-            mxViewInformation[nIndex].Name = g_PropertyName_VisualizedPage;
-            mxViewInformation[nIndex].Value <<= mxVisualizedPage;
-            nIndex++;
-        }
-
-        if (bExtraInformation)
-        {
-            const sal_Int32 nExtra(mxExtendedInformation.getLength());
-
-            for (sal_Int32 a(0); a < nExtra; a++)
-            {
-                mxViewInformation[nIndex++] = mxExtendedInformation[a];
-            }
-        }
-    }
-
 public:
     ImpViewInformation2D(const basegfx::B2DHomMatrix& rObjectTransformation,
                          const basegfx::B2DHomMatrix& rViewTransformation,
                          const basegfx::B2DRange& rViewport,
-                         const uno::Reference<drawing::XDrawPage>& rxDrawPage, double fViewTime)
+                         const uno::Reference<drawing::XDrawPage>& rxDrawPage, double fViewTime,
+                         bool bReducedDisplayQuality)
         : maObjectTransformation(rObjectTransformation)
         , maViewTransformation(rViewTransformation)
         , maViewport(rViewport)
         , mxVisualizedPage(rxDrawPage)
         , mfViewTime(fViewTime)
-        , mbReducedDisplayQuality(false)
+        , mbReducedDisplayQuality(bReducedDisplayQuality)
     {
     }
 
-    explicit ImpViewInformation2D(const uno::Sequence<beans::PropertyValue>& rViewParameters)
-        : mbReducedDisplayQuality(false)
-        , mxViewInformation(rViewParameters)
-    {
-        impInterpretPropertyValues(rViewParameters);
-    }
-
     ImpViewInformation2D()
-        : mbReducedDisplayQuality(false)
+        : mfViewTime(0.0)
+        , mbReducedDisplayQuality(false)
     {
     }
 
@@ -294,16 +156,6 @@ public:
 
     bool getReducedDisplayQuality() const { return mbReducedDisplayQuality; }
 
-    const uno::Sequence<beans::PropertyValue>& getViewInformationSequence() const
-    {
-        if (!mxViewInformation.hasElements())
-        {
-            const_cast<ImpViewInformation2D*>(this)->impFillViewInformationFromContent();
-        }
-
-        return mxViewInformation;
-    }
-
     bool operator==(const ImpViewInformation2D& rCandidate) const
     {
         return (maObjectTransformation == rCandidate.maObjectTransformation
@@ -325,14 +177,10 @@ ViewInformation2D::ViewInformation2D(const basegfx::B2DHomMatrix& rObjectTransfo
                                      const basegfx::B2DHomMatrix& rViewTransformation,
                                      const basegfx::B2DRange& rViewport,
                                      const uno::Reference<drawing::XDrawPage>& rxDrawPage,
-                                     double fViewTime)
+                                     double fViewTime, bool bReducedDisplayQuality)
     : mpViewInformation2D(ImpViewInformation2D(rObjectTransformation, rViewTransformation,
-                                               rViewport, rxDrawPage, fViewTime))
-{
-}
-
-ViewInformation2D::ViewInformation2D(const uno::Sequence<beans::PropertyValue>& rViewParameters)
-    : mpViewInformation2D(ImpViewInformation2D(rViewParameters))
+                                               rViewport, rxDrawPage, fViewTime,
+                                               bReducedDisplayQuality))
 {
 }
 
@@ -398,9 +246,119 @@ bool ViewInformation2D::getReducedDisplayQuality() const
     return mpViewInformation2D->getReducedDisplayQuality();
 }
 
-const uno::Sequence<beans::PropertyValue>& ViewInformation2D::getViewInformationSequence() const
+ViewInformation2D
+createViewInformation2D(const css::uno::Sequence<css::beans::PropertyValue>& rViewParameters)
 {
-    return mpViewInformation2D->getViewInformationSequence();
+    if (!rViewParameters.hasElements())
+        return ViewInformation2D();
+
+    bool bReducedDisplayQuality = false;
+    basegfx::B2DHomMatrix aObjectTransformation;
+    basegfx::B2DHomMatrix aViewTransformation;
+    basegfx::B2DRange aViewport;
+    double fViewTime = 0.0;
+    uno::Reference<drawing::XDrawPage> xVisualizedPage;
+
+    for (auto const& rPropertyValue : rViewParameters)
+    {
+        if (rPropertyValue.Name == g_PropertyName_ReducedDisplayQuality)
+        {
+            rPropertyValue.Value >>= bReducedDisplayQuality;
+        }
+        else if (rPropertyValue.Name == g_PropertyName_ObjectTransformation)
+        {
+            css::geometry::AffineMatrix2D aAffineMatrix2D;
+            rPropertyValue.Value >>= aAffineMatrix2D;
+            basegfx::unotools::homMatrixFromAffineMatrix(aObjectTransformation, aAffineMatrix2D);
+        }
+        else if (rPropertyValue.Name == g_PropertyName_ViewTransformation)
+        {
+            css::geometry::AffineMatrix2D aAffineMatrix2D;
+            rPropertyValue.Value >>= aAffineMatrix2D;
+            basegfx::unotools::homMatrixFromAffineMatrix(aViewTransformation, aAffineMatrix2D);
+        }
+        else if (rPropertyValue.Name == g_PropertyName_Viewport)
+        {
+            css::geometry::RealRectangle2D aUnoViewport;
+            rPropertyValue.Value >>= aUnoViewport;
+            aViewport = basegfx::unotools::b2DRectangleFromRealRectangle2D(aUnoViewport);
+        }
+        else if (rPropertyValue.Name == g_PropertyName_Time)
+        {
+            rPropertyValue.Value >>= fViewTime;
+        }
+        else if (rPropertyValue.Name == g_PropertyName_VisualizedPage)
+        {
+            rPropertyValue.Value >>= xVisualizedPage;
+        }
+    }
+
+    return ViewInformation2D(aObjectTransformation, aViewTransformation, aViewport, xVisualizedPage,
+                             fViewTime, bReducedDisplayQuality);
+}
+
+uno::Sequence<beans::PropertyValue>
+createPropertyValues(const ViewInformation2D& rViewInformation2D)
+{
+    const bool bObjectTransformationUsed(
+        !rViewInformation2D.getObjectTransformation().isIdentity());
+    const bool bViewTransformationUsed(!rViewInformation2D.getViewTransformation().isIdentity());
+    const bool bViewportUsed(!rViewInformation2D.getViewport().isEmpty());
+    const bool bTimeUsed(0.0 < rViewInformation2D.getViewTime());
+    const bool bVisualizedPageUsed(rViewInformation2D.getVisualizedPage().is());
+    const bool bReducedDisplayQualityUsed(rViewInformation2D.getReducedDisplayQuality());
+    uno::Sequence<beans::PropertyValue> aPropertyValues;
+
+    sal_uInt32 nIndex = 0;
+
+    const sal_uInt32 nCount((bObjectTransformationUsed ? 1 : 0) + (bViewTransformationUsed ? 1 : 0)
+                            + (bViewportUsed ? 1 : 0) + (bTimeUsed ? 1 : 0)
+                            + (bVisualizedPageUsed ? 1 : 0) + (bReducedDisplayQualityUsed ? 1 : 0));
+
+    aPropertyValues.realloc(nCount);
+
+    if (bObjectTransformationUsed)
+    {
+        css::geometry::AffineMatrix2D aAffineMatrix2D;
+        basegfx::unotools::affineMatrixFromHomMatrix(aAffineMatrix2D,
+                                                     rViewInformation2D.getObjectTransformation());
+        aPropertyValues[nIndex].Name = g_PropertyName_ObjectTransformation;
+        aPropertyValues[nIndex].Value <<= aAffineMatrix2D;
+        nIndex++;
+    }
+
+    if (bViewTransformationUsed)
+    {
+        css::geometry::AffineMatrix2D aAffineMatrix2D;
+        basegfx::unotools::affineMatrixFromHomMatrix(aAffineMatrix2D,
+                                                     rViewInformation2D.getViewTransformation());
+        aPropertyValues[nIndex].Name = g_PropertyName_ViewTransformation;
+        aPropertyValues[nIndex].Value <<= aAffineMatrix2D;
+        nIndex++;
+    }
+
+    if (bViewportUsed)
+    {
+        const css::geometry::RealRectangle2D aViewport(
+            basegfx::unotools::rectangle2DFromB2DRectangle(rViewInformation2D.getViewport()));
+        aPropertyValues[nIndex].Name = g_PropertyName_Viewport;
+        aPropertyValues[nIndex].Value <<= aViewport;
+        nIndex++;
+    }
+
+    if (bTimeUsed)
+    {
+        aPropertyValues[nIndex].Name = g_PropertyName_Time;
+        aPropertyValues[nIndex].Value <<= rViewInformation2D.getViewTime();
+        nIndex++;
+    }
+
+    if (bVisualizedPageUsed)
+    {
+        aPropertyValues[nIndex].Name = g_PropertyName_VisualizedPage;
+        aPropertyValues[nIndex].Value <<= rViewInformation2D.getVisualizedPage();
+        nIndex++;
+    }
 }
 
 } // end of namespace drawinglayer::geometry
diff --git a/drawinglayer/source/primitive2d/Tools.cxx b/drawinglayer/source/primitive2d/Tools.cxx
index 7db3a94c8d04..a6321cac1a89 100644
--- a/drawinglayer/source/primitive2d/Tools.cxx
+++ b/drawinglayer/source/primitive2d/Tools.cxx
@@ -47,10 +47,10 @@ getB2DRangeFromPrimitive2DReference(const Primitive2DReference& rCandidate,
         else
         {
             // use UNO API call instead
-            const uno::Sequence<beans::PropertyValue>& rViewParameters(
-                aViewInformation.getViewInformationSequence());
+            auto aViewParameters = geometry::createPropertyValues(aViewInformation);
+
             aRetval.expand(basegfx::unotools::b2DRectangleFromRealRectangle2D(
-                rCandidate->getRange(rViewParameters)));
+                rCandidate->getRange(aViewParameters)));
         }
     }
 
diff --git a/drawinglayer/source/primitive2d/baseprimitive2d.cxx b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
index c0f879ec2f78..61cd0923ad3d 100644
--- a/drawinglayer/source/primitive2d/baseprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
@@ -86,7 +86,7 @@ void BasePrimitive2D::get2DDecomposition(
 css::uno::Sequence<::css::uno::Reference<::css::graphic::XPrimitive2D>> SAL_CALL
 BasePrimitive2D::getDecomposition(const uno::Sequence<beans::PropertyValue>& rViewParameters)
 {
-    const geometry::ViewInformation2D aViewInformation(rViewParameters);
+    const auto aViewInformation = geometry::createViewInformation2D(rViewParameters);
     Primitive2DContainer aContainer;
     get2DDecomposition(aContainer, aViewInformation);
     return comphelper::containerToSequence(aContainer);
@@ -95,7 +95,7 @@ BasePrimitive2D::getDecomposition(const uno::Sequence<beans::PropertyValue>& rVi
 css::geometry::RealRectangle2D SAL_CALL
 BasePrimitive2D::getRange(const uno::Sequence<beans::PropertyValue>& rViewParameters)
 {
-    const geometry::ViewInformation2D aViewInformation(rViewParameters);
+    const auto aViewInformation = geometry::createViewInformation2D(rViewParameters);
     return basegfx::unotools::rectangle2DFromB2DRectangle(getB2DRange(aViewInformation));
 }
 
diff --git a/drawinglayer/source/processor2d/baseprocessor2d.cxx b/drawinglayer/source/processor2d/baseprocessor2d.cxx
index 9d1671dcf959..a7b079016747 100644
--- a/drawinglayer/source/processor2d/baseprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/baseprocessor2d.cxx
@@ -71,8 +71,8 @@ namespace drawinglayer::processor2d
                     else
                     {
                         // unknown implementation, use UNO API call instead and process recursively
-                        const uno::Sequence< beans::PropertyValue >& rViewParameters(getViewInformation2D().getViewInformationSequence());
-                        process(comphelper::sequenceToContainer<primitive2d::Primitive2DContainer>(xReference->getDecomposition(rViewParameters)));
+                        auto aViewParameters = geometry::createPropertyValues(getViewInformation2D());
+                        process(comphelper::sequenceToContainer<primitive2d::Primitive2DContainer>(xReference->getDecomposition(aViewParameters)));
                     }
                 }
             }
diff --git a/include/drawinglayer/geometry/viewinformation2d.hxx b/include/drawinglayer/geometry/viewinformation2d.hxx
index 20ef7c4de453..6903c628fe20 100644
--- a/include/drawinglayer/geometry/viewinformation2d.hxx
+++ b/include/drawinglayer/geometry/viewinformation2d.hxx
@@ -94,28 +94,13 @@ public:
         The time the view is defined for. Default is 0.0. This parameter is used e.g. for
         animated objects
 
-        @param rExtendedParameters
-        A sequence of property values which allows holding various other parameters besides
-        the obvious and needed ones above. For this constructor none of the other parameters
-        should be added as data. The constructor will parse the given parameters and if
-        data for the other parameters is given, the value in rExtendedParameters will
-        be preferred and overwrite the given parameter
+        @param rReducedDisplayQuality
     */
     ViewInformation2D(const basegfx::B2DHomMatrix& rObjectTransformation,
                       const basegfx::B2DHomMatrix& rViewTransformation,
                       const basegfx::B2DRange& rViewport,
                       const css::uno::Reference<css::drawing::XDrawPage>& rxDrawPage,
-                      double fViewTime);
-
-    /** Constructor: Create a ViewInformation2D
-
-        @param rViewParameters
-        A sequence of property values which allows holding any combination of local and various
-        other parameters. This constructor is fed completely with a sequence of PropertyValues
-        which will be parsed to be able to offer the most used ones in a convenient way.
-    */
-    explicit ViewInformation2D(
-        const css::uno::Sequence<css::beans::PropertyValue>& rViewParameters);
+                      double fViewTime, bool bReducedDisplayQuality = false);
 
     /// default (empty) constructor
     ViewInformation2D();
@@ -156,17 +141,13 @@ public:
         implementations of the primitives
      */
     bool getReducedDisplayQuality() const;
-
-    /** Get the uno::Sequence< beans::PropertyValue > which contains all ViewInformation
-
-        Use this call if You need to extract all contained ViewInformation. The ones
-        directly supported for convenience will be added to the ones only available
-        as PropertyValues. This set completely describes this ViewInformation2D and
-        can be used for complete information transport over UNO API.
-    */
-    const css::uno::Sequence<css::beans::PropertyValue>& getViewInformationSequence() const;
 };
 
+DRAWINGLAYER_DLLPUBLIC ViewInformation2D
+createViewInformation2D(const css::uno::Sequence<css::beans::PropertyValue>& rViewParameters);
+DRAWINGLAYER_DLLPUBLIC css::uno::Sequence<css::beans::PropertyValue>
+createPropertyValues(const ViewInformation2D& rViewInformation2D);
+
 } // end of namespace drawinglayer::geometry
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sdr/contact/objectcontact.cxx b/svx/source/sdr/contact/objectcontact.cxx
index ee623c062590..0754af17ba86 100644
--- a/svx/source/sdr/contact/objectcontact.cxx
+++ b/svx/source/sdr/contact/objectcontact.cxx
@@ -50,7 +50,7 @@ ObjectContact::ObjectContact()
 :   maViewObjectContactVector(),
     maPrimitiveAnimator(),
     mpViewObjectContactRedirector(nullptr),
-    maViewInformation2D(uno::Sequence< beans::PropertyValue >()),
+    maViewInformation2D(),
     mbIsPreviewRenderer(false)
 {
 }
diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx
index 5d145687b3e0..7a8e1a62bd2e 100644
--- a/svx/source/sdr/overlay/overlaymanager.cxx
+++ b/svx/source/sdr/overlay/overlaymanager.cxx
@@ -127,7 +127,7 @@ namespace sdr::overlay
             uno::Sequence< beans::PropertyValue > xProperties(1);
             xProperties[0].Name = "ReducedDisplayQuality";
             xProperties[0].Value <<= true;
-            maViewInformation2D = drawinglayer::geometry::ViewInformation2D(xProperties);
+            maViewInformation2D = drawinglayer::geometry::createViewInformation2D(xProperties);
         }
 
         rtl::Reference<OverlayManager> OverlayManager::create(OutputDevice& rOutputDevice)
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index 9d19dd35def3..e75ad0a3c6a5 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -446,8 +446,7 @@ basegfx::B2DRange getTextAnchorRange(const attribute::SdrTextAttribute& rText,
 
                     // create neutral geometry::ViewInformation2D for local range and decompose calls. This is okay
                     // since the decompose is view-independent
-                    const uno::Sequence< beans::PropertyValue > xViewParameters;
-                    geometry::ViewInformation2D aViewInformation2D(xViewParameters);
+                    geometry::ViewInformation2D aViewInformation2D;
 
                     // get range
                     const basegfx::B2DRange aScaledRange(pNew->getB2DRange(aViewInformation2D));
commit 16441cabd67b1c22c82dc59952b575dd16c10a6a
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Thu Jul 22 18:06:30 2021 +0900
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Fri Jul 30 23:08:12 2021 +0900

    drawinglayer: remove extendedInformation from ViewInformation2D
    
    We actually never use extended information when normally using
    the ViewInformation2D. The exception here is when we construct it
    from property values, where the unknown property values are then
    stored into the extended information sequence and then later
    reconstructed when we convert it back to a sequence of property
    values. Just for that case we don't neeed to expose the extended
    information to the outside and create it, as that is then a
    implementation detail for the UNO use case.
    
    I am also not convinced we need it when creating ViewInformation2D
    with the sequence of property values - it certantly not expected
    that we need to preserve the property values at all, but that is
    something that needs to be checked.
    
    Change-Id: I3b8d533cd412aac8b89ca2921738d6487be5cf45

diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx b/drawinglayer/source/geometry/viewinformation2d.cxx
index 5067a33f2f75..5b276cf52a59 100644
--- a/drawinglayer/source/geometry/viewinformation2d.cxx
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -221,51 +221,25 @@ public:
     ImpViewInformation2D(const basegfx::B2DHomMatrix& rObjectTransformation,
                          const basegfx::B2DHomMatrix& rViewTransformation,
                          const basegfx::B2DRange& rViewport,
-                         const uno::Reference<drawing::XDrawPage>& rxDrawPage, double fViewTime,
-                         const uno::Sequence<beans::PropertyValue>& rExtendedParameters)
+                         const uno::Reference<drawing::XDrawPage>& rxDrawPage, double fViewTime)
         : maObjectTransformation(rObjectTransformation)
         , maViewTransformation(rViewTransformation)
-        , maObjectToViewTransformation()
-        , maInverseObjectToViewTransformation()
         , maViewport(rViewport)
-        , maDiscreteViewport()
         , mxVisualizedPage(rxDrawPage)
         , mfViewTime(fViewTime)
         , mbReducedDisplayQuality(false)
-        , mxViewInformation()
-        , mxExtendedInformation()
     {
-        impInterpretPropertyValues(rExtendedParameters);
     }
 
     explicit ImpViewInformation2D(const uno::Sequence<beans::PropertyValue>& rViewParameters)
-        : maObjectTransformation()
-        , maViewTransformation()
-        , maObjectToViewTransformation()
-        , maInverseObjectToViewTransformation()
-        , maViewport()
-        , maDiscreteViewport()
-        , mxVisualizedPage()
-        , mfViewTime()
-        , mbReducedDisplayQuality(false)
+        : mbReducedDisplayQuality(false)
         , mxViewInformation(rViewParameters)
-        , mxExtendedInformation()
     {
         impInterpretPropertyValues(rViewParameters);
     }
 
     ImpViewInformation2D()
-        : maObjectTransformation()
-        , maViewTransformation()
-        , maObjectToViewTransformation()
-        , maInverseObjectToViewTransformation()
-        , maViewport()
-        , maDiscreteViewport()
-        , mxVisualizedPage()
-        , mfViewTime()
-        , mbReducedDisplayQuality(false)
-        , mxViewInformation()
-        , mxExtendedInformation()
+        : mbReducedDisplayQuality(false)
     {
     }
 
@@ -330,19 +304,13 @@ public:
         return mxViewInformation;
     }
 
-    const uno::Sequence<beans::PropertyValue>& getExtendedInformationSequence() const
-    {
-        return mxExtendedInformation;
-    }
-
     bool operator==(const ImpViewInformation2D& rCandidate) const
     {
         return (maObjectTransformation == rCandidate.maObjectTransformation
                 && maViewTransformation == rCandidate.maViewTransformation
                 && maViewport == rCandidate.maViewport
                 && mxVisualizedPage == rCandidate.mxVisualizedPage
-                && mfViewTime == rCandidate.mfViewTime
-                && mxExtendedInformation == rCandidate.mxExtendedInformation);
+                && mfViewTime == rCandidate.mfViewTime);
     }
 };
 
@@ -357,11 +325,9 @@ ViewInformation2D::ViewInformation2D(const basegfx::B2DHomMatrix& rObjectTransfo
                                      const basegfx::B2DHomMatrix& rViewTransformation,
                                      const basegfx::B2DRange& rViewport,
                                      const uno::Reference<drawing::XDrawPage>& rxDrawPage,
-                                     double fViewTime,
-                                     const uno::Sequence<beans::PropertyValue>& rExtendedParameters)
+                                     double fViewTime)
     : mpViewInformation2D(ImpViewInformation2D(rObjectTransformation, rViewTransformation,
-                                               rViewport, rxDrawPage, fViewTime,
-                                               rExtendedParameters))
+                                               rViewport, rxDrawPage, fViewTime))
 {
 }
 
@@ -437,11 +403,6 @@ const uno::Sequence<beans::PropertyValue>& ViewInformation2D::getViewInformation
     return mpViewInformation2D->getViewInformationSequence();
 }
 
-const uno::Sequence<beans::PropertyValue>& ViewInformation2D::getExtendedInformationSequence() const
-{
-    return mpViewInformation2D->getExtendedInformationSequence();
-}
-
 } // end of namespace drawinglayer::geometry
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/source/processor2d/contourextractor2d.cxx b/drawinglayer/source/processor2d/contourextractor2d.cxx
index 8abec2f50f9d..96250f59fa17 100644
--- a/drawinglayer/source/processor2d/contourextractor2d.cxx
+++ b/drawinglayer/source/processor2d/contourextractor2d.cxx
@@ -129,8 +129,7 @@ namespace drawinglayer::processor2d
                         getViewInformation2D().getViewTransformation(),
                         getViewInformation2D().getViewport(),
                         getViewInformation2D().getVisualizedPage(),
-                        getViewInformation2D().getViewTime(),
-                        getViewInformation2D().getExtendedInformationSequence());
+                        getViewInformation2D().getViewTime());
                     updateViewInformation(aViewInformation2D);
 
                     // process content
diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index 04505489c6f2..8e5dc31242e4 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -238,8 +238,7 @@ namespace drawinglayer::processor2d
                         getViewInformation2D().getViewTransformation(),
                         getViewInformation2D().getViewport(),
                         getViewInformation2D().getVisualizedPage(),
-                        getViewInformation2D().getViewTime(),
-                        getViewInformation2D().getExtendedInformationSequence());
+                        getViewInformation2D().getViewTime());
                     updateViewInformation(aViewInformation2D);
 
                     // process child content recursively
diff --git a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
index 9262e23e4509..9b7c9b62e90a 100644
--- a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
+++ b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
@@ -91,8 +91,7 @@ namespace drawinglayer::processor2d
                         getViewInformation2D().getViewTransformation(),
                         getViewInformation2D().getViewport(),
                         getViewInformation2D().getVisualizedPage(),
-                        getViewInformation2D().getViewTime(),
-                        getViewInformation2D().getExtendedInformationSequence());
+                        getViewInformation2D().getViewTime());
                     updateViewInformation(aViewInformation2D);
 
                     // process content
diff --git a/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
index e3a584f86172..82bc044e36f9 100644
--- a/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
+++ b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
@@ -182,8 +182,7 @@ namespace drawinglayer::processor2d
                         getViewInformation2D().getViewTransformation(),
                         getViewInformation2D().getViewport(),
                         getViewInformation2D().getVisualizedPage(),
-                        getViewInformation2D().getViewTime(),
-                        getViewInformation2D().getExtendedInformationSequence());
+                        getViewInformation2D().getViewTime());
                     updateViewInformation(aViewInformation2D);
 
                     // process content
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index f08d17f2f002..d60616d5be2c 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -2308,8 +2308,7 @@ void VclMetafileProcessor2D::processTransparencePrimitive2D(
             // except new transformation and range
             const geometry::ViewInformation2D aViewInfo(
                 getViewInformation2D().getObjectTransformation(), aViewTransform, aViewRange,
-                getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime(),
-                getViewInformation2D().getExtendedInformationSequence());
+                getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime());
 
             VclPixelProcessor2D aBufferProcessor(aViewInfo, *aBufferDevice);
 
@@ -2426,8 +2425,7 @@ VclMetafileProcessor2D::CreateBufferDevice(const basegfx::B2DRange& rCandidateRa
         // except new transformation and range
         rViewInfo = geometry::ViewInformation2D(
             getViewInformation2D().getObjectTransformation(), aViewTransform, aViewRange,
-            getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime(),
-            getViewInformation2D().getExtendedInformationSequence());
+            getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime());
     }
     else
         pBufferDevice.disposeAndClear();
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index bd6af1b27221..ed40fdb4ee23 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -905,8 +905,7 @@ void VclProcessor2D::RenderTransformPrimitive2D(
     const geometry::ViewInformation2D aViewInformation2D(
         getViewInformation2D().getObjectTransformation() * rTransformCandidate.getTransformation(),
         getViewInformation2D().getViewTransformation(), getViewInformation2D().getViewport(),
-        getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime(),
-        getViewInformation2D().getExtendedInformationSequence());
+        getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime());
     updateViewInformation(aViewInformation2D);
 
     // process content
@@ -928,8 +927,7 @@ void VclProcessor2D::RenderPagePreviewPrimitive2D(
     const geometry::ViewInformation2D aViewInformation2D(
         getViewInformation2D().getObjectTransformation(),
         getViewInformation2D().getViewTransformation(), getViewInformation2D().getViewport(),
-        rPagePreviewCandidate.getXDrawPage(), getViewInformation2D().getViewTime(),
-        getViewInformation2D().getExtendedInformationSequence());
+        rPagePreviewCandidate.getXDrawPage(), getViewInformation2D().getViewTime());
     updateViewInformation(aViewInformation2D);
 
     // process decomposed content
diff --git a/include/drawinglayer/geometry/viewinformation2d.hxx b/include/drawinglayer/geometry/viewinformation2d.hxx
index 95be29a72bda..20ef7c4de453 100644
--- a/include/drawinglayer/geometry/viewinformation2d.hxx
+++ b/include/drawinglayer/geometry/viewinformation2d.hxx
@@ -105,8 +105,7 @@ public:
                       const basegfx::B2DHomMatrix& rViewTransformation,
                       const basegfx::B2DRange& rViewport,
                       const css::uno::Reference<css::drawing::XDrawPage>& rxDrawPage,
-                      double fViewTime,
-                      const css::uno::Sequence<css::beans::PropertyValue>& rExtendedParameters);
+                      double fViewTime);
 
     /** Constructor: Create a ViewInformation2D
 
@@ -166,16 +165,6 @@ public:
         can be used for complete information transport over UNO API.
     */
     const css::uno::Sequence<css::beans::PropertyValue>& getViewInformationSequence() const;
-
-    /** Get the uno::Sequence< beans::PropertyValue > which contains only ViewInformation
-        not offered directly
-
-        Use this call if You only need ViewInformation which is not offered conveniently,
-        but only exists as PropertyValue. This is e.g. used to create partially updated
-        incarnations of ViewInformation2D without losing the only with PropertyValues
-        defined data. It does not contain a complete description.
-    */
-    const css::uno::Sequence<css::beans::PropertyValue>& getExtendedInformationSequence() const;
 };
 
 } // end of namespace drawinglayer::geometry
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 93b542b2c851..e02fde75aede 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -1721,8 +1721,7 @@ std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> ScOutputData::Create
             mpDev->GetViewTransformation(),
             aViewRange,
             GetXDrawPageForSdrPage( pDrawPage ),
-            0.0,
-            uno::Sequence< beans::PropertyValue >() );
+            0.0);
 
     return drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(
                     *mpDev, aNewViewInfos );
diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx
index 1fb9d0ae1464..028491bbbf78 100644
--- a/svx/source/dialog/pagectrl.cxx
+++ b/svx/source/dialog/pagectrl.cxx
@@ -358,8 +358,7 @@ void SvxPageWindow::drawFillAttributes(vcl::RenderContext& rRenderContext,
         return;
 
     const drawinglayer::geometry::ViewInformation2D aViewInformation2D(
-                    basegfx::B2DHomMatrix(), rRenderContext.GetViewTransformation(), aPaintRange, nullptr,
-                    0.0, css::uno::Sequence<css::beans::PropertyValue >());
+                    basegfx::B2DHomMatrix(), rRenderContext.GetViewTransformation(), aPaintRange, nullptr, 0.0);
 
     std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
         drawinglayer::processor2d::createProcessor2DFromOutputDevice(rRenderContext, aViewInformation2D));
diff --git a/svx/source/dialog/weldeditview.cxx b/svx/source/dialog/weldeditview.cxx
index 7059ada36320..0e31a3780e3e 100644
--- a/svx/source/dialog/weldeditview.cxx
+++ b/svx/source/dialog/weldeditview.cxx
@@ -236,8 +236,7 @@ void WeldEditView::DoPaint(vcl::RenderContext& rRenderContext, const tools::Rect
 
         const drawinglayer::geometry::ViewInformation2D aViewInformation2D(
             basegfx::B2DHomMatrix(), rRenderContext.GetViewTransformation(),
-            vcl::unotools::b2DRectangleFromRectangle(rRect), nullptr, 0.0,
-            css::uno::Sequence<css::beans::PropertyValue>());
+            vcl::unotools::b2DRectangleFromRectangle(rRect), nullptr, 0.0);
 
         std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> xProcessor(
             drawinglayer::processor2d::createProcessor2DFromOutputDevice(rRenderContext,
diff --git a/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx b/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
index 608a97ebd698..d59d320acb34 100644
--- a/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
+++ b/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
@@ -102,8 +102,7 @@ void ObjectContactOfObjListPainter::ProcessDisplay(DisplayInfo& rDisplayInfo)
         pTargetDevice->GetViewTransformation(),
         aViewRange,
         GetXDrawPageForSdrPage(const_cast< SdrPage* >(mpProcessedPage)),
-        0.0,
-        css::uno::Sequence<css::beans::PropertyValue>());
+        0.0);
     updateViewInformation2D(aNewViewInformation2D);
 
     // collect primitive data in a sequence; this will already use the updated ViewInformation2D
diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx
index 3a3c28b972f8..150735030ea5 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -213,8 +213,7 @@ namespace sdr::contact
                 rTargetOutDev.GetViewTransformation(),
                 aViewRange,
                 GetXDrawPageForSdrPage(GetSdrPage()),
-                fCurrentTime,
-                uno::Sequence<beans::PropertyValue>());
+                fCurrentTime);
             updateViewInformation2D(aNewViewInformation2D);
 
             drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence;
diff --git a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
index ad1d0bf87a9e..9e19982b7824 100644
--- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
@@ -137,8 +137,7 @@ drawinglayer::primitive2d::Primitive2DContainer PagePrimitiveExtractor::createPr
             basegfx::B2DRange(),
 
             GetXDrawPageForSdrPage(pStartPage),
-            0.0, // no time; page previews are not animated
-            rOriginalViewInformation.getExtendedInformationSequence());
+            0.0); // no time; page previews are not animated
         updateViewInformation2D(aNewViewInformation2D);
 
         // create copy of DisplayInfo to set PagePainting
diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx
index 6965b6a775a0..5d145687b3e0 100644
--- a/svx/source/sdr/overlay/overlaymanager.cxx
+++ b/svx/source/sdr/overlay/overlaymanager.cxx
@@ -162,8 +162,7 @@ namespace sdr::overlay
                     maViewTransformation,
                     aViewRange,
                     maViewInformation2D.getVisualizedPage(),
-                    maViewInformation2D.getViewTime(),
-                    maViewInformation2D.getExtendedInformationSequence());
+                    maViewInformation2D.getViewTime());
                 pThis->mfDiscreteOne = 0.0;
             }
 
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 2d19c61972f9..d95314b19961 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -900,8 +900,7 @@ static bool paintUsingPrimitivesHelper(
                 rOutputDevice.GetViewTransformation(),
                 rTargetRange,
                 nullptr,
-                0.0,
-                uno::Sequence< beans::PropertyValue >());
+                0.0);
 
             // get a primitive processor for rendering
             std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D(
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 0cf9c7fc7b26..0eead63a35f0 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1794,8 +1794,7 @@ bool DrawFillAttributes(
                     rOut.GetViewTransformation(),
                     aPaintRange,
                     nullptr,
-                    0.0,
-                    uno::Sequence< beans::PropertyValue >());
+                    0.0);
                 std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(drawinglayer::processor2d::createProcessor2DFromOutputDevice(
                     rOut,
                     aViewInformation2D) );
@@ -5129,8 +5128,7 @@ std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> SwFrame::CreateProce
             getRootFrame()->GetCurrShell()->GetOut()->GetViewTransformation(),
             aViewRange,
             GetXDrawPageForSdrPage( pDrawPage ),
-            0.0,
-            uno::Sequence< beans::PropertyValue >() );
+            0.0);
 
     return  drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(
                     *getRootFrame()->GetCurrShell()->GetOut(),
commit 101e0338633c4b1e7b94742342fd77f44f925600
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Jul 20 21:39:02 2021 +0900
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Fri Jul 30 23:08:11 2021 +0900

    svx: cleanup some forward decls, unneeded pragma once, whitespace
    
    Change-Id: I26cd723e0ffe907a7aa8cb4f73ba6bfbd6db5fbc

diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx
index bf7e329d5442..69ce11533caa 100644
--- a/include/svx/svdograf.hxx
+++ b/include/svx/svdograf.hxx
@@ -29,17 +29,8 @@
 #include <o3tl/typed_flags_set.hxx>
 #include <memory>
 
-namespace sdr
-{
-    namespace properties
-    {
-        class GraphicProperties;
-    } // end of namespace properties
-    namespace contact
-    {
-        class ViewObjectContactOfGraphic;
-    } // end of namespace contact
-} // end of namespace sdr
+namespace sdr::properties { class GraphicProperties; }
+namespace sdr::contact { class ViewObjectContactOfGraphic; }
 
 /**
  * Options for GetTransformedGraphic()
diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index d5552a7c72a4..fc6936a95282 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -64,7 +64,7 @@ private:
     SdrObjList(const SdrObjList& rSrcList) = delete;
     SdrObjList &operator=(const SdrObjList& rSrcList) = delete;
 
-    ::std::vector<SdrObject*>   maList;
+    std::vector<SdrObject*> maList;
 
     tools::Rectangle    maSdrObjListOutRect;
     tools::Rectangle    maSdrObjListSnapRect;
diff --git a/include/svx/svdpagv.hxx b/include/svx/svdpagv.hxx
index ab9bfa5625ae..3aceb48d1d4b 100644
--- a/include/svx/svdpagv.hxx
+++ b/include/svx/svdpagv.hxx
@@ -42,20 +42,16 @@ class SdrView;
 class SdrPageObj;
 class SdrPageView;
 
-namespace sdr
+namespace sdr::contact
 {
-    namespace contact
-    {
-        class ViewObjectContactRedirector;
-        class DisplayInfo;
-        class ViewObjectContactRedirector;
-    } // end of namespace contact
-} // end of namespace sdr
+    class ViewObjectContactRedirector;
+    class DisplayInfo;
+    class ViewObjectContactRedirector;
+}
 
 // typedefs for a list of SdrPageWindow
 class SdrPageWindow;
 
-
 class SVXCORE_DLLPUBLIC SdrPageView
 {
 private:
@@ -255,6 +251,4 @@ public:
     const Color& GetApplicationDocumentColor() const { return maDocumentColor;}
 };
 
-#pragma once
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 026f54afb16c87a84631f0b06de6bb2f2099eb9d
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri Jul 9 18:55:15 2021 +0900
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Fri Jul 30 23:07:51 2021 +0900

    drawinglayer: make Primitive2DConteiner header only
    
    Change-Id: I4755f97c32bea33a37ebc2b703a3e71a82508117

diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk
index 158ea62be0ac..ab11e449d398 100644
--- a/drawinglayer/Library_drawinglayer.mk
+++ b/drawinglayer/Library_drawinglayer.mk
@@ -112,7 +112,6 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
     drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D \
     drawinglayer/source/primitive2d/PolyPolygonSelectionPrimitive2D \
     drawinglayer/source/primitive2d/primitivetools2d \
-    drawinglayer/source/primitive2d/Primitive2DContainer \
     drawinglayer/source/primitive2d/sceneprimitive2d \
     drawinglayer/source/primitive2d/sdrdecompositiontools2d \
     drawinglayer/source/primitive2d/shadowprimitive2d \
diff --git a/drawinglayer/source/primitive2d/Primitive2DContainer.cxx b/drawinglayer/source/primitive2d/Primitive2DContainer.cxx
deleted file mode 100644
index 3ae4a9b3e3c4..000000000000
--- a/drawinglayer/source/primitive2d/Primitive2DContainer.cxx
+++ /dev/null
@@ -1,123 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <sal/config.h>
-
-#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
-#include <drawinglayer/primitive2d/Tools.hxx>
-#include <drawinglayer/geometry/viewinformation2d.hxx>
-
-using namespace css;
-
-namespace drawinglayer::primitive2d
-{
-Primitive2DContainer Primitive2DContainer::maybeInvert(bool bInvert) const
-{
-    const sal_uInt32 nSize(size());
-    Primitive2DContainer aRetval;
-
-    aRetval.resize(nSize);
-
-    for (sal_uInt32 a(0); a < nSize; a++)
-    {
-        aRetval[bInvert ? nSize - 1 - a : a] = (*this)[a];
-    }
-
-    // all entries taken over to Uno References as owners. To avoid
-    // errors with users of this mechanism to delete pointers to BasePrimitive2D
-    // itself, clear given vector
-    const_cast<Primitive2DContainer&>(*this).clear();
-
-    return aRetval;
-}
-
-// get B2DRange from a given Primitive2DSequence
-basegfx::B2DRange
-Primitive2DContainer::getB2DRange(const geometry::ViewInformation2D& aViewInformation) const
-{
-    basegfx::B2DRange aRetval;
-
-    if (!empty())
-    {
-        const sal_Int32 nCount(size());
-
-        for (sal_Int32 a(0); a < nCount; a++)
-        {
-            aRetval.expand(getB2DRangeFromPrimitive2DReference((*this)[a], aViewInformation));
-        }
-    }
-
-    return aRetval;
-}
-
-bool Primitive2DContainer::operator==(const Primitive2DContainer& rB) const
-{
-    const bool bAHasElements(!empty());
-
-    if (bAHasElements != !rB.empty())
-    {
-        return false;
-    }
-
-    if (!bAHasElements)
-    {
-        return true;
-    }
-
-    const size_t nCount(size());
-
-    if (nCount != rB.size())
-    {
-        return false;
-    }
-
-    for (size_t a(0); a < nCount; a++)
-    {
-        if (!arePrimitive2DReferencesEqual((*this)[a], rB[a]))
-        {
-            return false;
-        }
-    }
-
-    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());
-}
-
-void Primitive2DContainer::append(Primitive2DContainer&& rSource)
-{
-    this->insert(this->end(), std::make_move_iterator(rSource.begin()),
-                 std::make_move_iterator(rSource.end()));
-}
-
-void Primitive2DContainer::append(const Primitive2DSequence& rSource)
-{
-    this->insert(this->end(), rSource.begin(), rSource.end());
-}
-
-} // end of namespace drawinglayer::primitive2d
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinginterface/BasicPrimitive2D.hxx b/include/drawinginterface/BasicPrimitive2D.hxx
new file mode 100644
index 000000000000..b7ef8da101b8
--- /dev/null
+++ b/include/drawinginterface/BasicPrimitive2D.hxx
@@ -0,0 +1,26 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#pragma once
+
+namespace drawinginterface
+{
+class BasicPrimitive2D
+{
+public:
+};
+
+class PolyPolygonBasicPrimitive : public BasicPrimitive2D
+{
+public:
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx b/include/drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx
index c9acbb00dd30..a9d489311827 100644
--- a/include/drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx
+++ b/include/drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx
@@ -21,6 +21,7 @@
 
 #include <drawinglayer/drawinglayerdllapi.h>
 
+#include <drawinginterface/BasicPrimitive2D.hxx>
 #include <drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx>
 #include <basegfx/polygon/b2dpolypolygon.hxx>
 #include <basegfx/color/bcolor.hxx>
@@ -33,7 +34,9 @@ namespace drawinglayer::primitive2d
     This is one of the non-decomposable primitives, so a renderer
     should process it.
  */
-class DRAWINGLAYER_DLLPUBLIC PolyPolygonColorPrimitive2D final : public BasePrimitive2D
+class DRAWINGLAYER_DLLPUBLIC PolyPolygonColorPrimitive2D final
+    : public BasePrimitive2D,
+      public drawinginterface::PolyPolygonBasicPrimitive
 {
 private:
     /// the tools::PolyPolygon geometry
diff --git a/include/drawinglayer/primitive2d/Primitive2DContainer.hxx b/include/drawinglayer/primitive2d/Primitive2DContainer.hxx
index c62f960bd8d0..355f260f8229 100644
--- a/include/drawinglayer/primitive2d/Primitive2DContainer.hxx
+++ b/include/drawinglayer/primitive2d/Primitive2DContainer.hxx
@@ -19,24 +19,17 @@
 
 #pragma once
 
-#include <drawinglayer/drawinglayerdllapi.h>
-
 #include <drawinglayer/primitive2d/CommonTypes.hxx>
 #include <drawinglayer/primitive2d/Primitive2DVisitor.hxx>
-
+#include <drawinglayer/primitive2d/Tools.hxx>
+#include <drawinglayer/geometry/viewinformation2d.hxx>
 #include <basegfx/range/b2drange.hxx>
 #include <deque>
 
-namespace drawinglayer::geometry
-{
-class ViewInformation2D;
-}
-
 namespace drawinglayer::primitive2d
 {
-class SAL_WARN_UNUSED DRAWINGLAYER_DLLPUBLIC Primitive2DContainer final
-    : public std::deque<Primitive2DReference>,
-      public Primitive2DDecompositionVisitor
+class SAL_WARN_UNUSED Primitive2DContainer final : public std::deque<Primitive2DReference>,
+                                                   public Primitive2DDecompositionVisitor
 {
 public:
     // use zero because we allocate a lot of empty containers
@@ -48,7 +41,9 @@ public:
         : deque(count)
     {
     }
-    virtual ~Primitive2DContainer() override;
+
+    ~Primitive2DContainer() override {}
+
     Primitive2DContainer(const Primitive2DContainer& other)
         : deque(other)
     {
@@ -65,16 +60,31 @@ public:
         : deque(init)
     {
     }
+
     template <class Iter>
     Primitive2DContainer(Iter first, Iter last)
         : deque(first, last)
     {
     }
 
-    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(const Primitive2DSequence& rSource)
+    {
+        this->insert(this->end(), rSource.begin(), rSource.end());
+    }
+
+    void append(const Primitive2DReference& rSource) override { push_back(rSource); }
+
+    void append(const Primitive2DContainer& rSource) override
+    {
+        insert(end(), rSource.begin(), rSource.end());
+    }
+
+    void append(Primitive2DContainer&& rSource) override
+    {
+        this->insert(this->end(), std::make_move_iterator(rSource.begin()),
+                     std::make_move_iterator(rSource.end()));
+    }
+
     Primitive2DContainer& operator=(const Primitive2DContainer& r)
     {
         deque::operator=(r);
@@ -85,10 +95,77 @@ public:
         deque::operator=(std::move(r));
         return *this;
     }
-    bool operator==(const Primitive2DContainer& rB) const;
+
+    bool operator==(const Primitive2DContainer& rB) const
+    {
+        const bool bAHasElements(!empty());
+
+        if (bAHasElements != !rB.empty())
+        {
+            return false;
+        }
+
+        if (!bAHasElements)
+        {
+            return true;
+        }
+
+        const size_t nCount(size());
+
+        if (nCount != rB.size())
+        {
+            return false;
+        }
+
+        for (size_t a(0); a < nCount; a++)
+        {
+            if (!arePrimitive2DReferencesEqual((*this)[a], rB[a]))
+            {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
     bool operator!=(const Primitive2DContainer& rB) const { return !operator==(rB); }
-    basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& aViewInformation) const;
-    Primitive2DContainer maybeInvert(bool bInvert = false) const;
+
+    basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& aViewInformation) const
+    {
+        basegfx::B2DRange aRetval;
+
+        if (!empty())
+        {
+            const sal_Int32 nCount(size());
+
+            for (sal_Int32 a(0); a < nCount; a++)
+            {
+                aRetval.expand(getB2DRangeFromPrimitive2DReference((*this)[a], aViewInformation));
+            }
+        }
+
+        return aRetval;
+    }
+
+    Primitive2DContainer maybeInvert(bool bInvert = false) const
+    {
+        const sal_uInt32 nSize(size());
+        Primitive2DContainer aRetval;
+
+        aRetval.resize(nSize);
+
+        for (sal_uInt32 a(0); a < nSize; a++)
+        {
+            aRetval[bInvert ? nSize - 1 - a : a] = (*this)[a];
+        }
+
+        // all entries taken over to Uno References as owners. To avoid
+        // errors with users of this mechanism to delete pointers to BasePrimitive2D
+        // itself, clear given vector
+        const_cast<Primitive2DContainer&>(*this).clear();
+
+        return aRetval;
+    }
 };
 
 } // end of namespace drawinglayer::primitive2d
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index fce10e1ef077..c764ad08369d 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -59,6 +59,8 @@
 #include <com/sun/star/uno/Reference.h>
 #include <com/sun/star/awt/DeviceInfo.hpp>
 
+#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
+
 #include <memory>
 #include <vector>
 
@@ -1833,6 +1835,9 @@ public:
     ///@}
 
 
+    bool drawPrimitive2D(drawinglayer::primitive2d::Primitive2DContainer & rPrimitive2D);
+
+
     /** @name Native Widget Rendering functions
 
         These all just call through to the private mpGraphics functions of the same name.
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index 71ec101f4dd1..6e2c0f480c7d 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -807,6 +807,11 @@ com::sun::star::uno::Reference< css::rendering::XCanvas > OutputDevice::ImplGetC
     return xCanvas;
 }
 
+bool OutputDevice::drawPrimitive2D(drawinglayer::primitive2d::Primitive2DContainer & rPrimitive2D)
+{
+    return false;
+}
+
 void OutputDevice::ImplDisposeCanvas()
 {
     css::uno::Reference< css::rendering::XCanvas > xCanvas( mxCanvas );


More information about the Libreoffice-commits mailing list