[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - 87 commits - chart2/source comphelper/source compilerplugins/clang connectivity/source cui/source dbaccess/source desktop/inc desktop/qa desktop/source drawinglayer/CppunitTest_drawinglayer_border.mk drawinglayer/inc drawinglayer/Library_drawinglayercore.mk drawinglayer/Library_drawinglayer.mk drawinglayer/Module_drawinglayer.mk drawinglayer/source dtrans/source editeng/inc embeddedobj/source embedserv/source emfio/CppunitTest_emfio_emf_test.mk emfio/Library_emfio.mk emfio/source extensions/source filter/Library_pdffilter.mk filter/Library_svgfilter.mk filter/source forms/source framework/inc framework/source helpcontent2 i18npool/inc include/drawinglayer include/LibreOfficeKit include/oox include/unotools include/vcl include/xmloff javaunohelper/source libreofficekit/source lingucomponent/source linguistic/source linguistic/workben offapi/com officecfg/registry officecfg/util oox/inc oox/source package/inc package/source reportd esign/inc reportdesign/source Repository.mk sc/CppunitTest_sc_ucalc.mk sc/inc sc/IwyuFilter_sc.yaml sc/Library_sc.mk sc/qa sc/source sd/CppunitTest_sd_uimpress.mk sdext/source sd/inc sd/Library_sd.mk sd/qa sd/source sd/workben sd/xml sfx2/Library_sfx.mk sfx2/source slideshow/opengl slideshow/source solenv/clang-format svgio/CppunitTest_svgio.mk svgio/Library_svgio.mk svl/qa svx/CppunitTest_svx_unit.mk svx/inc svx/Library_svxcore.mk svx/Library_svx.mk svx/source sw/CppunitTest_sw_uwriter.mk sw/inc sw/Library_sw.mk sw/Library_swui.mk sw/qa sw/source sw/uiconfig toolkit/inc toolkit/source vcl/CppunitTest_vcl_graphic_test.mk vcl/Library_vcl.mk vcl/qa vcl/qt5 vcl/source vcl/unx winaccessibility/source writerfilter/source xmloff/source

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Sat May 9 19:17:49 UTC 2020


Rebased ref, commits from common ancestor:
commit 1901bd58d347cd955b5f0cad0fa13cf5ffbfab48
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 22:28:35 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat May 9 21:17:00 2020 +0200

    Move some basic primitives to drawinglayer CORE
    
    Mostly which are easy to move and used in VclProcessor2D
    
    Change-Id: Ie1559e13a2a7cdb5225421def2f9145026ff9121

diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk
index 46f21f56b6b6..bb12485b8a06 100644
--- a/drawinglayer/Library_drawinglayer.mk
+++ b/drawinglayer/Library_drawinglayer.mk
@@ -50,11 +50,6 @@ $(eval $(call gb_Library_use_libraries,drawinglayer,\
 $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
     drawinglayer/source/animation/animationtiming \
     drawinglayer/source/attribute/fillgraphicattribute \
-    drawinglayer/source/attribute/fillgradientattribute \
-    drawinglayer/source/attribute/fillhatchattribute \
-    drawinglayer/source/attribute/fontattribute \
-    drawinglayer/source/attribute/lineattribute \
-    drawinglayer/source/attribute/linestartendattribute \
     drawinglayer/source/attribute/materialattribute3d \
     drawinglayer/source/attribute/sdrallattribute3d \
     drawinglayer/source/attribute/sdrfillattribute \
@@ -67,11 +62,9 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
     drawinglayer/source/attribute/sdrobjectattribute3d \
     drawinglayer/source/attribute/sdrsceneattribute3d \
     drawinglayer/source/attribute/sdrshadowattribute \
-    drawinglayer/source/attribute/strokeattribute \
     drawinglayer/source/geometry/viewinformation3d \
     drawinglayer/source/primitive2d/animatedprimitive2d \
     drawinglayer/source/primitive2d/backgroundcolorprimitive2d \
-    drawinglayer/source/primitive2d/bitmapprimitive2d \
     drawinglayer/source/primitive2d/borderlineprimitive2d \
     drawinglayer/source/primitive2d/controlprimitive2d \
     drawinglayer/source/primitive2d/cropprimitive2d \
@@ -80,53 +73,31 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
     drawinglayer/source/primitive2d/embedded3dprimitive2d \
     drawinglayer/source/primitive2d/epsprimitive2d \
     drawinglayer/source/primitive2d/fillgraphicprimitive2d \
-    drawinglayer/source/primitive2d/fillgradientprimitive2d \
-    drawinglayer/source/primitive2d/fillhatchprimitive2d \
     drawinglayer/source/primitive2d/glowprimitive2d \
     drawinglayer/source/primitive2d/graphicprimitivehelper2d \
     drawinglayer/source/primitive2d/graphicprimitive2d \
     drawinglayer/source/primitive2d/gridprimitive2d \
-    drawinglayer/source/primitive2d/groupprimitive2d \
     drawinglayer/source/primitive2d/helplineprimitive2d \
     drawinglayer/source/primitive2d/hiddengeometryprimitive2d \
     drawinglayer/source/primitive2d/invertprimitive2d \
     drawinglayer/source/primitive2d/markerarrayprimitive2d \
-    drawinglayer/source/primitive2d/maskprimitive2d \
     drawinglayer/source/primitive2d/mediaprimitive2d \
     drawinglayer/source/primitive2d/metafileprimitive2d \
-    drawinglayer/source/primitive2d/modifiedcolorprimitive2d \
-    drawinglayer/source/primitive2d/objectinfoprimitive2d \
     drawinglayer/source/primitive2d/pagehierarchyprimitive2d \
-    drawinglayer/source/primitive2d/pagepreviewprimitive2d \
     drawinglayer/source/primitive2d/patternfillprimitive2d \
-    drawinglayer/source/primitive2d/pointarrayprimitive2d \
-    drawinglayer/source/primitive2d/polygonprimitive2d \
-    drawinglayer/source/primitive2d/PolyPolygonHairlinePrimitive2D \
-    drawinglayer/source/primitive2d/PolyPolygonMarkerPrimitive2D \
-    drawinglayer/source/primitive2d/PolyPolygonStrokePrimitive2D \
-    drawinglayer/source/primitive2d/PolyPolygonColorPrimitive2D \
-    drawinglayer/source/primitive2d/PolyPolygonGradientPrimitive2D \
-    drawinglayer/source/primitive2d/PolyPolygonHatchPrimitive2D \
     drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D \
-    drawinglayer/source/primitive2d/PolyPolygonSelectionPrimitive2D \
-    drawinglayer/source/primitive2d/primitivetools2d \
     drawinglayer/source/primitive2d/sceneprimitive2d \
     drawinglayer/source/primitive2d/sdrdecompositiontools2d \
     drawinglayer/source/primitive2d/shadowprimitive2d \
     drawinglayer/source/primitive2d/structuretagprimitive2d \
-    drawinglayer/source/primitive2d/svggradientprimitive2d \
     drawinglayer/source/primitive2d/textbreakuphelper \
     drawinglayer/source/primitive2d/textdecoratedprimitive2d \
     drawinglayer/source/primitive2d/texteffectprimitive2d \
-    drawinglayer/source/primitive2d/textenumsprimitive2d \
     drawinglayer/source/primitive2d/texthierarchyprimitive2d \
     drawinglayer/source/primitive2d/textlayoutdevice \
     drawinglayer/source/primitive2d/textlineprimitive2d \
     drawinglayer/source/primitive2d/textprimitive2d \
     drawinglayer/source/primitive2d/textstrikeoutprimitive2d \
-    drawinglayer/source/primitive2d/transformprimitive2d \
-    drawinglayer/source/primitive2d/transparenceprimitive2d \
-    drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d \
     drawinglayer/source/primitive2d/wallpaperprimitive2d \
     drawinglayer/source/primitive2d/wrongspellprimitive2d \
     drawinglayer/source/primitive3d/baseprimitive3d \
@@ -185,7 +156,6 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
     drawinglayer/source/tools/primitive2dxmldump \
     drawinglayer/source/drawinglayeruno/drawinglayeruno \
     drawinglayer/source/drawinglayeruno/xprimitive2drenderer \
-    drawinglayer/source/texture/texture \
     drawinglayer/source/dumper/XShapeDumper \
     drawinglayer/source/dumper/EnhancedShapeDumper \
 ))
diff --git a/drawinglayer/Library_drawinglayercore.mk b/drawinglayer/Library_drawinglayercore.mk
index f1643d27014d..972ac32f5388 100644
--- a/drawinglayer/Library_drawinglayercore.mk
+++ b/drawinglayer/Library_drawinglayercore.mk
@@ -40,10 +40,47 @@ $(eval $(call gb_Library_use_libraries,drawinglayercore,\
 ))
 
 $(eval $(call gb_Library_add_exception_objects,drawinglayercore,\
+    drawinglayer/source/attribute/lineattribute \
+    drawinglayer/source/attribute/strokeattribute \
+    drawinglayer/source/attribute/linestartendattribute \
+    drawinglayer/source/attribute/fillgradientattribute \
+    drawinglayer/source/attribute/fillhatchattribute \
+    drawinglayer/source/attribute/fontattribute \
+    drawinglayer/source/geometry/viewinformation2d \
+    drawinglayer/source/texture/texture \
     drawinglayer/source/primitive2d/baseprimitive2d \
     drawinglayer/source/primitive2d/Primitive2DContainer \
     drawinglayer/source/primitive2d/Tools \
-    drawinglayer/source/geometry/viewinformation2d \
+    drawinglayer/source/primitive2d/polygonprimitive2d \
+    drawinglayer/source/primitive2d/PolyPolygonColorPrimitive2D \
+    drawinglayer/source/primitive2d/PolyPolygonHairlinePrimitive2D \
+    drawinglayer/source/primitive2d/PolyPolygonMarkerPrimitive2D \
+    drawinglayer/source/primitive2d/PolyPolygonStrokePrimitive2D \
+    drawinglayer/source/primitive2d/PolyPolygonGradientPrimitive2D \
+    drawinglayer/source/primitive2d/PolyPolygonHatchPrimitive2D \
+    drawinglayer/source/primitive2d/PolyPolygonSelectionPrimitive2D \
+    drawinglayer/source/primitive2d/fillgradientprimitive2d \
+    drawinglayer/source/primitive2d/maskprimitive2d \
+    drawinglayer/source/primitive2d/groupprimitive2d \
+    drawinglayer/source/primitive2d/fillhatchprimitive2d \
+    drawinglayer/source/primitive2d/primitivetools2d \
+    drawinglayer/source/primitive2d/pointarrayprimitive2d \
+    drawinglayer/source/primitive2d/modifiedcolorprimitive2d \
+    drawinglayer/source/primitive2d/bitmapprimitive2d \
+    drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d \
+    drawinglayer/source/primitive2d/transparenceprimitive2d \
+    drawinglayer/source/primitive2d/pagepreviewprimitive2d \
+    drawinglayer/source/primitive2d/transformprimitive2d \
+    drawinglayer/source/primitive2d/svggradientprimitive2d \
+    drawinglayer/source/primitive2d/objectinfoprimitive2d \
+    drawinglayer/source/primitive2d/textenumsprimitive2d \
 ))
 
+#    drawinglayer/source/primitive2d/epsprimitive2d \
+#    drawinglayer/source/primitive2d/markerarrayprimitive2d \
+#    drawinglayer/source/primitive2d/fillgraphicprimitive2d \
+#    drawinglayer/source/primitive2d/textdecoratedprimitive2d \
+#    drawinglayer/source/primitive2d/textprimitive2d \
+
+
 # vim: set noet sw=4 ts=4:
diff --git a/filter/Library_pdffilter.mk b/filter/Library_pdffilter.mk
index 9694490655de..9320e3648724 100644
--- a/filter/Library_pdffilter.mk
+++ b/filter/Library_pdffilter.mk
@@ -49,6 +49,7 @@ $(eval $(call gb_Library_use_libraries,pdffilter,\
 	cppuhelper \
 	cppu \
 	sal \
+	drawinglayercore \
 	drawinglayer \
 ))
 
commit 9df4cefdeede41d844cc5cb556499759aba5dc3b
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 21:49:50 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat May 9 21:17:00 2020 +0200

    drawinglayer: clean-up namespaces in textprimitive2d.hxx
    
    Change-Id: I2610cfeb7e1104440b19f53987bee542eefcf989

diff --git a/include/drawinglayer/primitive2d/textprimitive2d.hxx b/include/drawinglayer/primitive2d/textprimitive2d.hxx
index ad14cb075496..22ff79a69d6e 100644
--- a/include/drawinglayer/primitive2d/textprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/textprimitive2d.hxx
@@ -32,10 +32,8 @@
 #include <basegfx/polygon/b2dpolypolygon.hxx>
 
 
-namespace drawinglayer
+namespace drawinglayer::primitive2d
 {
-    namespace primitive2d
-    {
         /** TextSimplePortionPrimitive2D class
 
             This is the basic primitive for representing a text portion. It contains
@@ -181,8 +179,7 @@ namespace drawinglayer
         /// small helper to have a compare operator for Locale
         bool DRAWINGLAYER_DLLPUBLIC LocalesAreEqual(const css::lang::Locale& rA, const css::lang::Locale& rB);
 
-    } // end of namespace primitive2d
-} // end of namespace drawinglayer
+} // end of namespace drawinglayer::primitive2d
 
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit baff2d5bbc30c55595bd130d6ab370c21d7b82c0
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 20:50:29 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat May 9 21:17:00 2020 +0200

    drawinglayer: externalize PointArrayPrimitive2D class
    
    Change-Id: I8ee993947bf2f4437cf3a429c43a81132fac0947

diff --git a/include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx b/include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
index 613b8969828d..682132218411 100644
--- a/include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
@@ -39,7 +39,7 @@ namespace drawinglayer::primitive2d
             should process it (Currently it is only used for grid visualisation,
             but this may change).
          */
-        class PointArrayPrimitive2D final : public BasePrimitive2D
+        class DRAWINGLAYER_DLLPUBLIC PointArrayPrimitive2D final : public BasePrimitive2D
         {
         private:
             /// the array of positions
commit 08d198f4a06d4cce82e1cf68f9fea83897e0141a
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 20:48:49 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat May 9 21:17:00 2020 +0200

    drawinglayer: clean-up namespaces in pointarrayprimitive2d.hxx
    
    Change-Id: Iacb90d8845cd39997eab4086dd77aeb6d4b1f607

diff --git a/include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx b/include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
index e83220df1726..613b8969828d 100644
--- a/include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
@@ -27,10 +27,8 @@
 
 // PointArrayPrimitive2D class
 
-namespace drawinglayer
+namespace drawinglayer::primitive2d
 {
-    namespace primitive2d
-    {
         /** PointArrayPrimitive2D class
 
             This primitive defines single,discrete 'pixels' for the given
@@ -72,8 +70,7 @@ namespace drawinglayer
             /// provide unique ID
             virtual sal_uInt32 getPrimitive2DID() const override;
         };
-    } // end of namespace primitive2d
-} // end of namespace drawinglayer
+} // end of namespace drawinglayer::primitive2d
 
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 77b6b9dc12eb55bfeb981f6ea27f3d15677a05c1
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 20:43:38 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat May 9 21:17:00 2020 +0200

    drawinglayer: externalize classes in texture.hxx
    
    Change-Id: I1e49a6c896733ebebf16db23f3c2f8b06161d659

diff --git a/drawinglayer/inc/texture/texture.hxx b/drawinglayer/inc/texture/texture.hxx
index 24e23a4b241c..b34bde38d1bc 100644
--- a/drawinglayer/inc/texture/texture.hxx
+++ b/drawinglayer/inc/texture/texture.hxx
@@ -30,7 +30,7 @@
 
 namespace drawinglayer::texture
 {
-        class GeoTexSvx
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvx
         {
         public:
             GeoTexSvx();
@@ -53,7 +53,7 @@ namespace drawinglayer::texture
             basegfx::BColor         maBColor;
         };
 
-        class GeoTexSvxGradient : public GeoTexSvx
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradient : public GeoTexSvx
         {
         protected:
             basegfx::ODFGradientInfo            maGradientInfo;
@@ -79,7 +79,7 @@ namespace drawinglayer::texture
                 basegfx::BColor& rOuterColor) = 0;
         };
 
-        class GeoTexSvxGradientLinear final : public GeoTexSvxGradient
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientLinear final : public GeoTexSvxGradient
         {
             double                  mfUnitMinX;
             double                  mfUnitWidth;
@@ -102,7 +102,7 @@ namespace drawinglayer::texture
             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
         };
 
-        class GeoTexSvxGradientAxial final : public GeoTexSvxGradient
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientAxial final : public GeoTexSvxGradient
         {
             double                  mfUnitMinX;
             double                  mfUnitWidth;
@@ -124,7 +124,7 @@ namespace drawinglayer::texture
             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
         };
 
-        class GeoTexSvxGradientRadial final : public GeoTexSvxGradient
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientRadial final : public GeoTexSvxGradient
         {
         public:
             GeoTexSvxGradientRadial(
@@ -143,7 +143,7 @@ namespace drawinglayer::texture
             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
         };
 
-        class GeoTexSvxGradientElliptical final : public GeoTexSvxGradient
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientElliptical final : public GeoTexSvxGradient
         {
         public:
             GeoTexSvxGradientElliptical(
@@ -163,7 +163,7 @@ namespace drawinglayer::texture
             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
         };
 
-        class GeoTexSvxGradientSquare final : public GeoTexSvxGradient
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientSquare final : public GeoTexSvxGradient
         {
         public:
             GeoTexSvxGradientSquare(
@@ -183,7 +183,7 @@ namespace drawinglayer::texture
             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
         };
 
-        class GeoTexSvxGradientRect final : public GeoTexSvxGradient
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientRect final : public GeoTexSvxGradient
         {
         public:
             GeoTexSvxGradientRect(
@@ -203,7 +203,7 @@ namespace drawinglayer::texture
             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
         };
 
-        class GeoTexSvxHatch final : public GeoTexSvx
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxHatch final : public GeoTexSvx
         {
             basegfx::B2DRange                   maOutputRange;
             basegfx::B2DHomMatrix               maTextureTransform;
@@ -239,7 +239,7 @@ namespace drawinglayer::texture
         // given percentage value (offsetX has to be 0.0 <= offsetX <= 1.0).
         // Accordingly to offsetY. If both are given, offsetX is preferred
         // and offsetY is ignored.
-        class GeoTexSvxTiled final : public GeoTexSvx
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxTiled final : public GeoTexSvx
         {
             basegfx::B2DRange               maRange;
             double                          mfOffsetX;
commit faed01b647cb2e566308d415ac51f4fc0c5319fd
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 20:40:59 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat May 9 21:16:59 2020 +0200

    drawinglayer: externalize FillHatchPrimitive2D class
    
    Change-Id: I9ad1f179a43bb6c501cb699c0f26523f47307829

diff --git a/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx b/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
index bab7e47b03e8..c7b3a559bc42 100644
--- a/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
@@ -26,9 +26,6 @@
 #include <drawinglayer/attribute/fillhatchattribute.hxx>
 #include <basegfx/color/bcolor.hxx>
 
-
-// FillHatchPrimitive2D class
-
 namespace drawinglayer::primitive2d
 {
         /** FillHatchPrimitive2D class
@@ -45,7 +42,7 @@ namespace drawinglayer::primitive2d
 
             The decomposition will deliver the hatch lines.
          */
-        class FillHatchPrimitive2D final : public DiscreteMetricDependentPrimitive2D
+        class DRAWINGLAYER_DLLPUBLIC FillHatchPrimitive2D final : public DiscreteMetricDependentPrimitive2D
         {
         private:
             /// the geometrically visible area
commit ac98fcddef6df5e397ff3de5de102e1186968b7c
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Thu May 7 22:01:22 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat May 9 21:16:59 2020 +0200

    vcl: VectorGraphicSearch - for searching text inside PDF
    
    Change-Id: Iee940a3927330c8739774ff3c1af15998f89193b

diff --git a/include/vcl/VectorGraphicSearch.hxx b/include/vcl/VectorGraphicSearch.hxx
new file mode 100644
index 000000000000..3411d0a931e6
--- /dev/null
+++ b/include/vcl/VectorGraphicSearch.hxx
@@ -0,0 +1,39 @@
+/* -*- 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
+
+#include <vcl/graph.hxx>
+#include <vcl/vectorgraphicdata.hxx>
+#include <vcl/dllapi.h>
+
+#include <fpdf_doc.h>
+
+#include <memory>
+
+class SearchContext;
+
+class VCL_DLLPUBLIC VectorGraphicSearch final
+{
+private:
+    Graphic maGraphic;
+    FPDF_DOCUMENT mpPdfDocument;
+    std::unique_ptr<SearchContext> mpSearchContext;
+    bool searchPDF(std::shared_ptr<VectorGraphicData> const& rData, OUString const& rSearchString);
+
+public:
+    VectorGraphicSearch(Graphic const& rGraphic);
+    ~VectorGraphicSearch();
+    bool search(OUString const& rSearchString);
+    bool next();
+    int index();
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/CppunitTest_vcl_graphic_test.mk b/vcl/CppunitTest_vcl_graphic_test.mk
index 7b042f84d7da..ea49eacdb781 100644
--- a/vcl/CppunitTest_vcl_graphic_test.mk
+++ b/vcl/CppunitTest_vcl_graphic_test.mk
@@ -14,11 +14,12 @@ $(eval $(call gb_CppunitTest_add_exception_objects,vcl_graphic_test, \
     vcl/qa/cppunit/GraphicDescriptorTest \
     vcl/qa/cppunit/GraphicFormatDetectorTest \
     vcl/qa/cppunit/GraphicNativeMetadataTest \
+    vcl/qa/cppunit/VectorGraphicSearchTest \
 ))
 
-$(eval $(call gb_CppunitTest_use_externals,vcl_graphic_test,\
-	boost_headers \
-	glm_headers \
+$(eval $(call gb_CppunitTest_use_externals,vcl_graphic_test, \
+    boost_headers \
+    $(if $(filter PDFIUM,$(BUILD_TYPE)),pdfium) \
 ))
 
 $(eval $(call gb_CppunitTest_set_include,vcl_graphic_test,\
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 4b4406c400fd..c054cc61493e 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -330,6 +330,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/graphic/UnoGraphicObject \
     vcl/source/graphic/UnoGraphicProvider \
     vcl/source/graphic/UnoGraphicTransformer \
+    vcl/source/graphic/VectorGraphicSearch \
     vcl/source/bitmap/bitmap \
     vcl/source/bitmap/bitmapfilter \
     vcl/source/bitmap/BitmapAlphaClampFilter \
diff --git a/vcl/qa/cppunit/VectorGraphicSearchTest.cxx b/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
new file mode 100644
index 000000000000..0ed21ccf9e26
--- /dev/null
+++ b/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
@@ -0,0 +1,50 @@
+/* -*- 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/.
+ */
+
+#include <cppunit/TestAssert.h>
+#include <cppunit/extensions/HelperMacros.h>
+#include <unotest/bootstrapfixturebase.hxx>
+#include <unotest/directories.hxx>
+
+#include <vcl/VectorGraphicSearch.hxx>
+#include <vcl/graph.hxx>
+#include <vcl/graphicfilter.hxx>
+#include <tools/stream.hxx>
+
+class VectorGraphicSearchTest : public test::BootstrapFixtureBase
+{
+    OUString getFullUrl(const OUString& sFileName)
+    {
+        return m_directories.getURLFromSrc("/vcl/qa/cppunit/data/") + sFileName;
+    }
+
+    void test();
+
+    CPPUNIT_TEST_SUITE(VectorGraphicSearchTest);
+    CPPUNIT_TEST(test);
+    CPPUNIT_TEST_SUITE_END();
+};
+
+void VectorGraphicSearchTest::test()
+{
+    OUString aURL = getFullUrl("Pangram.pdf");
+    SvFileStream aStream(aURL, StreamMode::READ);
+    GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();
+    Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream);
+    aGraphic.makeAvailable();
+
+    VectorGraphicSearch aSearch(aGraphic);
+    CPPUNIT_ASSERT_EQUAL(true, aSearch.search("lazy"));
+    CPPUNIT_ASSERT_EQUAL(true, aSearch.next());
+    CPPUNIT_ASSERT_EQUAL(34, aSearch.index());
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(VectorGraphicSearchTest);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qa/cppunit/data/Pangram.pdf b/vcl/qa/cppunit/data/Pangram.pdf
new file mode 100644
index 000000000000..0714fda4e4dd
Binary files /dev/null and b/vcl/qa/cppunit/data/Pangram.pdf differ
diff --git a/vcl/source/graphic/VectorGraphicSearch.cxx b/vcl/source/graphic/VectorGraphicSearch.cxx
new file mode 100644
index 000000000000..864c65f2dda2
--- /dev/null
+++ b/vcl/source/graphic/VectorGraphicSearch.cxx
@@ -0,0 +1,168 @@
+/* -*- 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/.
+ *
+ */
+
+#include <sal/config.h>
+#include <vcl/VectorGraphicSearch.hxx>
+
+#include <fpdf_text.h>
+
+class SearchContext
+{
+public:
+    bool bInitialized = false;
+
+    FPDF_DOCUMENT mpPdfDocument;
+    sal_Int32 mnPageIndex;
+    FPDF_PAGE mpPage;
+    FPDF_TEXTPAGE mpTextPage;
+    OUString maSearchString;
+    FPDF_SCHHANDLE mpSearchHandle;
+
+    SearchContext(FPDF_DOCUMENT pPdfDocument, sal_Int32 nPageIndex, OUString const& rSearchString)
+        : mpPdfDocument(pPdfDocument)
+        , mnPageIndex(nPageIndex)
+        , mpPage(nullptr)
+        , mpTextPage(nullptr)
+        , maSearchString(rSearchString)
+        , mpSearchHandle(nullptr)
+    {
+    }
+
+    ~SearchContext()
+    {
+        if (mpSearchHandle)
+            FPDFText_FindClose(mpSearchHandle);
+        if (mpTextPage)
+            FPDFText_ClosePage(mpTextPage);
+        if (mpPage)
+            FPDF_ClosePage(mpPage);
+    }
+
+    bool initialize()
+    {
+        if (!mpPdfDocument)
+            return false;
+        mpPage = FPDF_LoadPage(mpPdfDocument, mnPageIndex);
+        if (!mpPage)
+            return false;
+        mpTextPage = FPDFText_LoadPage(mpPage);
+        if (!mpTextPage)
+            return false;
+
+        FPDF_WIDESTRING pString = reinterpret_cast<FPDF_WIDESTRING>(maSearchString.getStr());
+        mpSearchHandle = FPDFText_FindStart(mpTextPage, pString, 0, 0);
+
+        return mpSearchHandle != nullptr;
+    }
+
+    bool next()
+    {
+        if (mpSearchHandle)
+            return FPDFText_FindNext(mpSearchHandle);
+        return false;
+    }
+
+    int index()
+    {
+        if (mpSearchHandle)
+            return FPDFText_GetSchResultIndex(mpSearchHandle);
+        return -1;
+    }
+};
+
+VectorGraphicSearch::VectorGraphicSearch(Graphic const& rGraphic)
+    : maGraphic(rGraphic)
+    , mpPdfDocument(nullptr)
+{
+    FPDF_LIBRARY_CONFIG aConfig;
+    aConfig.version = 2;
+    aConfig.m_pUserFontPaths = nullptr;
+    aConfig.m_pIsolate = nullptr;
+    aConfig.m_v8EmbedderSlot = 0;
+    FPDF_InitLibraryWithConfig(&aConfig);
+}
+
+VectorGraphicSearch::~VectorGraphicSearch()
+{
+    mpSearchContext.reset();
+
+    if (mpPdfDocument)
+        FPDF_CloseDocument(mpPdfDocument);
+    FPDF_DestroyLibrary();
+}
+
+bool VectorGraphicSearch::search(OUString const& rSearchString)
+{
+    auto pData = maGraphic.getVectorGraphicData();
+
+    if (pData && pData->getVectorGraphicDataType() == VectorGraphicDataType::Pdf)
+    {
+        return searchPDF(pData, rSearchString);
+    }
+    return false;
+}
+
+bool VectorGraphicSearch::searchPDF(std::shared_ptr<VectorGraphicData> const& rData,
+                                    OUString const& rSearchString)
+{
+    if (rSearchString.isEmpty())
+        return false;
+
+    mpPdfDocument
+        = FPDF_LoadMemDocument(rData->getVectorGraphicDataArray().getConstArray(),
+                               rData->getVectorGraphicDataArrayLength(), /*password=*/nullptr);
+
+    if (!mpPdfDocument)
+    {
+        //TODO: Handle failure to load.
+        switch (FPDF_GetLastError())
+        {
+            case FPDF_ERR_SUCCESS:
+                break;
+            case FPDF_ERR_UNKNOWN:
+                break;
+            case FPDF_ERR_FILE:
+                break;
+            case FPDF_ERR_FORMAT:
+                break;
+            case FPDF_ERR_PASSWORD:
+                break;
+            case FPDF_ERR_SECURITY:
+                break;
+            case FPDF_ERR_PAGE:
+                break;
+            default:
+                break;
+        }
+        return false;
+    }
+
+    sal_Int32 nPageIndex = std::max(rData->getPageIndex(), 0);
+
+    mpSearchContext.reset(new SearchContext(mpPdfDocument, nPageIndex, rSearchString));
+
+    return mpSearchContext->initialize();
+}
+
+bool VectorGraphicSearch::next()
+{
+    if (mpSearchContext)
+        return mpSearchContext->next();
+    return false;
+}
+
+int VectorGraphicSearch::index()
+{
+    if (mpSearchContext)
+        return mpSearchContext->index();
+    return -1;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit de163f3ad16add8bc13a34ff1d46bbdbf2de40fe
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed Apr 1 13:00:25 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat May 9 21:15:08 2020 +0200

    Add OutputDevice::drawPrimitive2D to OutputDevice
    
    Change-Id: Ifc22eca62df72bddd247ba097054f34756520614

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 1df0137cdcee..9cd127d3490c 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -49,6 +49,8 @@
 #include <com/sun/star/drawing/LineCap.hpp>
 #include <com/sun/star/uno/Reference.h>
 
+#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
+
 #include <memory>
 #include <vector>
 
@@ -1955,6 +1957,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/Library_vcl.mk b/vcl/Library_vcl.mk
index 64fe3ecb5edf..4b4406c400fd 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -80,6 +80,7 @@ $(eval $(call gb_Library_use_libraries,vcl,\
     basegfx \
     comphelper \
     cppuhelper \
+    drawinglayercore \
     i18nlangtag \
     i18nutil \
     $(if $(filter OPENCL,$(BUILD_TYPE)),opencl) \
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index 0dcdd84a5d0a..52f31234caa3 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -713,4 +713,9 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
     return bDrawn;
 }
 
+bool OutputDevice::drawPrimitive2D(drawinglayer::primitive2d::Primitive2DContainer & rPrimitive2D)
+{
+    return false;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit ca17e73195a0ed2e83cec93c71e7d7f2975b1b1a
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat Mar 7 14:33:43 2020 +0100
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat May 9 21:15:08 2020 +0200

    Separate core drawinglayer func. into drawinglayercore library
    
    This separates the drawinglayer core functionallity into a
    separate library, to keep a strict separation what is backend
    dependent and what is not. More strict separation can be done
    at a later date.
    
    This will make it possible to push part of drawinglayer
    (part of processor2d) directly into VCL.
    
    Change-Id: Ibc26580067e50bf20d7cdd37fa0e44eb10200878

diff --git a/Repository.mk b/Repository.mk
index c02196c545d2..64c11deb3d19 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -350,6 +350,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
 	$(call gb_Helper_optional,SCRIPTING,dlgprov) \
 	$(if $(filter WNT,$(OS)),directx9canvas) \
 	$(if $(ENABLE_OPENGL_CANVAS),oglcanvas) \
+	drawinglayercore \
 	drawinglayer \
 	editeng \
 	$(if $(filter WNT,$(OS)),emser) \
diff --git a/drawinglayer/CppunitTest_drawinglayer_border.mk b/drawinglayer/CppunitTest_drawinglayer_border.mk
index fa2f715590cd..e00006c18dba 100644
--- a/drawinglayer/CppunitTest_drawinglayer_border.mk
+++ b/drawinglayer/CppunitTest_drawinglayer_border.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,drawinglayer_border, \
 	sal \
 	salhelper \
 	drawinglayer \
+	drawinglayercore \
 	vcl \
 	test \
 	tl \
diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk
index 2a0f1030a789..46f21f56b6b6 100644
--- a/drawinglayer/Library_drawinglayer.mk
+++ b/drawinglayer/Library_drawinglayer.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_Library_use_externals,drawinglayer,\
 ))
 
 $(eval $(call gb_Library_use_libraries,drawinglayer,\
+    drawinglayercore \
     basegfx \
     canvastools \
     comphelper \
@@ -67,11 +68,9 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
     drawinglayer/source/attribute/sdrsceneattribute3d \
     drawinglayer/source/attribute/sdrshadowattribute \
     drawinglayer/source/attribute/strokeattribute \
-    drawinglayer/source/geometry/viewinformation2d \
     drawinglayer/source/geometry/viewinformation3d \
     drawinglayer/source/primitive2d/animatedprimitive2d \
     drawinglayer/source/primitive2d/backgroundcolorprimitive2d \
-    drawinglayer/source/primitive2d/baseprimitive2d \
     drawinglayer/source/primitive2d/bitmapprimitive2d \
     drawinglayer/source/primitive2d/borderlineprimitive2d \
     drawinglayer/source/primitive2d/controlprimitive2d \
@@ -111,7 +110,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 \
@@ -126,7 +124,6 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
     drawinglayer/source/primitive2d/textlineprimitive2d \
     drawinglayer/source/primitive2d/textprimitive2d \
     drawinglayer/source/primitive2d/textstrikeoutprimitive2d \
-    drawinglayer/source/primitive2d/Tools \
     drawinglayer/source/primitive2d/transformprimitive2d \
     drawinglayer/source/primitive2d/transparenceprimitive2d \
     drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d \
diff --git a/drawinglayer/Library_drawinglayercore.mk b/drawinglayer/Library_drawinglayercore.mk
new file mode 100644
index 000000000000..f1643d27014d
--- /dev/null
+++ b/drawinglayer/Library_drawinglayercore.mk
@@ -0,0 +1,49 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# 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/.
+#
+
+$(eval $(call gb_Library_Library,drawinglayercore))
+
+$(eval $(call gb_Library_set_include,drawinglayercore,\
+    $$(INCLUDE) \
+    -I$(SRCDIR)/drawinglayer/inc \
+))
+
+$(eval $(call gb_Library_add_defs,drawinglayercore,\
+    -DDRAWINGLAYERCORE_DLLIMPLEMENTATION \
+))
+
+$(eval $(call gb_Library_set_precompiled_header,drawinglayercore,drawinglayer/inc/pch/precompiled_drawinglayercore))
+
+$(eval $(call gb_Library_use_sdk_api,drawinglayercore))
+
+$(eval $(call gb_Library_use_externals,drawinglayercore,\
+    boost_headers \
+    libxml2 \
+))
+
+$(eval $(call gb_Library_use_libraries,drawinglayercore,\
+    basegfx \
+    comphelper \
+    cppu \
+    cppuhelper \
+    i18nlangtag \
+    sal \
+    salhelper \
+    svl \
+    tl \
+))
+
+$(eval $(call gb_Library_add_exception_objects,drawinglayercore,\
+    drawinglayer/source/primitive2d/baseprimitive2d \
+    drawinglayer/source/primitive2d/Primitive2DContainer \
+    drawinglayer/source/primitive2d/Tools \
+    drawinglayer/source/geometry/viewinformation2d \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/drawinglayer/Module_drawinglayer.mk b/drawinglayer/Module_drawinglayer.mk
index 6d329e95c60a..687cd9c2671f 100644
--- a/drawinglayer/Module_drawinglayer.mk
+++ b/drawinglayer/Module_drawinglayer.mk
@@ -10,6 +10,7 @@
 $(eval $(call gb_Module_Module,drawinglayer))
 
 $(eval $(call gb_Module_add_targets,drawinglayer,\
+    Library_drawinglayercore \
     Library_drawinglayer \
 ))
 
diff --git a/drawinglayer/inc/pch/precompiled_drawinglayer.hxx b/drawinglayer/inc/pch/precompiled_drawinglayer.hxx
index 9aaf7bace296..d60954dab588 100644
--- a/drawinglayer/inc/pch/precompiled_drawinglayer.hxx
+++ b/drawinglayer/inc/pch/precompiled_drawinglayer.hxx
@@ -93,7 +93,6 @@
 #include <basegfx/range/basicrange.hxx>
 #include <basegfx/tuple/b2dtuple.hxx>
 #include <basegfx/tuple/b3dtuple.hxx>
-#include <basegfx/utils/canvastools.hxx>
 #include <basegfx/vector/b2dvector.hxx>
 #include <basegfx/vector/b2enums.hxx>
 #include <basegfx/vector/b2ivector.hxx>
@@ -105,7 +104,7 @@
 #include <com/sun/star/drawing/TextureMode.hpp>
 #include <com/sun/star/drawing/TextureProjectionMode.hpp>
 #include <com/sun/star/graphic/XPrimitive3D.hpp>
-#include <com/sun/star/util/XAccounting.hpp>
+#include <com/sun/star/uno/Reference.hxx>
 #include <comphelper/comphelperdllapi.h>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/sequence.hxx>
@@ -139,7 +138,6 @@
 #include <drawinglayer/drawinglayerdllapi.h>
 #include <drawinglayer/geometry/viewinformation2d.hxx>
 #include <drawinglayer/geometry/viewinformation3d.hxx>
-#include <drawinglayer/primitive2d/CommonTypes.hxx>
 #include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx>
 #include <drawinglayer/primitive2d/PolyPolygonGradientPrimitive2D.hxx>
 #include <drawinglayer/primitive2d/PolyPolygonGraphicPrimitive2D.hxx>
@@ -147,9 +145,6 @@
 #include <drawinglayer/primitive2d/PolyPolygonHatchPrimitive2D.hxx>
 #include <drawinglayer/primitive2d/PolyPolygonMarkerPrimitive2D.hxx>
 #include <drawinglayer/primitive2d/PolyPolygonStrokePrimitive2D.hxx>
-#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
-#include <drawinglayer/primitive2d/Primitive2DVisitor.hxx>
-#include <drawinglayer/primitive2d/Tools.hxx>
 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
 #include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
 #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
diff --git a/drawinglayer/inc/pch/precompiled_drawinglayercore.cxx b/drawinglayer/inc/pch/precompiled_drawinglayercore.cxx
new file mode 100644
index 000000000000..4a8c23ea8e65
--- /dev/null
+++ b/drawinglayer/inc/pch/precompiled_drawinglayercore.cxx
@@ -0,0 +1,12 @@
+/* -*- 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/.
+ */
+
+#include "precompiled_drawinglayercore.hxx"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/inc/pch/precompiled_drawinglayercore.hxx b/drawinglayer/inc/pch/precompiled_drawinglayercore.hxx
new file mode 100644
index 000000000000..4cc5ca4612c9
--- /dev/null
+++ b/drawinglayer/inc/pch/precompiled_drawinglayercore.hxx
@@ -0,0 +1,46 @@
+/* -*- 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 has been autogenerated by update_pch.sh. It is possible to edit it
+ manually (such as when an include file has been moved/renamed/removed). All such
+ manual changes will be rewritten by the next run of update_pch.sh (which presumably
+ also fixes all possible problems, so it's usually better to use it).
+
+ Generated on 2020-03-07 12:37:18 using:
+ ./bin/update_pch drawinglayer drawinglayercore --cutoff=4 --exclude:system --exclude:module --exclude:local
+
+ If after updating build fails, use the following command to locate conflicting headers:
+ ./bin/update_pch_bisect ./drawinglayer/inc/pch/precompiled_drawinglayercore.hxx "make drawinglayer.build" --find-conflicts
+*/
+
+#if PCH_LEVEL >= 1
+#include <ostream>
+#include <vector>
+#endif // PCH_LEVEL >= 1
+#if PCH_LEVEL >= 2
+#include <osl/diagnose.h>
+#include <osl/interlck.h>
+#include <sal/config.h>
+#include <sal/types.h>
+#endif // PCH_LEVEL >= 2
+#if PCH_LEVEL >= 3
+#include <basegfx/basegfxdllapi.h>
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <basegfx/range/basicrange.hxx>
+#include <basegfx/tuple/b2dtuple.hxx>
+#include <basegfx/utils/canvastools.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#endif // PCH_LEVEL >= 3
+#if PCH_LEVEL >= 4
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+#endif // PCH_LEVEL >= 4
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/emfio/CppunitTest_emfio_emf_test.mk b/emfio/CppunitTest_emfio_emf_test.mk
index 123e4b3549bd..2679c0a604d9 100644
--- a/emfio/CppunitTest_emfio_emf_test.mk
+++ b/emfio/CppunitTest_emfio_emf_test.mk
@@ -23,6 +23,7 @@ $(eval $(call gb_CppunitTest_use_sdk_api,emfio_emf))
 $(eval $(call gb_CppunitTest_use_libraries,emfio_emf,\
     basegfx \
     drawinglayer \
+    drawinglayercore \
     cppu \
     cppuhelper \
     comphelper \
diff --git a/emfio/Library_emfio.mk b/emfio/Library_emfio.mk
index 52fde14885b3..89add50b781a 100644
--- a/emfio/Library_emfio.mk
+++ b/emfio/Library_emfio.mk
@@ -41,6 +41,7 @@ $(eval $(call gb_Library_use_sdk_api,emfio))
 
 $(eval $(call gb_Library_use_libraries,emfio,\
     basegfx \
+    drawinglayercore \
     drawinglayer \
     cppu \
     cppuhelper \
diff --git a/filter/Library_svgfilter.mk b/filter/Library_svgfilter.mk
index 21318aa1fd03..1f0caf11758c 100644
--- a/filter/Library_svgfilter.mk
+++ b/filter/Library_svgfilter.mk
@@ -56,6 +56,7 @@ $(eval $(call gb_Library_use_libraries,svgfilter,\
 	sax \
 	salhelper \
 	comphelper \
+	drawinglayercore \
 	drawinglayer \
 	basegfx \
 	cppuhelper \
diff --git a/include/drawinglayer/drawinglayerdllapi.h b/include/drawinglayer/drawinglayerdllapi.h
index 0b3983504919..36a0d8abfea2 100644
--- a/include/drawinglayer/drawinglayerdllapi.h
+++ b/include/drawinglayer/drawinglayerdllapi.h
@@ -19,6 +19,12 @@
 #endif
 #define DRAWINGLAYER_DLLPRIVATE SAL_DLLPRIVATE
 
+#if defined(DRAWINGLAYERCORE_DLLIMPLEMENTATION)
+#define DRAWINGLAYERCORE_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define DRAWINGLAYERCORE_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/geometry/viewinformation2d.hxx b/include/drawinglayer/geometry/viewinformation2d.hxx
index 95be29a72bda..06b17248d213 100644
--- a/include/drawinglayer/geometry/viewinformation2d.hxx
+++ b/include/drawinglayer/geometry/viewinformation2d.hxx
@@ -63,7 +63,7 @@ namespace drawinglayer::geometry
     It is an implementation to support the sequence of PropertyValues used in a
     css::graphic::XPrimitive2D for C++ implementations working with those
 */
-class DRAWINGLAYER_DLLPUBLIC ViewInformation2D
+class DRAWINGLAYERCORE_DLLPUBLIC ViewInformation2D
 {
 public:
     typedef o3tl::cow_wrapper<ImpViewInformation2D, o3tl::ThreadSafeRefCountingPolicy> ImplType;
diff --git a/include/drawinglayer/primitive2d/Primitive2DContainer.hxx b/include/drawinglayer/primitive2d/Primitive2DContainer.hxx
index cca3a0a91485..c096e9a8cc2f 100644
--- a/include/drawinglayer/primitive2d/Primitive2DContainer.hxx
+++ b/include/drawinglayer/primitive2d/Primitive2DContainer.hxx
@@ -34,7 +34,7 @@ class ViewInformation2D;
 
 namespace drawinglayer::primitive2d
 {
-class SAL_WARN_UNUSED DRAWINGLAYER_DLLPUBLIC Primitive2DContainer
+class SAL_WARN_UNUSED DRAWINGLAYERCORE_DLLPUBLIC Primitive2DContainer
     : public std::deque<Primitive2DReference>,
       public Primitive2DDecompositionVisitor
 {
diff --git a/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx b/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx
index dfe04b32a320..e174d1e0878d 100644
--- a/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx
+++ b/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx
@@ -27,7 +27,7 @@ namespace drawinglayer::primitive2d
 class Primitive2DContainer;
 
 // Visitor class for walking a tree of Primitive2DReference
-class DRAWINGLAYER_DLLPUBLIC Primitive2DDecompositionVisitor
+class DRAWINGLAYERCORE_DLLPUBLIC Primitive2DDecompositionVisitor
 {
 public:
     virtual void append(const Primitive2DReference&) = 0;
diff --git a/include/drawinglayer/primitive2d/Tools.hxx b/include/drawinglayer/primitive2d/Tools.hxx
index fbb6f5717c01..1c30565c8c1b 100644
--- a/include/drawinglayer/primitive2d/Tools.hxx
+++ b/include/drawinglayer/primitive2d/Tools.hxx
@@ -31,16 +31,16 @@ class ViewInformation2D;
 namespace drawinglayer::primitive2d
 {
 /// get B2DRange from a given Primitive2DReference
-basegfx::B2DRange DRAWINGLAYER_DLLPUBLIC getB2DRangeFromPrimitive2DReference(
+basegfx::B2DRange DRAWINGLAYERCORE_DLLPUBLIC getB2DRangeFromPrimitive2DReference(
     const Primitive2DReference& rCandidate, const geometry::ViewInformation2D& aViewInformation);
 
 /** compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D)
     and using compare operator
  */
-bool DRAWINGLAYER_DLLPUBLIC arePrimitive2DReferencesEqual(const Primitive2DReference& rA,
-                                                          const Primitive2DReference& rB);
+bool DRAWINGLAYERCORE_DLLPUBLIC arePrimitive2DReferencesEqual(const Primitive2DReference& rA,
+                                                              const Primitive2DReference& rB);
 
-OUString DRAWINGLAYER_DLLPUBLIC idToString(sal_uInt32 nId);
+OUString DRAWINGLAYERCORE_DLLPUBLIC idToString(sal_uInt32 nId);
 
 } // end of namespace drawinglayer::primitive2d
 
diff --git a/include/drawinglayer/primitive2d/baseprimitive2d.hxx b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
index 5e1a96429ff3..8818cdd0bcde 100644
--- a/include/drawinglayer/primitive2d/baseprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
@@ -121,8 +121,8 @@ typedef cppu::WeakComponentImplHelper<css::graphic::XPrimitive2D, css::util::XAc
     for view-independent primitives which are defined by not using ViewInformation2D
     in their get2DDecomposition/getB2DRange implementations.
 */
-class DRAWINGLAYER_DLLPUBLIC BasePrimitive2D : protected cppu::BaseMutex,
-                                               public BasePrimitive2DImplBase
+class DRAWINGLAYERCORE_DLLPUBLIC BasePrimitive2D : protected cppu::BaseMutex,
+                                                   public BasePrimitive2DImplBase
 {
     BasePrimitive2D(const BasePrimitive2D&) = delete;
     BasePrimitive2D& operator=(const BasePrimitive2D&) = delete;
@@ -200,7 +200,7 @@ public:
         to identify if a new decomposition is needed at the next call
     (f) return maBuffered2DDecomposition
  */
-class DRAWINGLAYER_DLLPUBLIC BufferedDecompositionPrimitive2D : public BasePrimitive2D
+class DRAWINGLAYERCORE_DLLPUBLIC BufferedDecompositionPrimitive2D : public BasePrimitive2D
 {
 private:
     /// a sequence used for buffering the last create2DDecomposition() result
diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk
index 8943de7ab4c3..60fb6676dab9 100644
--- a/sc/CppunitTest_sc_ucalc.mk
+++ b/sc/CppunitTest_sc_ucalc.mk
@@ -49,6 +49,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_ucalc, \
     cppuhelper \
     dbtools \
     drawinglayer \
+    drawinglayercore \
     editeng \
     for \
     forui \
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 997b14c0add9..b540b27c9834 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -70,6 +70,7 @@ $(eval $(call gb_Library_use_libraries,sc,\
     cppu \
     cppuhelper \
     dbtools \
+    drawinglayercore \
     drawinglayer \
     editeng \
     for \
diff --git a/sd/CppunitTest_sd_uimpress.mk b/sd/CppunitTest_sd_uimpress.mk
index 93426dfc3a55..63f143978231 100644
--- a/sd/CppunitTest_sd_uimpress.mk
+++ b/sd/CppunitTest_sd_uimpress.mk
@@ -27,6 +27,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sd_uimpress,\
     cppu \
     cppuhelper \
     drawinglayer \
+    drawinglayercore \
     editeng \
     i18nlangtag \
     i18nutil \
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 43b168be8d8c..24520633e77f 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -74,6 +74,7 @@ $(eval $(call gb_Library_use_libraries,sd,\
 	cppcanvas \
 	cppu \
 	cppuhelper \
+	drawinglayercore \
 	drawinglayer \
 	editeng \
 	i18nlangtag \
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 67a66ef2d211..a6d6b7d6b71a 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -49,6 +49,7 @@ $(eval $(call gb_Library_use_libraries,sfx,\
     comphelper \
     cppu \
     cppuhelper \
+    drawinglayercore \
     drawinglayer \
     fwe \
     i18nlangtag \
diff --git a/svgio/CppunitTest_svgio.mk b/svgio/CppunitTest_svgio.mk
index c6f4db91fc60..24fb7a39af32 100644
--- a/svgio/CppunitTest_svgio.mk
+++ b/svgio/CppunitTest_svgio.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_CppunitTest_use_library_objects,svgio,\
 $(eval $(call gb_CppunitTest_use_libraries,svgio,\
     basegfx \
     drawinglayer \
+    drawinglayercore \
     cppu \
     cppuhelper \
     comphelper \
diff --git a/svgio/Library_svgio.mk b/svgio/Library_svgio.mk
index 449c17f61196..7ef1aeb19513 100644
--- a/svgio/Library_svgio.mk
+++ b/svgio/Library_svgio.mk
@@ -33,6 +33,7 @@ $(eval $(call gb_Library_use_sdk_api,svgio))
 
 $(eval $(call gb_Library_use_libraries,svgio,\
     basegfx \
+    drawinglayercore \
     drawinglayer \
     comphelper \
     cppu \
diff --git a/svx/CppunitTest_svx_unit.mk b/svx/CppunitTest_svx_unit.mk
index 92feb45d6578..c78b8d7769eb 100644
--- a/svx/CppunitTest_svx_unit.mk
+++ b/svx/CppunitTest_svx_unit.mk
@@ -35,6 +35,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,svx_unit, \
 $(eval $(call gb_CppunitTest_use_libraries,svx_unit, \
 	basegfx \
 	drawinglayer \
+	drawinglayercore \
 	sal \
 	sfx \
 	svxcore \
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index d3eff20b6769..9ccba33a748c 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -50,6 +50,7 @@ $(eval $(call gb_Library_use_libraries,svx,\
 		crashreport) \
     $(call gb_Helper_optional,DBCONNECTIVITY, \
         dbtools) \
+    drawinglayercore \
     drawinglayer \
     editeng \
     fwe \
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk
index 222d69bb6c8a..7a9b31e58b77 100644
--- a/svx/Library_svxcore.mk
+++ b/svx/Library_svxcore.mk
@@ -57,6 +57,7 @@ $(eval $(call gb_Library_use_libraries,svxcore,\
     cppu \
     $(call gb_Helper_optional,DBCONNECTIVITY, \
         dbtools) \
+    drawinglayercore \
     drawinglayer \
     editeng \
     fwe \
diff --git a/sw/CppunitTest_sw_uwriter.mk b/sw/CppunitTest_sw_uwriter.mk
index 6b9ffa4ba683..a881587735e4 100644
--- a/sw/CppunitTest_sw_uwriter.mk
+++ b/sw/CppunitTest_sw_uwriter.mk
@@ -33,6 +33,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_uwriter, \
     $(call gb_Helper_optional,DBCONNECTIVITY, \
         dbtools) \
     drawinglayer \
+    drawinglayercore \
     editeng \
     i18nlangtag \
     i18nutil \
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index fcb8786d704f..0f44a354ceca 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -58,6 +58,7 @@ $(eval $(call gb_Library_use_libraries,sw,\
     cppuhelper \
     $(call gb_Helper_optional,DBCONNECTIVITY, \
         dbtools) \
+    drawinglayercore \
     drawinglayer \
     editeng \
     i18nlangtag \
diff --git a/sw/Library_swui.mk b/sw/Library_swui.mk
index 99f1dd20ae3d..4c09d1cc4bda 100644
--- a/sw/Library_swui.mk
+++ b/sw/Library_swui.mk
@@ -75,6 +75,7 @@ $(eval $(call gb_Library_use_libraries,swui,\
     ucbhelper \
     utl \
     vcl \
+    drawinglayercore \
     drawinglayer \
 ))
 
commit b577de1becb6e606cc0c80b310fc760309184d19
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 20:39:57 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat May 9 21:13:11 2020 +0200

    drawinglayer: clean-up namespaces in fillhatchprimitive2d.hxx
    
    Change-Id: I6fdd777cb9e238d43abdc5ec30bd998ae611caa9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93832
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx b/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
index 4b741cef44d6..bab7e47b03e8 100644
--- a/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
@@ -29,10 +29,8 @@
 
 // FillHatchPrimitive2D class
 
-namespace drawinglayer
+namespace drawinglayer::primitive2d
 {
-    namespace primitive2d
-    {
         /** FillHatchPrimitive2D class
 
             This class defines a hatch filling for a rectangular area. The
@@ -96,7 +94,6 @@ namespace drawinglayer
             /// provide unique ID
             virtual sal_uInt32 getPrimitive2DID() const override;
         };
-    } // end of namespace primitive2d
-} // end of namespace drawinglayer
+} // end of namespace drawinglayer::primitive2d
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 73a8850a7646782819a5cb51ac8cf08cc5389d15
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 20:38:10 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat May 9 21:12:40 2020 +0200

    drawinglayer: clean-up namespaces in graphicprimitivehelper2d.hxx
    
    Change-Id: I24b11ccc7d82a9d3380fc8aa32c90ad0256485f9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93831
    Tested-by: Tomaž Vajngerl <quikee at gmail.com>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx b/drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx
index cd1cc99ebf51..fb1431152b16 100644
--- a/drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx
+++ b/drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx
@@ -22,16 +22,10 @@
 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
 #include <vcl/GraphicObject.hxx>
 
-
-// predefines
-
 class Graphic;
 
-
-namespace drawinglayer
+namespace drawinglayer::primitive2d
 {
-    namespace primitive2d
-    {
         /** Helper method with supports decomposing a Graphic with all
             possible contents to lower level primitives.
 
@@ -60,7 +54,6 @@ namespace drawinglayer
             double fGamma = 1.0,            // ]0.0 .. 10.0]
             bool bInvert = false);
 
-    } // end of namespace primitive2d
-} // end of namespace drawinglayer
+} // end of namespace drawinglayer::primitive2d
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 3ad2c4ee8185dfa73f6afe383825de385537bc70
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 20:37:06 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat May 9 21:11:58 2020 +0200

    drawinglayer: clean-up namespaces in primitivetools2d.hxx
    
    Change-Id: I766c5deba22f93824b5c13908a549ea0980c3aa7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93830
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/include/drawinglayer/primitive2d/primitivetools2d.hxx b/include/drawinglayer/primitive2d/primitivetools2d.hxx
index 8a368ae301c0..db22a59b0eee 100644
--- a/include/drawinglayer/primitive2d/primitivetools2d.hxx
+++ b/include/drawinglayer/primitive2d/primitivetools2d.hxx
@@ -25,10 +25,8 @@
 #include <basegfx/matrix/b2dhommatrix.hxx>
 
 
-namespace drawinglayer
+namespace drawinglayer::primitive2d
 {
-    namespace primitive2d
-    {
         /** DiscreteMetricDependentPrimitive2D class
 
             tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
@@ -59,14 +57,7 @@ namespace drawinglayer
             /// 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
 
-
-namespace drawinglayer
-{
-    namespace primitive2d
-    {
         /** ViewportDependentPrimitive2D class
 
             tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
@@ -97,14 +88,7 @@ namespace drawinglayer
             /// 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
-
 
-namespace drawinglayer
-{
-    namespace primitive2d
-    {
         /** ViewTransformationDependentPrimitive2D class
 
             tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
@@ -135,14 +119,7 @@ namespace drawinglayer
             /// 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
-
 
-namespace drawinglayer
-{
-    namespace primitive2d
-    {
         /** ObjectAndViewTransformationDependentPrimitive2D class
 
             tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
@@ -177,7 +154,6 @@ namespace drawinglayer
             /// 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
+} // end of namespace drawinglayer::primitive2d
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 3e4c31ad4009389cb4350a169d505bbb3f11a402
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 20:32:06 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat May 9 21:11:31 2020 +0200

    drawinglayer: clean-up namespaces in texture.hxx
    
    Change-Id: I0977858ea5b9d2b7ddfaa8012ef50170ee02f27d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93829
    Tested-by: Tomaž Vajngerl <quikee at gmail.com>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/drawinglayer/inc/texture/texture.hxx b/drawinglayer/inc/texture/texture.hxx
index 64595a46222c..24e23a4b241c 100644
--- a/drawinglayer/inc/texture/texture.hxx
+++ b/drawinglayer/inc/texture/texture.hxx
@@ -28,11 +28,8 @@
 #include <vector>
 #include <functional>
 
-
-namespace drawinglayer
+namespace drawinglayer::texture
 {
-    namespace texture
-    {
         class GeoTexSvx
         {
         public:
@@ -47,14 +44,7 @@ namespace drawinglayer
             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
             virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const;
         };
-    } // end of namespace texture
-} // end of namespace drawinglayer
-
 
-namespace drawinglayer
-{
-    namespace texture
-    {
         /// helper class for processing equal number of matrices and colors
         /// for texture processing
         struct B2DHomMatrixAndBColor
@@ -62,14 +52,7 @@ namespace drawinglayer
             basegfx::B2DHomMatrix   maB2DHomMatrix;
             basegfx::BColor         maBColor;
         };
-    } // end of namespace texture
-} // end of namespace drawinglayer
 
-
-namespace drawinglayer
-{
-    namespace texture
-    {
         class GeoTexSvxGradient : public GeoTexSvx
         {
         protected:
@@ -95,14 +78,7 @@ namespace drawinglayer
                 std::vector< B2DHomMatrixAndBColor >& rEntries,
                 basegfx::BColor& rOuterColor) = 0;
         };
-    } // end of namespace texture
-} // end of namespace drawinglayer
-
 
-namespace drawinglayer
-{
-    namespace texture
-    {
         class GeoTexSvxGradientLinear final : public GeoTexSvxGradient
         {
             double                  mfUnitMinX;
@@ -125,14 +101,7 @@ namespace drawinglayer
                 basegfx::BColor& rOuterColor) override;
             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
         };
-    } // end of namespace texture
-} // end of namespace drawinglayer
-
 
-namespace drawinglayer
-{
-    namespace texture
-    {
         class GeoTexSvxGradientAxial final : public GeoTexSvxGradient
         {
             double                  mfUnitMinX;
@@ -154,14 +123,7 @@ namespace drawinglayer
                 basegfx::BColor& rOuterColor) override;
             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
         };
-    } // end of namespace texture
-} // end of namespace drawinglayer
 
-
-namespace drawinglayer
-{
-    namespace texture
-    {
         class GeoTexSvxGradientRadial final : public GeoTexSvxGradient
         {
         public:
@@ -180,14 +142,7 @@ namespace drawinglayer
                 basegfx::BColor& rOuterColor) override;
             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
         };
-    } // end of namespace texture
-} // end of namespace drawinglayer
 
-
-namespace drawinglayer
-{
-    namespace texture
-    {
         class GeoTexSvxGradientElliptical final : public GeoTexSvxGradient
         {
         public:
@@ -207,14 +162,7 @@ namespace drawinglayer
                 basegfx::BColor& rOuterColor) override;
             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
         };
-    } // end of namespace texture
-} // end of namespace drawinglayer
-
 
-namespace drawinglayer
-{
-    namespace texture
-    {
         class GeoTexSvxGradientSquare final : public GeoTexSvxGradient
         {
         public:
@@ -234,14 +182,7 @@ namespace drawinglayer
                 basegfx::BColor& rOuterColor) override;
             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
         };
-    } // end of namespace texture
-} // end of namespace drawinglayer
-
 
-namespace drawinglayer
-{
-    namespace texture
-    {
         class GeoTexSvxGradientRect final : public GeoTexSvxGradient
         {
         public:
@@ -261,14 +202,7 @@ namespace drawinglayer
                 basegfx::BColor& rOuterColor) override;
             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
         };
-    } // end of namespace texture
-} // end of namespace drawinglayer
-
 
-namespace drawinglayer
-{
-    namespace texture
-    {
         class GeoTexSvxHatch final : public GeoTexSvx
         {
             basegfx::B2DRange                   maOutputRange;
@@ -295,14 +229,7 @@ namespace drawinglayer
             double getDistanceToHatch(const basegfx::B2DPoint& rUV) const;
             const basegfx::B2DHomMatrix& getBackTextureTransform() const;
         };
-    } // end of namespace texture
-} // end of namespace drawinglayer
 
-
-namespace drawinglayer
-{
-    namespace texture
-    {
         // This class applies a tiling to the unit range. The given range
         // will be repeated inside the unit range in X and Y and for each
         // tile a matrix will be created (by appendTransformations) that
@@ -334,8 +261,7 @@ namespace drawinglayer
             void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices) const;
             sal_uInt32 getNumberOfTiles() const;
         };
-    } // end of namespace texture
-} // end of namespace drawinglayer
+} // end of namespace drawinglayer::texture
 
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 8657bbe5ea03cd510b5805054412a56ba59e862c
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 17:09:05 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat May 9 21:10:42 2020 +0200

    drawinglayer: externalize PolygonWavePrimitive2D class
    
    Change-Id: Ib611d55864310d1fade1bee9618f7e1a11587d5e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93828
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/include/drawinglayer/primitive2d/polygonprimitive2d.hxx b/include/drawinglayer/primitive2d/polygonprimitive2d.hxx
index ac56461e35b0..01caf9885cca 100644
--- a/include/drawinglayer/primitive2d/polygonprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/polygonprimitive2d.hxx
@@ -180,7 +180,7 @@ public:
     This primitive defines a waveline based on a PolygonStrokePrimitive2D
     where the wave is defined by wave width and wave length.
  */
-class PolygonWavePrimitive2D final : public PolygonStrokePrimitive2D
+class DRAWINGLAYER_DLLPUBLIC PolygonWavePrimitive2D final : public PolygonStrokePrimitive2D
 {
 private:
     /// wave definition
commit 65097f0541363aee001a7d558b8fcb77b1ffa78f
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 17:07:51 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat May 9 21:09:55 2020 +0200

    drawinglayer: fix comment indent in polygonprimitive2d.hxx
    
    Change-Id: I88c68140686623ef9ea41f0c3de6533c7ca16a03
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93827
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/include/drawinglayer/primitive2d/polygonprimitive2d.hxx b/include/drawinglayer/primitive2d/polygonprimitive2d.hxx
index 142e0d88eb8d..ac56461e35b0 100644
--- a/include/drawinglayer/primitive2d/polygonprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/polygonprimitive2d.hxx
@@ -33,12 +33,12 @@ namespace drawinglayer::primitive2d
 {
 /** PolygonHairlinePrimitive2D class
 
-            This primitive defines a Hairline. Since hairlines are view-dependent,
-            this primitive is view-dependent, too.
+    This primitive defines a Hairline. Since hairlines are view-dependent,
+    this primitive is view-dependent, too.
 
-            This is one of the non-decomposable primitives, so a renderer
-            should process it.
-         */
+    This is one of the non-decomposable primitives, so a renderer
+    should process it.
+ */
 class DRAWINGLAYER_DLLPUBLIC PolygonHairlinePrimitive2D final : public BasePrimitive2D
 {
 private:
@@ -69,13 +69,13 @@ public:
 
 /** PolygonMarkerPrimitive2D class
 
-            This primitive defines a two-colored marker hairline which is
-            dashed with the given dash length. Since hairlines are view-dependent,
-            this primitive is view-dependent, too.
+    This primitive defines a two-colored marker hairline which is
+    dashed with the given dash length. Since hairlines are view-dependent,
+    this primitive is view-dependent, too.
 
-            It will be decomposed to the needed PolygonHairlinePrimitive2D if
-            not handled directly by a renderer.
-         */
+    It will be decomposed to the needed PolygonHairlinePrimitive2D if
+    not handled directly by a renderer.
+ */
 class DRAWINGLAYER_DLLPUBLIC PolygonMarkerPrimitive2D final
     : public BufferedDecompositionPrimitive2D
 {
@@ -127,10 +127,10 @@ public:
 
 /** PolygonStrokePrimitive2D class
 
-            This primitive defines a line with line width, line join, line color
-            and stroke attributes. It will be decomposed dependent on the definition
-            to the needed primitives, e.g. filled PolyPolygons for fat lines.
-         */
+    This primitive defines a line with line width, line join, line color
+    and stroke attributes. It will be decomposed dependent on the definition
+    to the needed primitives, e.g. filled PolyPolygons for fat lines.
+ */
 class DRAWINGLAYER_DLLPUBLIC PolygonStrokePrimitive2D : public BufferedDecompositionPrimitive2D
 {
 private:
@@ -177,9 +177,9 @@ public:
 
 /** PolygonWavePrimitive2D class
 
-            This primitive defines a waveline based on a PolygonStrokePrimitive2D
-            where the wave is defined by wave width and wave length.
-         */
+    This primitive defines a waveline based on a PolygonStrokePrimitive2D
+    where the wave is defined by wave width and wave length.
+ */
 class PolygonWavePrimitive2D final : public PolygonStrokePrimitive2D
 {
 private:
@@ -221,10 +221,10 @@ public:
 
 /** PolygonStrokeArrowPrimitive2D class
 
-            This primitive defines a PolygonStrokePrimitive2D,
-            possibly extended by start and end definitions, which are
-            normally used for arrows.
-         */
+    This primitive defines a PolygonStrokePrimitive2D,
+    possibly extended by start and end definitions, which are
+    normally used for arrows.
+ */
 class DRAWINGLAYER_DLLPUBLIC PolygonStrokeArrowPrimitive2D final : public PolygonStrokePrimitive2D
 {
 private:
commit 101f78eb24cf52ff77ae6afbedac3cd9d36755c5
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 11:53:04 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat May 9 21:09:15 2020 +0200

    vcl: move XmpMetadata in vcl/Library_vcl.mk to the correct place
    
    Change-Id: I17d4be68f8655f291a53ac5dc33cdd53e10f8e57
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93826
    Tested-by: Tomaž Vajngerl <quikee at gmail.com>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index def727918433..64fe3ecb5edf 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -316,6 +316,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/gdi/TypeSerializer \
     vcl/source/pdf/ResourceDict \
     vcl/source/pdf/Matrix3 \
+    vcl/source/pdf/XmpMetadata \
     vcl/source/graphic/GraphicID \
     vcl/source/graphic/GraphicLoader \
     vcl/source/graphic/GraphicObject \
@@ -455,7 +456,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/fontsubset/sft \
     vcl/source/fontsubset/ttcr \
     vcl/source/fontsubset/xlat \
-    vcl/source/pdf/XmpMetadata \
     vcl/source/uitest/logger \
     vcl/source/uitest/uiobject \
     vcl/source/uitest/uitest \
commit 9e2a9f4151babc6cb22553798ee70f7f623924db
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue May 5 23:20:38 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat May 9 21:08:28 2020 +0200

    remove vclmetafileprocessor2d.{cxx,hxx} from clang-format blacklist
    
    Change-Id: I53f7660a22ed66ab7d50370d871f9d10d1bedc10
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93825
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index d853820abbdc..231bf8bc9259 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -76,2215 +76,2241 @@ using namespace com::sun::star;
 // To be on the safe side with the old tools polygon, use slightly less than
 // the theoretical maximum (bad experiences with tools polygon)
 
-#define MAX_POLYGON_POINT_COUNT_METAFILE    (0x0000fff0)
+#define MAX_POLYGON_POINT_COUNT_METAFILE (0x0000fff0)
 
 namespace
 {
-    // #112245# helper to split line polygon in half
-    void splitLinePolygon(
-        const basegfx::B2DPolygon& rBasePolygon,
-        basegfx::B2DPolygon& o_aLeft,
-        basegfx::B2DPolygon& o_aRight)
+// #112245# helper to split line polygon in half
+void splitLinePolygon(const basegfx::B2DPolygon& rBasePolygon, basegfx::B2DPolygon& o_aLeft,
+                      basegfx::B2DPolygon& o_aRight)
+{
+    const sal_uInt32 nCount(rBasePolygon.count());
+
+    if (nCount)
     {
-        const sal_uInt32 nCount(rBasePolygon.count());
+        const sal_uInt32 nHalfCount((nCount - 1) >> 1);
 
-        if(nCount)
-        {
-            const sal_uInt32 nHalfCount((nCount - 1) >> 1);
+        o_aLeft = basegfx::B2DPolygon(rBasePolygon, 0, nHalfCount + 1);
+        o_aLeft.setClosed(false);
 
-            o_aLeft = basegfx::B2DPolygon(rBasePolygon, 0, nHalfCount + 1);
-            o_aLeft.setClosed(false);
+        o_aRight = basegfx::B2DPolygon(rBasePolygon, nHalfCount, nCount - nHalfCount);
+        o_aRight.setClosed(false);
 
-            o_aRight = basegfx::B2DPolygon(rBasePolygon, nHalfCount, nCount - nHalfCount);
-            o_aRight.setClosed(false);
+        if (rBasePolygon.isClosed())
+        {
+            o_aRight.append(rBasePolygon.getB2DPoint(0));
 
-            if(rBasePolygon.isClosed())
+            if (rBasePolygon.areControlPointsUsed())
             {
-                o_aRight.append(rBasePolygon.getB2DPoint(0));
-
-                if(rBasePolygon.areControlPointsUsed())
-                {
-                    o_aRight.setControlPoints(
-                        o_aRight.count() - 1,
-                        rBasePolygon.getPrevControlPoint(0),
-                        rBasePolygon.getNextControlPoint(0));
-                }
+                o_aRight.setControlPoints(o_aRight.count() - 1, rBasePolygon.getPrevControlPoint(0),
+                                          rBasePolygon.getNextControlPoint(0));
             }
         }
-        else
-        {
-            o_aLeft.clear();
-            o_aRight.clear();
-        }
     }
-
-    // #112245# helper to evtl. split filled polygons to maximum metafile point count
-    void fillPolyPolygonNeededToBeSplit(basegfx::B2DPolyPolygon& rPolyPolygon)
+    else
     {
-        const sal_uInt32 nPolyCount(rPolyPolygon.count());
+        o_aLeft.clear();
+        o_aRight.clear();
+    }
+}
 
-        if(!nPolyCount)
-            return;
+// #112245# helper to evtl. split filled polygons to maximum metafile point count
+void fillPolyPolygonNeededToBeSplit(basegfx::B2DPolyPolygon& rPolyPolygon)
+{
+    const sal_uInt32 nPolyCount(rPolyPolygon.count());
 
-        basegfx::B2DPolyPolygon aSplitted;
+    if (!nPolyCount)
+        return;
 
-        for(sal_uInt32 a(0); a < nPolyCount; a++)
+    basegfx::B2DPolyPolygon aSplitted;
+
+    for (sal_uInt32 a(0); a < nPolyCount; a++)
+    {
+        const basegfx::B2DPolygon& aCandidate(rPolyPolygon.getB2DPolygon(a));
+        const sal_uInt32 nPointCount(aCandidate.count());
+        bool bNeedToSplit(false);
+
+        if (aCandidate.areControlPointsUsed())
+        {
+            // compare with the maximum for bezier curved polygons
+            bNeedToSplit = nPointCount > ((MAX_POLYGON_POINT_COUNT_METAFILE / 3L) - 1);
+        }
+        else
         {
-            const basegfx::B2DPolygon& aCandidate(rPolyPolygon.getB2DPolygon(a));
-            const sal_uInt32 nPointCount(aCandidate.count());
-            bool bNeedToSplit(false);
+            // compare with the maximum for simple point polygons
+            bNeedToSplit = nPointCount > (MAX_POLYGON_POINT_COUNT_METAFILE - 1);
+        }
 
-            if(aCandidate.areControlPointsUsed())
-            {
-                // compare with the maximum for bezier curved polygons
-                bNeedToSplit = nPointCount > ((MAX_POLYGON_POINT_COUNT_METAFILE / 3L) - 1);
-            }
-            else
-            {
-                // compare with the maximum for simple point polygons
-                bNeedToSplit = nPointCount > (MAX_POLYGON_POINT_COUNT_METAFILE - 1);
-            }
+        if (bNeedToSplit)
+        {
+            // need to split the partial polygon
+            const basegfx::B2DRange aRange(aCandidate.getB2DRange());
+            const basegfx::B2DPoint aCenter(aRange.getCenter());
 
-            if(bNeedToSplit)
+            if (aRange.getWidth() > aRange.getHeight())
             {
-                // need to split the partial polygon
-                const basegfx::B2DRange aRange(aCandidate.getB2DRange());
-                const basegfx::B2DPoint aCenter(aRange.getCenter());
-
-                if(aRange.getWidth() > aRange.getHeight())
-                {
-                    // clip in left and right
-                    const basegfx::B2DPolyPolygon aLeft(
-                        basegfx::utils::clipPolygonOnParallelAxis(
-                            aCandidate,
-                            false,
-                            true,
-                            aCenter.getX(),
-                            false));
-                    const basegfx::B2DPolyPolygon aRight(
-                        basegfx::utils::clipPolygonOnParallelAxis(
-                            aCandidate,
-                            false,
-                            false,
-                            aCenter.getX(),
-                            false));
-
-                    aSplitted.append(aLeft);
-                    aSplitted.append(aRight);
-                }
-                else
-                {
-                    // clip in top and bottom
-                    const basegfx::B2DPolyPolygon aTop(
-                        basegfx::utils::clipPolygonOnParallelAxis(
-                            aCandidate,
-                            true,
-                            true,
-                            aCenter.getY(),
-                            false));
-                    const basegfx::B2DPolyPolygon aBottom(
-                        basegfx::utils::clipPolygonOnParallelAxis(
-                            aCandidate,
-                            true,
-                            false,
-                            aCenter.getY(),
-                            false));
-
-                    aSplitted.append(aTop);
-                    aSplitted.append(aBottom);
-                }
+                // clip in left and right
+                const basegfx::B2DPolyPolygon aLeft(basegfx::utils::clipPolygonOnParallelAxis(
+                    aCandidate, false, true, aCenter.getX(), false));
+                const basegfx::B2DPolyPolygon aRight(basegfx::utils::clipPolygonOnParallelAxis(
+                    aCandidate, false, false, aCenter.getX(), false));
+
+                aSplitted.append(aLeft);
+                aSplitted.append(aRight);
             }
             else
             {
-                aSplitted.append(aCandidate);
+                // clip in top and bottom
+                const basegfx::B2DPolyPolygon aTop(basegfx::utils::clipPolygonOnParallelAxis(
+                    aCandidate, true, true, aCenter.getY(), false));
+                const basegfx::B2DPolyPolygon aBottom(basegfx::utils::clipPolygonOnParallelAxis(
+                    aCandidate, true, false, aCenter.getY(), false));
+
+                aSplitted.append(aTop);
+                aSplitted.append(aBottom);
             }
         }
-
-        if(aSplitted.count() != nPolyCount)
+        else
         {
-            rPolyPolygon = aSplitted;
+            aSplitted.append(aCandidate);
         }
     }
 
-    /** Filter input polypolygon for effectively empty sub-fills
+    if (aSplitted.count() != nPolyCount)
+    {
+        rPolyPolygon = aSplitted;
+    }
+}
+
+/** Filter input polypolygon for effectively empty sub-fills
 
-        Needed to fix fdo#37559
+    Needed to fix fdo#37559
 
-        @param rPoly
-        tools::PolyPolygon to filter
+    @param rPoly
+    tools::PolyPolygon to filter
 
-        @return converted tools PolyPolygon, w/o one-point fills
-     */
-    ::tools::PolyPolygon getFillPolyPolygon( const ::basegfx::B2DPolyPolygon& rPoly )
+    @return converted tools PolyPolygon, w/o one-point fills
+ */
+tools::PolyPolygon getFillPolyPolygon(const ::basegfx::B2DPolyPolygon& rPoly)
+{
+    // filter input rPoly
+    basegfx::B2DPolyPolygon aPoly;
+    sal_uInt32 nCount(rPoly.count());
+    for (sal_uInt32 i = 0; i < nCount; ++i)
     {
-        // filter input rPoly
-        basegfx::B2DPolyPolygon aPoly;
-        sal_uInt32 nCount(rPoly.count());
-        for( sal_uInt32 i=0; i<nCount; ++i )
-        {
-            const basegfx::B2DPolygon& aCandidate(rPoly.getB2DPolygon(i));
-            if( !aCandidate.isClosed() || aCandidate.count() > 1 )
-                aPoly.append(aCandidate);
-        }
-        return ::tools::PolyPolygon(aPoly);
+        const basegfx::B2DPolygon& aCandidate(rPoly.getB2DPolygon(i));
+        if (!aCandidate.isClosed() || aCandidate.count() > 1)
+            aPoly.append(aCandidate);
     }
+    return tools::PolyPolygon(aPoly);
+}
 
 } // end of anonymous namespace
 
 namespace drawinglayer::processor2d
 {
-        ::tools::Rectangle VclMetafileProcessor2D::impDumpToMetaFile(
-            const primitive2d::Primitive2DContainer& rContent,
-            GDIMetaFile& o_rContentMetafile)
-        {
-            // Prepare VDev, MetaFile and connections
-            OutputDevice* pLastOutputDevice = mpOutputDevice;
-            GDIMetaFile* pLastMetafile = mpMetaFile;
-            basegfx::B2DRange aPrimitiveRange(rContent.getB2DRange(getViewInformation2D()));
-
-            // transform primitive range with current transformation (e.g shadow offset)
-            aPrimitiveRange.transform(maCurrentTransformation);
-
-            const ::tools::Rectangle aPrimitiveRectangle(
-                basegfx::fround(aPrimitiveRange.getMinX()), basegfx::fround(aPrimitiveRange.getMinY()),
-                basegfx::fround(aPrimitiveRange.getMaxX()), basegfx::fround(aPrimitiveRange.getMaxY()));
-            ScopedVclPtrInstance< VirtualDevice > aContentVDev;
-            MapMode aNewMapMode(pLastOutputDevice->GetMapMode());
-
-            mpOutputDevice = aContentVDev.get();
-            mpMetaFile = &o_rContentMetafile;
-            aContentVDev->EnableOutput(false);
-            aContentVDev->SetMapMode(pLastOutputDevice->GetMapMode());
-            o_rContentMetafile.Record(aContentVDev.get());
-            aContentVDev->SetLineColor(pLastOutputDevice->GetLineColor());
-            aContentVDev->SetFillColor(pLastOutputDevice->GetFillColor());
-            aContentVDev->SetFont(pLastOutputDevice->GetFont());
-            aContentVDev->SetDrawMode(pLastOutputDevice->GetDrawMode());
-            aContentVDev->SetSettings(pLastOutputDevice->GetSettings());
-            aContentVDev->SetRefPoint(pLastOutputDevice->GetRefPoint());
-
-            // dump to MetaFile
-            process(rContent);
-
-            // cleanups
-            o_rContentMetafile.Stop();
-            o_rContentMetafile.WindStart();
-            aNewMapMode.SetOrigin(aPrimitiveRectangle.TopLeft());
-            o_rContentMetafile.SetPrefMapMode(aNewMapMode);
-            o_rContentMetafile.SetPrefSize(aPrimitiveRectangle.GetSize());
-            mpOutputDevice = pLastOutputDevice;
-            mpMetaFile = pLastMetafile;
-
-            return aPrimitiveRectangle;
-        }
-
-        void VclMetafileProcessor2D::impConvertFillGradientAttributeToVCLGradient(
-            Gradient& o_rVCLGradient,
-            const attribute::FillGradientAttribute& rFiGrAtt,
-            bool bIsTransparenceGradient) const
-        {
-            if(bIsTransparenceGradient)
-            {
-                // it's about transparence channel intensities (black/white), do not use color modifier
-                o_rVCLGradient.SetStartColor(Color(rFiGrAtt.getStartColor()));
-                o_rVCLGradient.SetEndColor(Color(rFiGrAtt.getEndColor()));
-            }
-            else
-            {
-                // use color modifier to influence start/end color of gradient
-                o_rVCLGradient.SetStartColor(Color(maBColorModifierStack.getModifiedColor(rFiGrAtt.getStartColor())));
-                o_rVCLGradient.SetEndColor(Color(maBColorModifierStack.getModifiedColor(rFiGrAtt.getEndColor())));
-            }
+tools::Rectangle
+VclMetafileProcessor2D::impDumpToMetaFile(const primitive2d::Primitive2DContainer& rContent,
+                                          GDIMetaFile& o_rContentMetafile)
+{
+    // Prepare VDev, MetaFile and connections
+    OutputDevice* pLastOutputDevice = mpOutputDevice;
+    GDIMetaFile* pLastMetafile = mpMetaFile;
+    basegfx::B2DRange aPrimitiveRange(rContent.getB2DRange(getViewInformation2D()));
+
+    // transform primitive range with current transformation (e.g shadow offset)
+    aPrimitiveRange.transform(maCurrentTransformation);
+
+    const tools::Rectangle aPrimitiveRectangle(
+        basegfx::fround(aPrimitiveRange.getMinX()), basegfx::fround(aPrimitiveRange.getMinY()),
+        basegfx::fround(aPrimitiveRange.getMaxX()), basegfx::fround(aPrimitiveRange.getMaxY()));
+    ScopedVclPtrInstance<VirtualDevice> aContentVDev;
+    MapMode aNewMapMode(pLastOutputDevice->GetMapMode());
+
+    mpOutputDevice = aContentVDev.get();
+    mpMetaFile = &o_rContentMetafile;
+    aContentVDev->EnableOutput(false);
+    aContentVDev->SetMapMode(pLastOutputDevice->GetMapMode());
+    o_rContentMetafile.Record(aContentVDev.get());
+    aContentVDev->SetLineColor(pLastOutputDevice->GetLineColor());
+    aContentVDev->SetFillColor(pLastOutputDevice->GetFillColor());
+    aContentVDev->SetFont(pLastOutputDevice->GetFont());
+    aContentVDev->SetDrawMode(pLastOutputDevice->GetDrawMode());
+    aContentVDev->SetSettings(pLastOutputDevice->GetSettings());
+    aContentVDev->SetRefPoint(pLastOutputDevice->GetRefPoint());
+
+    // dump to MetaFile
+    process(rContent);
+
+    // cleanups
+    o_rContentMetafile.Stop();
+    o_rContentMetafile.WindStart();
+    aNewMapMode.SetOrigin(aPrimitiveRectangle.TopLeft());
+    o_rContentMetafile.SetPrefMapMode(aNewMapMode);
+    o_rContentMetafile.SetPrefSize(aPrimitiveRectangle.GetSize());
+    mpOutputDevice = pLastOutputDevice;
+    mpMetaFile = pLastMetafile;
+
+    return aPrimitiveRectangle;
+}
+
+void VclMetafileProcessor2D::impConvertFillGradientAttributeToVCLGradient(
+    Gradient& o_rVCLGradient, const attribute::FillGradientAttribute& rFiGrAtt,
+    bool bIsTransparenceGradient) const
+{
+    if (bIsTransparenceGradient)
+    {
+        // it's about transparence channel intensities (black/white), do not use color modifier
+        o_rVCLGradient.SetStartColor(Color(rFiGrAtt.getStartColor()));
+        o_rVCLGradient.SetEndColor(Color(rFiGrAtt.getEndColor()));
+    }
+    else
+    {
+        // use color modifier to influence start/end color of gradient
+        o_rVCLGradient.SetStartColor(
+            Color(maBColorModifierStack.getModifiedColor(rFiGrAtt.getStartColor())));
+        o_rVCLGradient.SetEndColor(
+            Color(maBColorModifierStack.getModifiedColor(rFiGrAtt.getEndColor())));
+    }
 
-            o_rVCLGradient.SetAngle(static_cast< sal_uInt16 >(rFiGrAtt.getAngle() * (1.0 / F_PI1800)));
-            o_rVCLGradient.SetBorder(static_cast< sal_uInt16 >(rFiGrAtt.getBorder() * 100.0));
-            o_rVCLGradient.SetOfsX(static_cast< sal_uInt16 >(rFiGrAtt.getOffsetX() * 100.0));
-            o_rVCLGradient.SetOfsY(static_cast< sal_uInt16 >(rFiGrAtt.getOffsetY() * 100.0));
-            o_rVCLGradient.SetSteps(rFiGrAtt.getSteps());
+    o_rVCLGradient.SetAngle(static_cast<sal_uInt16>(rFiGrAtt.getAngle() * (1.0 / F_PI1800)));
+    o_rVCLGradient.SetBorder(static_cast<sal_uInt16>(rFiGrAtt.getBorder() * 100.0));
+    o_rVCLGradient.SetOfsX(static_cast<sal_uInt16>(rFiGrAtt.getOffsetX() * 100.0));
+    o_rVCLGradient.SetOfsY(static_cast<sal_uInt16>(rFiGrAtt.getOffsetY() * 100.0));
+    o_rVCLGradient.SetSteps(rFiGrAtt.getSteps());
 
-            // defaults for intensity; those were computed into the start/end colors already
-            o_rVCLGradient.SetStartIntensity(100);
-            o_rVCLGradient.SetEndIntensity(100);
+    // defaults for intensity; those were computed into the start/end colors already
+    o_rVCLGradient.SetStartIntensity(100);
+    o_rVCLGradient.SetEndIntensity(100);
 
-            switch(rFiGrAtt.getStyle())
-            {
-                default : // attribute::GradientStyle::Linear :
-                {
-                    o_rVCLGradient.SetStyle(GradientStyle::Linear);
-                    break;
-                }
-                case attribute::GradientStyle::Axial :
-                {
-                    o_rVCLGradient.SetStyle(GradientStyle::Axial);
-                    break;
-                }
-                case attribute::GradientStyle::Radial :
-                {
-                    o_rVCLGradient.SetStyle(GradientStyle::Radial);
-                    break;
-                }
-                case attribute::GradientStyle::Elliptical :
-                {
-                    o_rVCLGradient.SetStyle(GradientStyle::Elliptical);
-                    break;
-                }
-                case attribute::GradientStyle::Square :
-                {
-                    o_rVCLGradient.SetStyle(GradientStyle::Square);
-                    break;
-                }
-                case attribute::GradientStyle::Rect :
-                {
-                    o_rVCLGradient.SetStyle(GradientStyle::Rect);
-                    break;
-                }
-            }
+    switch (rFiGrAtt.getStyle())
+    {
+        default: // attribute::GradientStyle::Linear :
+        {
+            o_rVCLGradient.SetStyle(GradientStyle::Linear);
+            break;
         }
-
-        void VclMetafileProcessor2D::impStartSvtGraphicFill(SvtGraphicFill const * pSvtGraphicFill)
+        case attribute::GradientStyle::Axial:
         {
-            if(pSvtGraphicFill && !mnSvtGraphicFillCount)
-            {
-                SvMemoryStream aMemStm;
-
-                WriteSvtGraphicFill( aMemStm, *pSvtGraphicFill );
-                mpMetaFile->AddAction(new MetaCommentAction("XPATHFILL_SEQ_BEGIN", 0, static_cast< const sal_uInt8* >(aMemStm.GetData()), aMemStm.TellEnd()));
-                mnSvtGraphicFillCount++;
-            }
+            o_rVCLGradient.SetStyle(GradientStyle::Axial);
+            break;
         }
-
-        void VclMetafileProcessor2D::impEndSvtGraphicFill(SvtGraphicFill const * pSvtGraphicFill)
+        case attribute::GradientStyle::Radial:
         {
-            if(pSvtGraphicFill && mnSvtGraphicFillCount)
-            {
-                mnSvtGraphicFillCount--;
-                mpMetaFile->AddAction(new MetaCommentAction("XPATHFILL_SEQ_END"));
-            }
+            o_rVCLGradient.SetStyle(GradientStyle::Radial);
+            break;
         }
-
-        double VclMetafileProcessor2D::getTransformedLineWidth( double fWidth ) const
+        case attribute::GradientStyle::Elliptical:
         {
-            // #i113922# the LineWidth is duplicated in the MetaPolylineAction,
-            // and also inside the SvtGraphicStroke and needs transforming into
-            // the same space as its coordinates here cf. fdo#61789
-            // This is a partial fix. When an object transformation is used which
-            // e.g. contains a scaleX != scaleY, an unproportional scaling will happen.
-            const basegfx::B2DVector aDiscreteUnit( maCurrentTransformation * basegfx::B2DVector( fWidth, 0.0 ) );
-
-            return aDiscreteUnit.getLength();
+            o_rVCLGradient.SetStyle(GradientStyle::Elliptical);
+            break;
         }
-
-        std::unique_ptr<SvtGraphicStroke> VclMetafileProcessor2D::impTryToCreateSvtGraphicStroke(
-            const basegfx::B2DPolygon& rB2DPolygon,
-            const basegfx::BColor* pColor,
-            const attribute::LineAttribute* pLineAttribute,
-            const attribute::StrokeAttribute* pStrokeAttribute,
-            const attribute::LineStartEndAttribute* pStart,
-            const attribute::LineStartEndAttribute* pEnd)
+        case attribute::GradientStyle::Square:
+        {
+            o_rVCLGradient.SetStyle(GradientStyle::Square);
+            break;
+        }
+        case attribute::GradientStyle::Rect:
         {
-            std::unique_ptr<SvtGraphicStroke> pRetval;
+            o_rVCLGradient.SetStyle(GradientStyle::Rect);
+            break;
+        }
+    }
+}
 
-            if(rB2DPolygon.count() && !mnSvtGraphicStrokeCount)
-            {
-                basegfx::B2DPolygon aLocalPolygon(rB2DPolygon);
-                basegfx::BColor aStrokeColor;
-                basegfx::B2DPolyPolygon aStartArrow;
-                basegfx::B2DPolyPolygon aEndArrow;
+void VclMetafileProcessor2D::impStartSvtGraphicFill(SvtGraphicFill const* pSvtGraphicFill)
+{
+    if (pSvtGraphicFill && !mnSvtGraphicFillCount)
+    {
+        SvMemoryStream aMemStm;
 
-                if(pColor)
-                {
-                    aStrokeColor = *pColor;
-                }
-                else if(pLineAttribute)
-                {
-                    aStrokeColor = maBColorModifierStack.getModifiedColor(pLineAttribute->getColor());
-                }
+        WriteSvtGraphicFill(aMemStm, *pSvtGraphicFill);
+        mpMetaFile->AddAction(new MetaCommentAction(
+            "XPATHFILL_SEQ_BEGIN", 0, static_cast<const sal_uInt8*>(aMemStm.GetData()),
+            aMemStm.TellEnd()));
+        mnSvtGraphicFillCount++;
+    }
+}
 
-                // It IS needed to record the stroke color at all in the metafile,
-                // SvtGraphicStroke has NO entry for stroke color(!)
-                mpOutputDevice->SetLineColor(Color(aStrokeColor));
+void VclMetafileProcessor2D::impEndSvtGraphicFill(SvtGraphicFill const* pSvtGraphicFill)
+{
+    if (pSvtGraphicFill && mnSvtGraphicFillCount)
+    {
+        mnSvtGraphicFillCount--;
+        mpMetaFile->AddAction(new MetaCommentAction("XPATHFILL_SEQ_END"));
+    }
+}
 
-                if(!aLocalPolygon.isClosed())
-                {
-                    double fPolyLength(0.0);
-                    double fStart(0.0);
-                    double fEnd(0.0);
-
-                    if(pStart && pStart->isActive())
-                    {
-                        fPolyLength = basegfx::utils::getLength(aLocalPolygon);
-
-                        aStartArrow = basegfx::utils::createAreaGeometryForLineStartEnd(
-                            aLocalPolygon, pStart->getB2DPolyPolygon(), true, pStart->getWidth(),
-                            fPolyLength, pStart->isCentered() ? 0.5 : 0.0, &fStart);
-                    }
-
-                    if(pEnd && pEnd->isActive())
-                    {
-                        if(basegfx::fTools::equalZero(fPolyLength))
-                        {
-                            fPolyLength = basegfx::utils::getLength(aLocalPolygon);
-                        }
-
-                        aEndArrow = basegfx::utils::createAreaGeometryForLineStartEnd(
-                            aLocalPolygon, pEnd->getB2DPolyPolygon(), false, pEnd->getWidth(),
-                            fPolyLength, pEnd->isCentered() ? 0.5 : 0.0, &fEnd);
-                    }
-
-                    if(0.0 != fStart || 0.0 != fEnd)
-                    {
-                        // build new poly, consume something from old poly
-                        aLocalPolygon = basegfx::utils::getSnippetAbsolute(aLocalPolygon, fStart, fPolyLength - fEnd, fPolyLength);
-                    }
-                }
+double VclMetafileProcessor2D::getTransformedLineWidth(double fWidth) const
+{
+    // #i113922# the LineWidth is duplicated in the MetaPolylineAction,
+    // and also inside the SvtGraphicStroke and needs transforming into
+    // the same space as its coordinates here cf. fdo#61789
+    // This is a partial fix. When an object transformation is used which
+    // e.g. contains a scaleX != scaleY, an unproportional scaling will happen.
+    const basegfx::B2DVector aDiscreteUnit(maCurrentTransformation
+                                           * basegfx::B2DVector(fWidth, 0.0));
+
+    return aDiscreteUnit.getLength();
+}
+
+std::unique_ptr<SvtGraphicStroke> VclMetafileProcessor2D::impTryToCreateSvtGraphicStroke(
+    const basegfx::B2DPolygon& rB2DPolygon, const basegfx::BColor* pColor,
+    const attribute::LineAttribute* pLineAttribute,
+    const attribute::StrokeAttribute* pStrokeAttribute,
+    const attribute::LineStartEndAttribute* pStart, const attribute::LineStartEndAttribute* pEnd)
+{
+    std::unique_ptr<SvtGraphicStroke> pRetval;
 
-                SvtGraphicStroke::JoinType eJoin(SvtGraphicStroke::joinNone);
-                SvtGraphicStroke::CapType eCap(SvtGraphicStroke::capButt);
-                double fLineWidth(0.0);
-                double fMiterLength(0.0);
-                SvtGraphicStroke::DashArray aDashArray;
+    if (rB2DPolygon.count() && !mnSvtGraphicStrokeCount)
+    {
+        basegfx::B2DPolygon aLocalPolygon(rB2DPolygon);
+        basegfx::BColor aStrokeColor;
+        basegfx::B2DPolyPolygon aStartArrow;
+        basegfx::B2DPolyPolygon aEndArrow;
 
-                if(pLineAttribute)
-                {
-                    fLineWidth = fMiterLength = getTransformedLineWidth( pLineAttribute->getWidth() );
-
-                    // get Join
-                    switch(pLineAttribute->getLineJoin())
-                    {
-                        case basegfx::B2DLineJoin::NONE :
-                        {
-                            eJoin = SvtGraphicStroke::joinNone;
-                            break;
-                        }
-                        case basegfx::B2DLineJoin::Bevel :
-                        {
-                            eJoin = SvtGraphicStroke::joinBevel;
-                            break;
-                        }
-                        case basegfx::B2DLineJoin::Miter :
-                        {
-                            eJoin = SvtGraphicStroke::joinMiter;
-                            // ATM 15 degrees is assumed
-                            fMiterLength /= rtl::math::sin(basegfx::deg2rad(15.0));
-                            break;
-                        }
-                        case basegfx::B2DLineJoin::Round :
-                        {
-                            eJoin = SvtGraphicStroke::joinRound;
-                            break;
-                        }
-                    }
-
-                    // get stroke
-                    switch(pLineAttribute->getLineCap())
-                    {
-                        default: /* css::drawing::LineCap_BUTT */
-                        {
-                            eCap = SvtGraphicStroke::capButt;
-                            break;
-                        }
-                        case css::drawing::LineCap_ROUND:
-                        {
-                            eCap = SvtGraphicStroke::capRound;
-                            break;
-                        }
-                        case css::drawing::LineCap_SQUARE:
-                        {
-                            eCap = SvtGraphicStroke::capSquare;
-                            break;
-                        }
-                    }
-                }
+        if (pColor)
+        {
+            aStrokeColor = *pColor;
+        }
+        else if (pLineAttribute)
+        {
+            aStrokeColor = maBColorModifierStack.getModifiedColor(pLineAttribute->getColor());
+        }
 
-                if(pStrokeAttribute)
-                {
-                    // copy dash array
-                    aDashArray = pStrokeAttribute->getDotDashArray();
-                }
+        // It IS needed to record the stroke color at all in the metafile,
+        // SvtGraphicStroke has NO entry for stroke color(!)
+        mpOutputDevice->SetLineColor(Color(aStrokeColor));
 
-                // #i101734# apply current object transformation to created geometry.

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list