[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - 59 commits - basctl/Library_basctl.mk basegfx/source basic/source bean/native bin/lo-all-static-libs bridges/source canvas/source chart2/qa chart2/source comphelper/source compilerplugins/clang connectivity/source cppcanvas/source cppuhelper/source cppu/source cui/source desktop/source desktop/unx drawinglayer/CppunitTest_drawinglayer_border.mk drawinglayer/inc drawinglayer/Library_drawinglayercore.mk drawinglayer/Library_drawinglayer.mk drawinglayer/Module_drawinglayer.mk drawinglayer/source editeng/source embeddedobj/source emfio/CppunitTest_emfio_emf_test.mk emfio/Library_emfio.mk emfio/source extensions/source external/skia filter/Library_svgfilter.mk filter/source forms/source formula/source fpicker/source helpcontent2 icon-themes/elementary icon-themes/elementary_svg icon-themes/sifr icon-themes/sifr_dark icon-themes/sifr_dark_svg icon-themes/sifr_svg icon-themes/sukapura icon-themes/sukapura_svg include/drawinglayer includ e/editeng include/LibreOfficeKit include/svx include/vcl libreofficekit/source Repository.mk sc/CppunitTest_sc_ucalc.mk sc/Library_sc.mk sc/qa sc/source sd/CppunitTest_sd_uimpress.mk sd/Library_sd.mk sd/qa sd/source sfx2/Library_sfx.mk sfx2/source solenv/bin solenv/clang-format svgio/CppunitTest_svgio.mk svgio/Library_svgio.mk svx/CppunitTest_svx_unit.mk svx/Library_svxcore.mk svx/Library_svx.mk svx/sdi sw/CppunitTest_sw_uwriter.mk sw/Library_sw.mk sw/Library_swui.mk sw/qa sw/sdi sw/source sw/uiconfig ucb/source vcl/inc vcl/Library_vcl.mk vcl/qt5 vcl/source vcl/unx writerfilter/source

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 14 18:51:16 UTC 2020


Rebased ref, commits from common ancestor:
commit d25ccab84a61a5c4bd4168a92b9f27b0931ed986
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Apr 14 20:48:56 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Apr 14 20:50:09 2020 +0200

    use pragma once
    
    Change-Id: Ia78cc4ee565a5f39835499764b1f2d0a2a72c5ba

diff --git a/include/vcl/GraphicNativeMetadata.hxx b/include/vcl/GraphicNativeMetadata.hxx
index b6b162556e76..118efa480df8 100644
--- a/include/vcl/GraphicNativeMetadata.hxx
+++ b/include/vcl/GraphicNativeMetadata.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_GRAPHICNATIVEMETADATA_HXX
-#define INCLUDED_VCL_GRAPHICNATIVEMETADATA_HXX
+#pragma once
 
 #include <vcl/graph.hxx>
 
@@ -34,6 +33,4 @@ public:
     sal_uInt16 getRotation() const { return mRotation;}
 };
 
-#endif // INCLUDED_VCL_GRAPHICNATIVEMETADATA_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/GraphicNativeTransform.hxx b/include/vcl/GraphicNativeTransform.hxx
index c8203377dc55..318327bf5b66 100644
--- a/include/vcl/GraphicNativeTransform.hxx
+++ b/include/vcl/GraphicNativeTransform.hxx
@@ -17,12 +17,12 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_GRAPHICNATIVETRANSFORM_HXX
-#define INCLUDED_VCL_GRAPHICNATIVETRANSFORM_HXX
+#pragma once
 
 #include <rtl/ustring.hxx>
 #include <sal/types.h>
 #include <vcl/dllapi.h>
+
 class Graphic;
 
 class VCL_DLLPUBLIC GraphicNativeTransform final
@@ -40,6 +40,4 @@ public:
     void rotate(sal_uInt16 aRotation);
 };
 
-#endif // INCLUDED_VCL_GRAPHICNATIVETRANSFORM_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/filter/jpeg/Exif.hxx b/vcl/source/filter/jpeg/Exif.hxx
index 47c34e427810..6052a44842da 100644
--- a/vcl/source/filter/jpeg/Exif.hxx
+++ b/vcl/source/filter/jpeg/Exif.hxx
@@ -17,12 +17,12 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_SOURCE_FILTER_JPEG_EXIF_HXX
-#define INCLUDED_VCL_SOURCE_FILTER_JPEG_EXIF_HXX
+#pragma once
 
 #include <tools/stream.hxx>
 
 namespace exif {
+
 enum Orientation {
     TOP_LEFT        = 1,
     TOP_RIGHT       = 2,
@@ -80,6 +80,4 @@ public:
 
 };
 
-#endif // INCLUDED_VCL_SOURCE_FILTER_JPEG_EXIF_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit c3d0a80643b38f054377497794c73e56863e2098
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Apr 12 13:30:56 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Apr 14 20:50:09 2020 +0200

    move GlowPrimitive processing in VclPixelProcessor to own method
    
    The new method is processGlowPrimitive.
    
    Change-Id: I3e7eb9fc5ac45095dd0f6c3bff7d036e05864d89

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 9102230f4305..e94637a9a7fe 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -40,6 +40,7 @@
 #include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
 #include <drawinglayer/primitive2d/transformprimitive2d.hxx>
 #include <drawinglayer/primitive2d/markerarrayprimitive2d.hxx>
+#include <drawinglayer/primitive2d/glowprimitive2d.hxx>
 #include <primitive2d/pointarrayprimitive2d.hxx>
 #include <drawinglayer/primitive2d/wrongspellprimitive2d.hxx>
 #include <drawinglayer/primitive2d/controlprimitive2d.hxx>
@@ -356,43 +357,7 @@ namespace drawinglayer::processor2d
                 }
                 case PRIMITIVE2D_ID_GLOWPRIMITIVE2D:
                 {
-                    basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
-                    aRange.transform(maCurrentTransformation);
-                    aRange.grow(10.0);
-                    impBufferDevice aBufferDevice(*mpOutputDevice, aRange);
-                    if(aBufferDevice.isVisible())
-                    {
-                        // remember last OutDev and set to content
-                        OutputDevice* pLastOutputDevice = mpOutputDevice;
-                        mpOutputDevice = &aBufferDevice.getTransparence();
-                        // paint content to virtual device
-                        mpOutputDevice->Erase();
-                        process(rCandidate);
-
-                        // obtain result as a bitmap
-                        auto bitmap = mpOutputDevice->GetBitmapEx(Point(aRange.getMinX(), aRange.getMinY()), Size(aRange.getWidth(), aRange.getHeight()));
-                        constexpr double nRadius = 5.0;
-                        bitmap.Scale(Size(aRange.getWidth()-nRadius, aRange.getHeight()-nRadius));
-                        // use bitmap later as mask
-                        auto mask = bitmap.GetBitmap();
-
-                        mpOutputDevice = &aBufferDevice.getContent();
-                        process(rCandidate);
-                        bitmap = mpOutputDevice->GetBitmapEx(Point(aRange.getMinX(), aRange.getMinY()), Size(aRange.getWidth(), aRange.getHeight()));
-                        bitmap.Scale(Size(aRange.getWidth()-nRadius, aRange.getHeight()-nRadius));
-
-                        // calculate blurry effect
-                        BitmapFilterStackBlur glowFilter(nRadius);
-                        BitmapFilter::Filter(bitmap, glowFilter);
-                        // back to old OutDev
-                        mpOutputDevice = pLastOutputDevice;
-                        mpOutputDevice->DrawBitmapEx(Point(aRange.getMinX()-nRadius/2, aRange.getMinY()-nRadius/2), BitmapEx(bitmap.GetBitmap(), mask));
-
-                        // paint result
-                        //aBufferDevice.paint();
-                    }
-                    else
-                        SAL_WARN("drawinglayer", "Temporary buffered virtual device is not visible");
+                    processGlowPrimitive2D(static_cast<const drawinglayer::primitive2d::GlowPrimitive2D&>(rCandidate));
                     break;
                 }
                 default :
@@ -880,6 +845,46 @@ namespace drawinglayer::processor2d
             }
         }
 
+        void VclPixelProcessor2D::processGlowPrimitive2D(const primitive2d::GlowPrimitive2D& rCandidate)
+        {
+            basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+            aRange.transform(maCurrentTransformation);
+            aRange.grow(10.0);
+            impBufferDevice aBufferDevice(*mpOutputDevice, aRange);
+            if (aBufferDevice.isVisible())
+            {
+                // remember last OutDev and set to content
+                OutputDevice* pLastOutputDevice = mpOutputDevice;
+                mpOutputDevice = &aBufferDevice.getTransparence();
+                // paint content to virtual device
+                mpOutputDevice->Erase();
+                process(rCandidate);
+
+                // obtain result as a bitmap
+                auto bitmap = mpOutputDevice->GetBitmapEx(Point(aRange.getMinX(), aRange.getMinY()), Size(aRange.getWidth(), aRange.getHeight()));
+                constexpr double nRadius = 5.0;
+                bitmap.Scale(Size(aRange.getWidth()-nRadius, aRange.getHeight()-nRadius));
+                // use bitmap later as mask
+                auto mask = bitmap.GetBitmap();
+
+                mpOutputDevice = &aBufferDevice.getContent();
+                process(rCandidate);
+                bitmap = mpOutputDevice->GetBitmapEx(Point(aRange.getMinX(), aRange.getMinY()), Size(aRange.getWidth(), aRange.getHeight()));
+                bitmap.Scale(Size(aRange.getWidth()-nRadius, aRange.getHeight()-nRadius));
+
+                // calculate blurry effect
+                BitmapFilterStackBlur glowFilter(nRadius);
+                BitmapFilter::Filter(bitmap, glowFilter);
+                // back to old OutDev
+                mpOutputDevice = pLastOutputDevice;
+                mpOutputDevice->DrawBitmapEx(Point(aRange.getMinX()-nRadius/2, aRange.getMinY()-nRadius/2), BitmapEx(bitmap.GetBitmap(), mask));
+
+                // paint result
+                //aBufferDevice.paint();
+            }
+            else
+                SAL_WARN("drawinglayer", "Temporary buffered virtual device is not visible");
+        }
 } // end of namespace
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
index 5c834056c947..fd72efe41d16 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
@@ -39,6 +39,7 @@ class PolygonStrokePrimitive2D;
 class FillHatchPrimitive2D;
 class BackgroundColorPrimitive2D;
 class BorderLinePrimitive2D;
+class GlowPrimitive2D;
 }
 
 namespace drawinglayer::processor2d
@@ -93,6 +94,7 @@ class VclPixelProcessor2D final : public VclProcessor2D
     processBorderLinePrimitive2D(const drawinglayer::primitive2d::BorderLinePrimitive2D& rBorder);
     void processInvertPrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
     void processMetaFilePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+    void processGlowPrimitive2D(const primitive2d::GlowPrimitive2D& rCandidate);
 
 public:
     /// constructor/destructor
commit 2680e109608ed99b4630685535d3aa21e8679592
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Apr 12 13:22:26 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Apr 14 20:50:09 2020 +0200

    fdo#43157: VclPixelProcessor2D replace OSL_ENSURE with SAL_WARN_IF
    
    Change-Id: I4a6c46f9054f9a32d52f1f60f5f7547e62cf7a5a

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 972c08481040..9102230f4305 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -581,7 +581,7 @@ namespace drawinglayer::processor2d
                                 {
                                     // single transparent tools::PolyPolygon identified, use directly
                                     const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = static_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(pBasePrimitive);
-                                    OSL_ENSURE(pPoPoColor, "OOps, PrimitiveID and PrimitiveType do not match (!)");
+                                    SAL_WARN_IF(!pPoPoColor, "drawinglayer", "OOps, PrimitiveID and PrimitiveType do not match (!)");
                                     bDrawTransparentUsed = true;
                                     tryDrawPolyPolygonColorPrimitive2DDirect(*pPoPoColor, rUniTransparenceCandidate.getTransparence());
                                     break;
@@ -590,7 +590,7 @@ namespace drawinglayer::processor2d
                                 {
                                     // single transparent PolygonHairlinePrimitive2D identified, use directly
                                     const primitive2d::PolygonHairlinePrimitive2D* pPoHair = static_cast< const primitive2d::PolygonHairlinePrimitive2D* >(pBasePrimitive);
-                                    OSL_ENSURE(pPoHair, "OOps, PrimitiveID and PrimitiveType do not match (!)");
+                                    SAL_WARN_IF(!pPoHair, "drawinglayer", "OOps, PrimitiveID and PrimitiveType do not match (!)");
 
                                     // do no tallow by default - problem is that self-overlapping parts of this geometry will
                                     // not be in an all-same transparency but will already alpha-cover themselves with blending.
@@ -604,7 +604,7 @@ namespace drawinglayer::processor2d
                                 {
                                     // single transparent PolygonStrokePrimitive2D identified, use directly
                                     const primitive2d::PolygonStrokePrimitive2D* pPoStroke = static_cast< const primitive2d::PolygonStrokePrimitive2D* >(pBasePrimitive);
-                                    OSL_ENSURE(pPoStroke, "OOps, PrimitiveID and PrimitiveType do not match (!)");
+                                    SAL_WARN_IF(!pPoStroke, "drawinglayer", "OOps, PrimitiveID and PrimitiveType do not match (!)");
 
                                     // do no tallow by default - problem is that self-overlapping parts of this geometry will
                                     // not be in an all-same transparency but will already alpha-cover themselves with blending.
commit 78754c17bcc822dbccf904f40455afe93d60a23a
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Apr 12 13:17:28 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Apr 14 20:50:09 2020 +0200

    remove vclpixelprocessor2d.hxx from clang-format blacklist
    
    Change-Id: I5fe33322ff0df5191f57f1364a2d32eefc889d68

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
index 1ee765ab1e51..5c834056c947 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
@@ -24,69 +24,81 @@
 
 #include <memory>
 
-namespace drawinglayer::primitive2d {
-    class PolyPolygonColorPrimitive2D;
-    class PolygonHairlinePrimitive2D;
-    class PolygonStrokePrimitive2D;
-    class WrongSpellPrimitive2D;
-    class TextSimplePortionPrimitive;
-    class BitmapPrimitive2D;
-    class PolyPolygonGradientPrimitive2D;
-    class UnifiedTransparencePrimitive2D;
-    class ControlPrimitive2D;
-    class PolygonStrokePrimitive2D;
-    class FillHatchPrimitive2D;
-    class BackgroundColorPrimitive2D;
-    class BorderLinePrimitive2D;
+namespace drawinglayer::primitive2d
+{
+class PolyPolygonColorPrimitive2D;
+class PolygonHairlinePrimitive2D;
+class PolygonStrokePrimitive2D;
+class WrongSpellPrimitive2D;
+class TextSimplePortionPrimitive;
+class BitmapPrimitive2D;
+class PolyPolygonGradientPrimitive2D;
+class UnifiedTransparencePrimitive2D;
+class ControlPrimitive2D;
+class PolygonStrokePrimitive2D;
+class FillHatchPrimitive2D;
+class BackgroundColorPrimitive2D;
+class BorderLinePrimitive2D;
 }
 
 namespace drawinglayer::processor2d
 {
-        /** VclPixelProcessor2D class
+/** VclPixelProcessor2D class
 
-            This processor derived from VclProcessor2D is the base class for rendering
-            all fed primitives to a VCL Window. It is the currently used renderer
-            for all VCL editing output from the DrawingLayer.
-         */
-        class VclPixelProcessor2D final : public VclProcessor2D
-        {
-            struct Impl;
-            std::unique_ptr<Impl> m_pImpl;
+    This processor derived from VclProcessor2D is the base class for rendering
+    all fed primitives to a VCL Window. It is the currently used renderer
+    for all VCL editing output from the DrawingLayer.
+ */
+class VclPixelProcessor2D final : public VclProcessor2D
+{
+    struct Impl;
+    std::unique_ptr<Impl> m_pImpl;
 
-            /*  the local processor for BasePrimitive2D-Implementation based primitives,
-                called from the common process()-implementation
-             */
-            virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate) override;
+    /*  the local processor for BasePrimitive2D-Implementation based primitives,
+        called from the common process()-implementation
+     */
+    virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate) override;
 
-            // some helpers to try direct paints (shortcuts)
-            void tryDrawPolyPolygonColorPrimitive2DDirect(const drawinglayer::primitive2d::PolyPolygonColorPrimitive2D& rSource, double fTransparency);
-            bool tryDrawPolygonHairlinePrimitive2DDirect(const drawinglayer::primitive2d::PolygonHairlinePrimitive2D& rSource, double fTransparency);
-            bool tryDrawPolygonStrokePrimitive2DDirect(const drawinglayer::primitive2d::PolygonStrokePrimitive2D& rSource, double fTransparency);
+    // some helpers to try direct paints (shortcuts)
+    void tryDrawPolyPolygonColorPrimitive2DDirect(
+        const primitive2d::PolyPolygonColorPrimitive2D& rSource, double fTransparency);
+    bool
+    tryDrawPolygonHairlinePrimitive2DDirect(const primitive2d::PolygonHairlinePrimitive2D& rSource,
+                                            double fTransparency);
+    bool tryDrawPolygonStrokePrimitive2DDirect(const primitive2d::PolygonStrokePrimitive2D& rSource,
+                                               double fTransparency);
 
-            void processWrongSpellPrimitive2D(const primitive2d::WrongSpellPrimitive2D& rWrongSpellPrimitive);
-            void processTextSimplePortionPrimitive2D(const primitive2d::TextSimplePortionPrimitive2D& rCandidate);
-            void processTextDecoratedPortionPrimitive2D(const primitive2d::TextSimplePortionPrimitive2D& rCandidate);
-            void processPolygonHairlinePrimitive2D(const primitive2d::PolygonHairlinePrimitive2D& rPolygonHairlinePrimitive2D);
-            void processBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate);
-            void processPolyPolygonGradientPrimitive2D(const primitive2d::PolyPolygonGradientPrimitive2D& rPolygonCandidate);
-            void processPolyPolygonColorPrimitive2D(const primitive2d::PolyPolygonColorPrimitive2D& rPolyPolygonColorPrimitive2D);
-            void processUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate);
-            void processControlPrimitive2D(const primitive2d::ControlPrimitive2D& rControlPrimitive);
-            void processPolygonStrokePrimitive2D(const primitive2d::PolygonStrokePrimitive2D& rPolygonStrokePrimitive2D);
-            void processFillHatchPrimitive2D(const primitive2d::FillHatchPrimitive2D& rFillHatchPrimitive);
-            void processBackgroundColorPrimitive2D(const primitive2d::BackgroundColorPrimitive2D& rPrimitive);
-            void processBorderLinePrimitive2D(const drawinglayer::primitive2d::BorderLinePrimitive2D& rBorder);
-            void processInvertPrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
-            void processMetaFilePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+    void
+    processWrongSpellPrimitive2D(const primitive2d::WrongSpellPrimitive2D& rWrongSpellPrimitive);
+    void processTextSimplePortionPrimitive2D(
+        const primitive2d::TextSimplePortionPrimitive2D& rCandidate);
+    void processTextDecoratedPortionPrimitive2D(
+        const primitive2d::TextSimplePortionPrimitive2D& rCandidate);
+    void processPolygonHairlinePrimitive2D(
+        const primitive2d::PolygonHairlinePrimitive2D& rPolygonHairlinePrimitive2D);
+    void processBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate);
+    void processPolyPolygonGradientPrimitive2D(
+        const primitive2d::PolyPolygonGradientPrimitive2D& rPolygonCandidate);
+    void processPolyPolygonColorPrimitive2D(
+        const primitive2d::PolyPolygonColorPrimitive2D& rPolyPolygonColorPrimitive2D);
+    void processUnifiedTransparencePrimitive2D(
+        const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate);
+    void processControlPrimitive2D(const primitive2d::ControlPrimitive2D& rControlPrimitive);
+    void processPolygonStrokePrimitive2D(
+        const primitive2d::PolygonStrokePrimitive2D& rPolygonStrokePrimitive2D);
+    void processFillHatchPrimitive2D(const primitive2d::FillHatchPrimitive2D& rFillHatchPrimitive);
+    void
+    processBackgroundColorPrimitive2D(const primitive2d::BackgroundColorPrimitive2D& rPrimitive);
+    void
+    processBorderLinePrimitive2D(const drawinglayer::primitive2d::BorderLinePrimitive2D& rBorder);
+    void processInvertPrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+    void processMetaFilePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
 
-        public:
-            /// constructor/destructor
-            VclPixelProcessor2D(
-                const geometry::ViewInformation2D& rViewInformation,
-                OutputDevice& rOutDev);
-            virtual ~VclPixelProcessor2D() override;
-        };
+public:
+    /// constructor/destructor
+    VclPixelProcessor2D(const geometry::ViewInformation2D& rViewInformation, OutputDevice& rOutDev);
+    virtual ~VclPixelProcessor2D() override;
+};
 } // end of namespace drawinglayer::processor2d
 
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index 7da40d322789..d92622eb77a1 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -3757,7 +3757,6 @@ drawinglayer/source/processor2d/vclhelperbufferdevice.hxx
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
 drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
-drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
 drawinglayer/source/processor2d/vclprocessor2d.cxx
 drawinglayer/source/processor3d/baseprocessor3d.cxx
 drawinglayer/source/processor3d/cutfindprocessor3d.cxx
commit 61babf2d3593c0ef22865e803fc294f724b638e1
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Apr 12 13:09:36 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Apr 14 20:50:08 2020 +0200

    remove vclprocessor2d.hxx from clang-format blacklist
    
    Change-Id: I4fda4b3431c63d5870f074be15cff6064dc1ff95

diff --git a/drawinglayer/source/processor2d/vclprocessor2d.hxx b/drawinglayer/source/processor2d/vclprocessor2d.hxx
index 73cf8d5b1a8d..3b1b997a7cc4 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.hxx
@@ -27,99 +27,111 @@
 
 class OutputDevice;
 
-namespace drawinglayer::primitive2d {
-    class TextSimplePortionPrimitive2D;
-    class PolygonHairlinePrimitive2D;
-    class BitmapPrimitive2D;
-    class FillGraphicPrimitive2D;
-    class PolyPolygonGradientPrimitive2D;
-    class PolyPolygonGraphicPrimitive2D;
-    class MetafilePrimitive2D;
-    class MaskPrimitive2D;
-    class UnifiedTransparencePrimitive2D;
-    class TransparencePrimitive2D;
-    class TransformPrimitive2D;
-    class MarkerArrayPrimitive2D;
-    class PointArrayPrimitive2D;
-    class ModifiedColorPrimitive2D;
-    class PolygonStrokePrimitive2D;
-    class ControlPrimitive2D;
-    class PagePreviewPrimitive2D;
-    class EpsPrimitive2D;
-    class ObjectInfoPrimitive2D;
-    class SvgLinearAtomPrimitive2D;
-    class SvgRadialAtomPrimitive2D;
+namespace drawinglayer::primitive2d
+{
+class TextSimplePortionPrimitive2D;
+class PolygonHairlinePrimitive2D;
+class BitmapPrimitive2D;
+class FillGraphicPrimitive2D;
+class PolyPolygonGradientPrimitive2D;
+class PolyPolygonGraphicPrimitive2D;
+class MetafilePrimitive2D;
+class MaskPrimitive2D;
+class UnifiedTransparencePrimitive2D;
+class TransparencePrimitive2D;
+class TransformPrimitive2D;
+class MarkerArrayPrimitive2D;
+class PointArrayPrimitive2D;
+class ModifiedColorPrimitive2D;
+class PolygonStrokePrimitive2D;
+class ControlPrimitive2D;
+class PagePreviewPrimitive2D;
+class EpsPrimitive2D;
+class ObjectInfoPrimitive2D;
+class SvgLinearAtomPrimitive2D;
+class SvgRadialAtomPrimitive2D;
 }
 
 namespace drawinglayer::processor2d
 {
-        /** VclProcessor2D class
-
-            This processor is the base class for VCL-Based processors. It has no
-            processBasePrimitive2D implementation and thus is not usable directly.
-         */
-        class VclProcessor2D : public BaseProcessor2D
-        {
-        protected:
-            // the destination OutDev
-            VclPtr<OutputDevice>                                    mpOutputDevice;
-
-            // the modifiedColorPrimitive stack
-            basegfx::BColorModifierStack                            maBColorModifierStack;
-
-            // the current transformation. Since VCL pixel renderer transforms to pixels
-            // and VCL MetaFile renderer to World (logic) coordinates, the local
-            // ViewInformation2D cannot directly be used, but needs to be kept up to date
-            basegfx::B2DHomMatrix                                   maCurrentTransformation;
-
-            // SvtOptionsDrawinglayer incarnation to react on diverse settings
-            const SvtOptionsDrawinglayer                            maDrawinglayerOpt;
-
-            // stack value (increment and decrement) to count how deep we are in
-            // PolygonStrokePrimitive2D's decompositions (normally only one)
-            sal_uInt32                                              mnPolygonStrokePrimitive2D;
-
-            // currently used ObjectInfoPrimitive2D
-            const primitive2d::ObjectInfoPrimitive2D*               mpObjectInfoPrimitive2D;
-
-            // common VCL rendering support
-            void RenderTextSimpleOrDecoratedPortionPrimitive2D(const primitive2d::TextSimplePortionPrimitive2D& rTextCandidate);
-            void RenderPolygonHairlinePrimitive2D(const primitive2d::PolygonHairlinePrimitive2D& rPolygonCandidate, bool bPixelBased);
-            void RenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate);
-            void RenderFillGraphicPrimitive2D(const primitive2d::FillGraphicPrimitive2D& rFillBitmapCandidate);
-            void RenderPolyPolygonGraphicPrimitive2D(const primitive2d::PolyPolygonGraphicPrimitive2D& rPolygonCandidate);
-            void RenderMaskPrimitive2DPixel(const primitive2d::MaskPrimitive2D& rMaskCandidate);
-            void RenderModifiedColorPrimitive2D(const primitive2d::ModifiedColorPrimitive2D& rModifiedCandidate);
-            void RenderUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D& rTransCandidate);
-            void RenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D& rTransCandidate);
-            void RenderTransformPrimitive2D(const primitive2d::TransformPrimitive2D& rTransformCandidate);
-            void RenderPagePreviewPrimitive2D(const primitive2d::PagePreviewPrimitive2D& rPagePreviewCandidate);
-            void RenderMarkerArrayPrimitive2D(const primitive2d::MarkerArrayPrimitive2D& rMarkerArrayCandidate);
-            void RenderPointArrayPrimitive2D(const primitive2d::PointArrayPrimitive2D& rPointArrayCandidate);
-            void RenderPolygonStrokePrimitive2D(const primitive2d::PolygonStrokePrimitive2D& rPolygonStrokeCandidate);
-            void RenderEpsPrimitive2D(const primitive2d::EpsPrimitive2D& rEpsPrimitive2D);
-            void RenderObjectInfoPrimitive2D(const primitive2d::ObjectInfoPrimitive2D& rObjectInfoPrimitive2D);
-            void RenderSvgLinearAtomPrimitive2D(const primitive2d::SvgLinearAtomPrimitive2D& rCandidate);
-            void RenderSvgRadialAtomPrimitive2D(const primitive2d::SvgRadialAtomPrimitive2D& rCandidate);
-
-            // DrawMode adaptation support
-            void adaptLineToFillDrawMode() const;
-            void adaptTextToFillDrawMode() const;
-
-        public:
-            // constructor/destructor
-            VclProcessor2D(
-                const geometry::ViewInformation2D& rViewInformation,
-                OutputDevice& rOutDev);
-            virtual ~VclProcessor2D() override;
-
-            // access to Drawinglayer configuration options
-            const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; }
-
-            // access to currently used ObjectInfoPrimitive2D
-            const primitive2d::ObjectInfoPrimitive2D* getObjectInfoPrimitive2D() const { return mpObjectInfoPrimitive2D; }
-        };
-} // end of namespace drawinglayer::processor2d
+/** VclProcessor2D class
 
+    This processor is the base class for VCL-Based processors. It has no
+    processBasePrimitive2D implementation and thus is not usable directly.
+ */
+class VclProcessor2D : public BaseProcessor2D
+{
+protected:
+    // the destination OutDev
+    VclPtr<OutputDevice> mpOutputDevice;
+
+    // the modifiedColorPrimitive stack
+    basegfx::BColorModifierStack maBColorModifierStack;
+
+    // the current transformation. Since VCL pixel renderer transforms to pixels
+    // and VCL MetaFile renderer to World (logic) coordinates, the local
+    // ViewInformation2D cannot directly be used, but needs to be kept up to date
+    basegfx::B2DHomMatrix maCurrentTransformation;
+
+    // SvtOptionsDrawinglayer incarnation to react on diverse settings
+    const SvtOptionsDrawinglayer maDrawinglayerOpt;
+
+    // stack value (increment and decrement) to count how deep we are in
+    // PolygonStrokePrimitive2D's decompositions (normally only one)
+    sal_uInt32 mnPolygonStrokePrimitive2D;
+
+    // currently used ObjectInfoPrimitive2D
+    const primitive2d::ObjectInfoPrimitive2D* mpObjectInfoPrimitive2D;
+
+    // common VCL rendering support
+    void RenderTextSimpleOrDecoratedPortionPrimitive2D(
+        const primitive2d::TextSimplePortionPrimitive2D& rTextCandidate);
+    void RenderPolygonHairlinePrimitive2D(
+        const primitive2d::PolygonHairlinePrimitive2D& rPolygonCandidate, bool bPixelBased);
+    void RenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate);
+    void
+    RenderFillGraphicPrimitive2D(const primitive2d::FillGraphicPrimitive2D& rFillBitmapCandidate);
+    void RenderPolyPolygonGraphicPrimitive2D(
+        const primitive2d::PolyPolygonGraphicPrimitive2D& rPolygonCandidate);
+    void RenderMaskPrimitive2DPixel(const primitive2d::MaskPrimitive2D& rMaskCandidate);
+    void
+    RenderModifiedColorPrimitive2D(const primitive2d::ModifiedColorPrimitive2D& rModifiedCandidate);
+    void RenderUnifiedTransparencePrimitive2D(
+        const primitive2d::UnifiedTransparencePrimitive2D& rTransCandidate);
+    void RenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D& rTransCandidate);
+    void RenderTransformPrimitive2D(const primitive2d::TransformPrimitive2D& rTransformCandidate);
+    void
+    RenderPagePreviewPrimitive2D(const primitive2d::PagePreviewPrimitive2D& rPagePreviewCandidate);
+    void
+    RenderMarkerArrayPrimitive2D(const primitive2d::MarkerArrayPrimitive2D& rMarkerArrayCandidate);
+    void
+    RenderPointArrayPrimitive2D(const primitive2d::PointArrayPrimitive2D& rPointArrayCandidate);
+    void RenderPolygonStrokePrimitive2D(
+        const primitive2d::PolygonStrokePrimitive2D& rPolygonStrokeCandidate);
+    void RenderEpsPrimitive2D(const primitive2d::EpsPrimitive2D& rEpsPrimitive2D);
+    void
+    RenderObjectInfoPrimitive2D(const primitive2d::ObjectInfoPrimitive2D& rObjectInfoPrimitive2D);
+    void RenderSvgLinearAtomPrimitive2D(const primitive2d::SvgLinearAtomPrimitive2D& rCandidate);
+    void RenderSvgRadialAtomPrimitive2D(const primitive2d::SvgRadialAtomPrimitive2D& rCandidate);
+
+    // DrawMode adaptation support
+    void adaptLineToFillDrawMode() const;
+    void adaptTextToFillDrawMode() const;
+
+public:
+    // constructor/destructor
+    VclProcessor2D(const geometry::ViewInformation2D& rViewInformation, OutputDevice& rOutDev);
+    virtual ~VclProcessor2D() override;
+
+    // access to Drawinglayer configuration options
+    const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; }
+
+    // access to currently used ObjectInfoPrimitive2D
+    const primitive2d::ObjectInfoPrimitive2D* getObjectInfoPrimitive2D() const
+    {
+        return mpObjectInfoPrimitive2D;
+    }
+};
+} // end of namespace drawinglayer::processor2d
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index 58eb54478155..7da40d322789 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -3759,7 +3759,6 @@ drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
 drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
 drawinglayer/source/processor2d/vclprocessor2d.cxx
-drawinglayer/source/processor2d/vclprocessor2d.hxx
 drawinglayer/source/processor3d/baseprocessor3d.cxx
 drawinglayer/source/processor3d/cutfindprocessor3d.cxx
 drawinglayer/source/processor3d/defaultprocessor3d.cxx
commit 04ab3931cab8e98abbcea10336da0ab52de7f928
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Apr 12 13:05:17 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Apr 14 20:50:08 2020 +0200

    clean-up namespaces and pragma once for VclPixelProcessor2D
    
    Change-Id: I34fa0dc5cadbdfff8f70171715bc7cff462f7034

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
index b1c7c47c2386..1ee765ab1e51 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
@@ -17,18 +17,14 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_DRAWINGLAYER_SOURCE_PROCESSOR2D_VCLPIXELPROCESSOR2D_HXX
-#define INCLUDED_DRAWINGLAYER_SOURCE_PROCESSOR2D_VCLPIXELPROCESSOR2D_HXX
+#pragma once
 
 #include "vclprocessor2d.hxx"
 #include <vcl/outdev.hxx>
 
 #include <memory>
 
-
-// predefines
-
-namespace drawinglayer { namespace primitive2d {
+namespace drawinglayer::primitive2d {
     class PolyPolygonColorPrimitive2D;
     class PolygonHairlinePrimitive2D;
     class PolygonStrokePrimitive2D;
@@ -42,12 +38,10 @@ namespace drawinglayer { namespace primitive2d {
     class FillHatchPrimitive2D;
     class BackgroundColorPrimitive2D;
     class BorderLinePrimitive2D;
-}}
+}
 
-namespace drawinglayer
+namespace drawinglayer::processor2d
 {
-    namespace processor2d
-    {
         /** VclPixelProcessor2D class
 
             This processor derived from VclProcessor2D is the base class for rendering
@@ -92,10 +86,7 @@ namespace drawinglayer
                 OutputDevice& rOutDev);
             virtual ~VclPixelProcessor2D() override;
         };
-    } // end of namespace processor2d
-} // end of namespace drawinglayer
-
+} // end of namespace drawinglayer::processor2d
 
-#endif // INCLUDED_DRAWINGLAYER_SOURCE_PROCESSOR2D_VCLPIXELPROCESSOR2D_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 7e4134573c9bbfb5f474ff91198bcf422d322c62
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Apr 12 13:04:55 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Apr 14 20:50:08 2020 +0200

    clean-up namespaces and pragma once for VclProcessor2D
    
    Change-Id: I9518a0bc6c30e0a544a52f1e996bfe8195e63cdf

diff --git a/drawinglayer/source/processor2d/vclprocessor2d.hxx b/drawinglayer/source/processor2d/vclprocessor2d.hxx
index 46b9682d1383..73cf8d5b1a8d 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_DRAWINGLAYER_SOURCE_PROCESSOR2D_VCLPROCESSOR2D_HXX
-#define INCLUDED_DRAWINGLAYER_SOURCE_PROCESSOR2D_VCLPROCESSOR2D_HXX
+#pragma once
 
 #include <drawinglayer/processor2d/baseprocessor2d.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
@@ -26,11 +25,9 @@
 #include <svtools/optionsdrawinglayer.hxx>
 #include <vcl/vclptr.hxx>
 
-
-// predefines
 class OutputDevice;
 
-namespace drawinglayer { namespace primitive2d {
+namespace drawinglayer::primitive2d {
     class TextSimplePortionPrimitive2D;
     class PolygonHairlinePrimitive2D;
     class BitmapPrimitive2D;
@@ -52,13 +49,10 @@ namespace drawinglayer { namespace primitive2d {
     class ObjectInfoPrimitive2D;
     class SvgLinearAtomPrimitive2D;
     class SvgRadialAtomPrimitive2D;
-}}
-
+}
 
-namespace drawinglayer
+namespace drawinglayer::processor2d
 {
-    namespace processor2d
-    {
         /** VclProcessor2D class
 
             This processor is the base class for VCL-Based processors. It has no
@@ -125,10 +119,7 @@ namespace drawinglayer
             // access to currently used ObjectInfoPrimitive2D
             const primitive2d::ObjectInfoPrimitive2D* getObjectInfoPrimitive2D() const { return mpObjectInfoPrimitive2D; }
         };
-    } // end of namespace processor2d
-} // end of namespace drawinglayer
-
+} // end of namespace drawinglayer::processor2d
 
-#endif // INCLUDED_DRAWINGLAYER_SOURCE_PROCESSOR2D_VCLPROCESSOR2D_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit e02c91e9d4c49a811c51e5261a57fc0e1706a83b
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: Tue Apr 14 20:50:08 2020 +0200

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

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index e4430b2415f3..44aa8f821dae 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 50bdf3b3ca72..3be86dd6c72b 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 810cfb6b4b20b0a0ee39d47972db182473d1b778
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: Tue Apr 14 20:50: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 83e8ffa6d885..52b4db88e46e 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -351,6 +351,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 25a23a7d3a9e..df6a684135ed 100644
--- a/drawinglayer/inc/pch/precompiled_drawinglayer.hxx
+++ b/drawinglayer/inc/pch/precompiled_drawinglayer.hxx
@@ -13,7 +13,7 @@
  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-04-02 22:28:40 using:
+ Generated on 2020-04-03 17:41:44 using:
  ./bin/update_pch drawinglayer drawinglayer --cutoff=4 --exclude:system --exclude:module --exclude:local
 
  If after updating build fails, use the following command to locate conflicting headers:
@@ -92,7 +92,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>
@@ -104,7 +103,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>
@@ -137,7 +136,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>
@@ -145,9 +143,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 e04cad7e6667..d6e445744152 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 80fcdae920f3..fdf5f0165249 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 b6d75fd890bf..d99c59a58a4b 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 bc66bf4608557d757555aef1f46abf8a15c3538b
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Apr 14 16:10:40 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Apr 14 20:46:19 2020 +0200

    loplugin:flatten in desktop
    
    Change-Id: I1ab39e041025692cac06eb6602787f16a3a9cb0c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92198
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 888b6a139014..9bded29ddcc7 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -304,21 +304,22 @@ void SetRestartState() {
 }
 
 void DoRestartActionsIfNecessary(bool quickstart) {
-    if (quickstart) {
-        try {
-            if (officecfg::Setup::Office::OfficeRestartInProgress::get()) {
-                std::shared_ptr< comphelper::ConfigurationChanges > batch(
-                    comphelper::ConfigurationChanges::create());
-                officecfg::Setup::Office::OfficeRestartInProgress::set(
-                    false, batch);
-                batch->commit();
-                css::office::Quickstart::createStart(
-                    comphelper::getProcessComponentContext(),
-                    shouldLaunchQuickstart());
-            }
-        } catch (css::uno::Exception &) {
-            TOOLS_WARN_EXCEPTION("desktop.app", "ignoring");
-        }
+    if (!quickstart)
+        return;
+
+    try {
+        if (officecfg::Setup::Office::OfficeRestartInProgress::get()) {
+            std::shared_ptr< comphelper::ConfigurationChanges > batch(
+                comphelper::ConfigurationChanges::create());
+            officecfg::Setup::Office::OfficeRestartInProgress::set(
+                false, batch);
+            batch->commit();
+            css::office::Quickstart::createStart(
+                comphelper::getProcessComponentContext(),
+                shouldLaunchQuickstart());
+        }
+    } catch (css::uno::Exception &) {
+        TOOLS_WARN_EXCEPTION("desktop.app", "ignoring");
     }
 }
 
@@ -496,41 +497,41 @@ void Desktop::Init()
         }
     }
 
-    if ( true )
+    if ( !(true) )
+        return;
+
+    // start ipc thread only for non-remote offices
+    RequestHandler::Status aStatus = RequestHandler::Enable(true);
+    if ( aStatus == RequestHandler::IPC_STATUS_PIPE_ERROR )
     {
-        // start ipc thread only for non-remote offices
-        RequestHandler::Status aStatus = RequestHandler::Enable(true);
-        if ( aStatus == RequestHandler::IPC_STATUS_PIPE_ERROR )
-        {
 #if defined ANDROID
-            // Ignore crack pipe errors on Android
+        // Ignore crack pipe errors on Android
 #else
-            // Keep using this oddly named BE_PATHINFO_MISSING value
-            // for pipe-related errors on other platforms. Of course
-            // this crack with two (if not more) levels of our own
-            // error codes hiding the actual system error code is
-            // broken, but that is done all over the code, let's leave
-            // reengineering that to another year.
-            SetBootstrapError( BE_PATHINFO_MISSING, OUString() );
+        // Keep using this oddly named BE_PATHINFO_MISSING value
+        // for pipe-related errors on other platforms. Of course
+        // this crack with two (if not more) levels of our own
+        // error codes hiding the actual system error code is
+        // broken, but that is done all over the code, let's leave
+        // reengineering that to another year.
+        SetBootstrapError( BE_PATHINFO_MISSING, OUString() );
 #endif
-        }
-        else if ( aStatus == RequestHandler::IPC_STATUS_BOOTSTRAP_ERROR )
-        {
-            SetBootstrapError( BE_PATHINFO_MISSING, OUString() );
-        }
-        else if ( aStatus == RequestHandler::IPC_STATUS_2ND_OFFICE )
-        {
-            // 2nd office startup should terminate after sending cmdlineargs through pipe
-            SetBootstrapStatus(BS_TERMINATE);
-        }
-        else if ( !rCmdLineArgs.GetUnknown().isEmpty()
-                  || rCmdLineArgs.IsHelp() || rCmdLineArgs.IsVersion() )
-        {
-            // disable IPC thread in an instance that is just showing a help message
-            RequestHandler::Disable();
-        }
-        pSignalHandler = osl_addSignalHandler(SalMainPipeExchangeSignal_impl, nullptr);
     }
+    else if ( aStatus == RequestHandler::IPC_STATUS_BOOTSTRAP_ERROR )
+    {
+        SetBootstrapError( BE_PATHINFO_MISSING, OUString() );
+    }
+    else if ( aStatus == RequestHandler::IPC_STATUS_2ND_OFFICE )
+    {
+        // 2nd office startup should terminate after sending cmdlineargs through pipe
+        SetBootstrapStatus(BS_TERMINATE);
+    }
+    else if ( !rCmdLineArgs.GetUnknown().isEmpty()
+              || rCmdLineArgs.IsHelp() || rCmdLineArgs.IsVersion() )
+    {
+        // disable IPC thread in an instance that is just showing a help message
+        RequestHandler::Disable();
+    }
+    pSignalHandler = osl_addSignalHandler(SalMainPipeExchangeSignal_impl, nullptr);
 }
 
 void Desktop::InitFinished()
@@ -616,27 +617,27 @@ void Desktop::Shutdown()
 
 void Desktop::HandleBootstrapPathErrors( ::utl::Bootstrap::Status aBootstrapStatus, const OUString& aDiagnosticMessage )
 {
-    if ( aBootstrapStatus != ::utl::Bootstrap::DATA_OK )
-    {
-        OUString        aProductKey;
-        OUString        aTemp;
+    if ( aBootstrapStatus == ::utl::Bootstrap::DATA_OK )
+        return;
 
-        osl_getExecutableFile( &aProductKey.pData );
-        sal_uInt32     lastIndex = aProductKey.lastIndexOf('/');
-        if ( lastIndex > 0 )
-            aProductKey = aProductKey.copy( lastIndex+1 );
+    OUString        aProductKey;
+    OUString        aTemp;
 
-        aTemp = ::utl::Bootstrap::getProductKey( aProductKey );
-        if ( !aTemp.isEmpty() )
-            aProductKey = aTemp;
+    osl_getExecutableFile( &aProductKey.pData );
+    sal_uInt32     lastIndex = aProductKey.lastIndexOf('/');
+    if ( lastIndex > 0 )
+        aProductKey = aProductKey.copy( lastIndex+1 );
 
-        OUString const aMessage(aDiagnosticMessage + "\n");
+    aTemp = ::utl::Bootstrap::getProductKey( aProductKey );
+    if ( !aTemp.isEmpty() )
+        aProductKey = aTemp;
 
-        std::unique_ptr<weld::MessageDialog> xBootstrapFailedBox(Application::CreateMessageDialog(nullptr,
-                                                                 VclMessageType::Warning, VclButtonsType::Ok, aMessage));
-        xBootstrapFailedBox->set_title(aProductKey);
-        xBootstrapFailedBox->run();
-    }
+    OUString const aMessage(aDiagnosticMessage + "\n");
+
+    std::unique_ptr<weld::MessageDialog> xBootstrapFailedBox(Application::CreateMessageDialog(nullptr,
+                                                             VclMessageType::Warning, VclButtonsType::Ok, aMessage));
+    xBootstrapFailedBox->set_title(aProductKey);
+    xBootstrapFailedBox->run();
 }
 
 // Create an error message depending on bootstrap failure code and an optional file url
@@ -2400,7 +2401,7 @@ void Desktop::OpenSplashScreen()
 {
     const CommandLineArgs &rCmdLine = GetCommandLineArgs();
     // Show intro only if this is normal start (e.g. no server, no quickstart, no printing )
-    if ( !rCmdLine.IsInvisible() &&
+    if ( !(!rCmdLine.IsInvisible() &&
          !rCmdLine.IsHeadless() &&
          !rCmdLine.IsQuickstart() &&
          !rCmdLine.IsMinimized() &&
@@ -2408,43 +2409,43 @@ void Desktop::OpenSplashScreen()
          !rCmdLine.IsTerminateAfterInit() &&
          rCmdLine.GetPrintList().empty() &&
          rCmdLine.GetPrintToList().empty() &&
-         rCmdLine.GetConversionList().empty() )
-    {
-        // Determine application name from command line parameters
-        OUString aAppName;
-        if ( rCmdLine.IsWriter() )
-            aAppName = "writer";
-        else if ( rCmdLine.IsCalc() )
-            aAppName = "calc";
-        else if ( rCmdLine.IsDraw() )
-            aAppName = "draw";
-        else if ( rCmdLine.IsImpress() )
-            aAppName = "impress";
-        else if ( rCmdLine.IsBase() )
-            aAppName = "base";
-        else if ( rCmdLine.IsGlobal() )
-            aAppName = "global";
-        else if ( rCmdLine.IsMath() )
-            aAppName = "math";
-        else if ( rCmdLine.IsWeb() )
-            aAppName = "web";
-
-        // Which splash to use
-        OUString aSplashService( "com.sun.star.office.SplashScreen" );
-        if ( rCmdLine.HasSplashPipe() )
-            aSplashService = "com.sun.star.office.PipeSplashScreen";
-
-        Sequence< Any > aSeq( 2 );
-        aSeq[0] <<= true; // bVisible
-        aSeq[1] <<= aAppName;
-        css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
-        m_rSplashScreen.set(
-            xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aSplashService, aSeq, xContext),
-            UNO_QUERY);
-
-        if(m_rSplashScreen.is())
-                m_rSplashScreen->start("SplashScreen", 100);
-    }
+         rCmdLine.GetConversionList().empty()) )
+        return;
+
+    // Determine application name from command line parameters
+    OUString aAppName;
+    if ( rCmdLine.IsWriter() )
+        aAppName = "writer";
+    else if ( rCmdLine.IsCalc() )
+        aAppName = "calc";
+    else if ( rCmdLine.IsDraw() )
+        aAppName = "draw";
+    else if ( rCmdLine.IsImpress() )
+        aAppName = "impress";
+    else if ( rCmdLine.IsBase() )
+        aAppName = "base";
+    else if ( rCmdLine.IsGlobal() )
+        aAppName = "global";
+    else if ( rCmdLine.IsMath() )
+        aAppName = "math";
+    else if ( rCmdLine.IsWeb() )
+        aAppName = "web";
+
+    // Which splash to use
+    OUString aSplashService( "com.sun.star.office.SplashScreen" );
+    if ( rCmdLine.HasSplashPipe() )
+        aSplashService = "com.sun.star.office.PipeSplashScreen";
+
+    Sequence< Any > aSeq( 2 );
+    aSeq[0] <<= true; // bVisible
+    aSeq[1] <<= aAppName;
+    css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+    m_rSplashScreen.set(
+        xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aSplashService, aSeq, xContext),
+        UNO_QUERY);
+
+    if(m_rSplashScreen.is())
+            m_rSplashScreen->start("SplashScreen", 100);
 
 }
 
@@ -2505,68 +2506,68 @@ void Desktop::ShowBackingComponent(Desktop * progress)
 
     if (xBackingFrame.is())
         xContainerWindow = xBackingFrame->getContainerWindow();
-    if (xContainerWindow.is())
-    {
-        // set the WindowExtendedStyle::Document style. Normally, this is done by the TaskCreator service when a "_blank"
-        // frame/window is created. Since we do not use the TaskCreator here, we need to mimic its behavior,
-        // otherwise documents loaded into this frame will later on miss functionality depending on the style.
-        VclPtr<vcl::Window> pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow );
-        SAL_WARN_IF( !pContainerWindow, "desktop.app", "Desktop::Main: no implementation access to the frame's container window!" );
-        pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WindowExtendedStyle::Document );
-        if (progress != nullptr)
-        {
-            progress->SetSplashScreenProgress(75);
-        }
+    if (!xContainerWindow.is())
+        return;
 
-        Reference< XController > xStartModule = StartModule::createWithParentWindow( xContext, xContainerWindow);
-        // Attention: You MUST(!) call setComponent() before you call attachFrame().
-        // Because the backing component set the property "IsBackingMode" of the frame
-        // to true inside attachFrame(). But setComponent() reset this state everytimes ...
-        xBackingFrame->setComponent(Reference< XWindow >(xStartModule, UNO_QUERY), xStartModule);
-        if (progress != nullptr)
-        {
-            progress->SetSplashScreenProgress(100);
-        }
-        xStartModule->attachFrame(xBackingFrame);
-        if (progress != nullptr)
-        {
-            progress->CloseSplashScreen();
-        }
-        xContainerWindow->setVisible(true);
+    // set the WindowExtendedStyle::Document style. Normally, this is done by the TaskCreator service when a "_blank"
+    // frame/window is created. Since we do not use the TaskCreator here, we need to mimic its behavior,
+    // otherwise documents loaded into this frame will later on miss functionality depending on the style.
+    VclPtr<vcl::Window> pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow );
+    SAL_WARN_IF( !pContainerWindow, "desktop.app", "Desktop::Main: no implementation access to the frame's container window!" );
+    pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WindowExtendedStyle::Document );
+    if (progress != nullptr)
+    {
+        progress->SetSplashScreenProgress(75);
     }
+
+    Reference< XController > xStartModule = StartModule::createWithParentWindow( xContext, xContainerWindow);
+    // Attention: You MUST(!) call setComponent() before you call attachFrame().
+    // Because the backing component set the property "IsBackingMode" of the frame
+    // to true inside attachFrame(). But setComponent() reset this state everytimes ...
+    xBackingFrame->setComponent(Reference< XWindow >(xStartModule, UNO_QUERY), xStartModule);
+    if (progress != nullptr)
+    {
+        progress->SetSplashScreenProgress(100);
+    }
+    xStartModule->attachFrame(xBackingFrame);
+    if (progress != nullptr)
+    {
+        progress->CloseSplashScreen();
+    }
+    xContainerWindow->setVisible(true);
 }
 
 
 void Desktop::CheckFirstRun( )
 {
-    if (officecfg::Office::Common::Misc::FirstRun::get())
-    {
-        // use VCL timer, which won't trigger during shutdown if the
-        // application exits before timeout
-        m_firstRunTimer.Start();
+    if (!officecfg::Office::Common::Misc::FirstRun::get())
+        return;
+
+    // use VCL timer, which won't trigger during shutdown if the
+    // application exits before timeout
+    m_firstRunTimer.Start();
 
 #ifdef _WIN32
-        // Check if Quickstarter should be started (on Windows only)
-        OUString sRootKey = ReplaceStringHookProc("Software\\%OOOVENDOR\\%PRODUCTNAME\\%PRODUCTVERSION");
-        WCHAR szValue[8192];
-        DWORD nValueSize = sizeof(szValue);
-        HKEY hKey;
-        if (ERROR_SUCCESS == RegOpenKeyW(HKEY_LOCAL_MACHINE, o3tl::toW(sRootKey.getStr()), &hKey))
+    // Check if Quickstarter should be started (on Windows only)
+    OUString sRootKey = ReplaceStringHookProc("Software\\%OOOVENDOR\\%PRODUCTNAME\\%PRODUCTVERSION");
+    WCHAR szValue[8192];
+    DWORD nValueSize = sizeof(szValue);
+    HKEY hKey;
+    if (ERROR_SUCCESS == RegOpenKeyW(HKEY_LOCAL_MACHINE, o3tl::toW(sRootKey.getStr()), &hKey))
+    {
+        if ( ERROR_SUCCESS == RegQueryValueExW( hKey, L"RunQuickstartAtFirstStart", nullptr, nullptr, reinterpret_cast<LPBYTE>(szValue), &nValueSize ) )
         {
-            if ( ERROR_SUCCESS == RegQueryValueExW( hKey, L"RunQuickstartAtFirstStart", nullptr, nullptr, reinterpret_cast<LPBYTE>(szValue), &nValueSize ) )
-            {
-                css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
-                css::office::Quickstart::createAutoStart(xContext, true/*Quickstart*/, true/*bAutostart*/);
-                RegCloseKey( hKey );
-            }
+            css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+            css::office::Quickstart::createAutoStart(xContext, true/*Quickstart*/, true/*bAutostart*/);
+            RegCloseKey( hKey );
         }
+    }
 #endif
 
-        std::shared_ptr< comphelper::ConfigurationChanges > batch(
-            comphelper::ConfigurationChanges::create());
-        officecfg::Office::Common::Misc::FirstRun::set(false, batch);
-        batch->commit();
-    }
+    std::shared_ptr< comphelper::ConfigurationChanges > batch(
+        comphelper::ConfigurationChanges::create());
+    officecfg::Office::Common::Misc::FirstRun::set(false, batch);
+    batch->commit();
 }
 
 }
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index b3d0c98cea27..cff0a684cfcf 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -87,35 +87,35 @@ void Desktop::InitApplicationServiceManager()
 
 void Desktop::RegisterServices(Reference< XComponentContext > const & context)
 {
-    if( !m_bServicesRegistered )
-    {
-        // interpret command line arguments
-        CommandLineArgs& rCmdLine = GetCommandLineArgs();
-
-        // Headless mode for FAT Office, auto cancels any dialogs that popup
-        if (rCmdLine.IsEventTesting())
-            Application::EnableEventTestingMode();
-        else if (rCmdLine.IsHeadless())
-            Application::EnableHeadlessMode(false);
-
-        // read accept string from configuration
-        OUString conDcpCfg(
-            officecfg::Setup::Office::ooSetupConnectionURL::get(context));
-        if (!conDcpCfg.isEmpty()) {
-            createAcceptor(conDcpCfg);
-        }
+    if( m_bServicesRegistered )
+        return;
+
+    // interpret command line arguments
+    CommandLineArgs& rCmdLine = GetCommandLineArgs();
+
+    // Headless mode for FAT Office, auto cancels any dialogs that popup
+    if (rCmdLine.IsEventTesting())
+        Application::EnableEventTestingMode();
+    else if (rCmdLine.IsHeadless())
+        Application::EnableHeadlessMode(false);
+
+    // read accept string from configuration
+    OUString conDcpCfg(
+        officecfg::Setup::Office::ooSetupConnectionURL::get(context));
+    if (!conDcpCfg.isEmpty()) {
+        createAcceptor(conDcpCfg);
+    }
 
-        std::vector< OUString > const & conDcp = rCmdLine.GetAccept();
-        for (auto const& elem : conDcp)
-        {
-            createAcceptor(elem);
-        }
+    std::vector< OUString > const & conDcp = rCmdLine.GetAccept();
+    for (auto const& elem : conDcp)
+    {
+        createAcceptor(elem);
+    }
 
-        configureUcb();
+    configureUcb();
 
-        CreateTemporaryDirectory();
-        m_bServicesRegistered = true;
-    }
+    CreateTemporaryDirectory();
+    m_bServicesRegistered = true;
 }
 
 typedef std::map< OUString, css::uno::Reference<css::lang::XInitialization> > AcceptorMap;
@@ -133,35 +133,35 @@ void Desktop::createAcceptor(const OUString& aAcceptString)
     // check whether the requested acceptor already exists
     AcceptorMap &rMap = acceptorMap::get();
     AcceptorMap::const_iterator pIter = rMap.find(aAcceptString);
-    if (pIter == rMap.end() )
+    if (pIter != rMap.end() )
+        return;
+
+    Sequence< Any > aSeq( 2 );
+    aSeq[0] <<= aAcceptString;
+    aSeq[1] <<= bAccept;
+    Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+    Reference<XInitialization> rAcceptor(
+        xContext->getServiceManager()->createInstanceWithContext("com.sun.star.office.Acceptor", xContext),
+        UNO_QUERY );
+    if ( rAcceptor.is() )
     {
-        Sequence< Any > aSeq( 2 );
-        aSeq[0] <<= aAcceptString;
-        aSeq[1] <<= bAccept;
-        Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
-        Reference<XInitialization> rAcceptor(
-            xContext->getServiceManager()->createInstanceWithContext("com.sun.star.office.Acceptor", xContext),
-            UNO_QUERY );
-        if ( rAcceptor.is() )
+        try
         {
-            try
-            {
-                rAcceptor->initialize( aSeq );
-                rMap.emplace(aAcceptString, rAcceptor);
-            }
-            catch (const css::uno::Exception&)
-            {
-                // no error handling needed...
-                // acceptor just won't come up
-                TOOLS_WARN_EXCEPTION( "desktop.app", "Acceptor could not be created");
-            }
+            rAcceptor->initialize( aSeq );
+            rMap.emplace(aAcceptString, rAcceptor);
         }
-        else
+        catch (const css::uno::Exception&)
         {
-            // there is already an acceptor with this description
-            SAL_WARN( "desktop.app", "Acceptor already exists.");
+            // no error handling needed...
+            // acceptor just won't come up
+            TOOLS_WARN_EXCEPTION( "desktop.app", "Acceptor could not be created");
         }
     }
+    else
+    {
+        // there is already an acceptor with this description
+        SAL_WARN( "desktop.app", "Acceptor already exists.");
+    }
 }
 
 namespace {
diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx
index 17b7913c09e3..468ba9368ee5 100644
--- a/desktop/source/app/langselect.cxx
+++ b/desktop/source/app/langselect.cxx
@@ -52,19 +52,20 @@ OUString foundLocale;
 void setMsLangIdFallback(OUString const & locale) {
     // #i32939# setting of default document language
     // See #i42730# for rules for determining source of settings
-    if (!locale.isEmpty()) {
-        LanguageType type = LanguageTag::convertToLanguageTypeWithFallback(locale);
-        switch (SvtLanguageOptions::GetScriptTypeOfLanguage(type)) {
-        case SvtScriptType::ASIAN:
-            MsLangId::setConfiguredAsianFallback(type);
-            break;
-        case SvtScriptType::COMPLEX:
-            MsLangId::setConfiguredComplexFallback(type);
-            break;
-        default:
-            MsLangId::setConfiguredWesternFallback(type);
-            break;
-        }
+    if (locale.isEmpty())
+        return;
+
+    LanguageType type = LanguageTag::convertToLanguageTypeWithFallback(locale);
+    switch (SvtLanguageOptions::GetScriptTypeOfLanguage(type)) {
+    case SvtScriptType::ASIAN:
+        MsLangId::setConfiguredAsianFallback(type);
+        break;
+    case SvtScriptType::COMPLEX:
+        MsLangId::setConfiguredComplexFallback(type);
+        break;
+    default:
+        MsLangId::setConfiguredWesternFallback(type);
+        break;
     }
 }
 
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index 923aab00c702..18c9f4e40dc4 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -869,30 +869,30 @@ void RequestHandler::Disable()
 {
     osl::ClearableMutexGuard aMutex( GetMutex() );
 
-    if( pGlobal.is() )
-    {
-        rtl::Reference< RequestHandler > handler(pGlobal);
-        pGlobal.clear();
+    if( !pGlobal.is() )
+        return;
 
-        handler->mState = State::Downing;
-        if (handler->mIpcThread.is()) {
-            handler->mIpcThread->close();
-        }
+    rtl::Reference< RequestHandler > handler(pGlobal);
+    pGlobal.clear();
 
-        // release mutex to avoid deadlocks
-        aMutex.clear();
+    handler->mState = State::Downing;
+    if (handler->mIpcThread.is()) {
+        handler->mIpcThread->close();
+    }
 
-        handler->cReady.set();
+    // release mutex to avoid deadlocks
+    aMutex.clear();
 
-        // exit gracefully and join
-        if (handler->mIpcThread.is())
-        {
-            handler->mIpcThread->join();
-            handler->mIpcThread.clear();
-        }
+    handler->cReady.set();
 
-        handler->cReady.reset();
+    // exit gracefully and join
+    if (handler->mIpcThread.is())
+    {
+        handler->mIpcThread->join();
+        handler->mIpcThread.clear();
     }
+
+    handler->cReady.reset();
 }
 
 RequestHandler::RequestHandler() :
diff --git a/desktop/source/app/opencl.cxx b/desktop/source/app/opencl.cxx
index a1fe3c0f6aea..0ea322e02565 100644
--- a/desktop/source/app/opencl.cxx
+++ b/desktop/source/app/opencl.cxx
@@ -223,32 +223,32 @@ void Desktop::CheckOpenCLCompute(const Reference< XDesktop2 > &xDesktop)
     aSelectedCLDeviceVersionID += "--" +
         OUString::number(aTimeVal.Seconds);
 
-    if (aSelectedCLDeviceVersionID != officecfg::Office::Common::Misc::SelectedOpenCLDeviceIdentifier::get())
-    {
-        // OpenCL device changed - sanity check it and disable if bad.
+    if (aSelectedCLDeviceVersionID == officecfg::Office::Common::Misc::SelectedOpenCLDeviceIdentifier::get())
+        return;
 
-        sal_Int32 nOrigMinimumSize = officecfg::Office::Calc::Formula::Calculation::OpenCLMinimumDataSize::get();
-        { // set the minimum group size to something small for quick testing.
-            std::shared_ptr<comphelper::ConfigurationChanges> xBatch(comphelper::ConfigurationChanges::create());
-            officecfg::Office::Calc::Formula::Calculation::OpenCLMinimumDataSize::set(3 /* small */, xBatch);
-            xBatch->commit();
-        }
+    // OpenCL device changed - sanity check it and disable if bad.
 
-        // Hopefully at least basic functionality always works and broken OpenCL implementations break
-        // only when they are used to compute something. If this assumptions turns out to be not true,
-        // the driver check needs to be moved sooner.
-        bool bSucceeded = testOpenCLDriver() && testOpenCLCompute(xDesktop, aURL);
+    sal_Int32 nOrigMinimumSize = officecfg::Office::Calc::Formula::Calculation::OpenCLMinimumDataSize::get();
+    { // set the minimum group size to something small for quick testing.
+        std::shared_ptr<comphelper::ConfigurationChanges> xBatch(comphelper::ConfigurationChanges::create());
+        officecfg::Office::Calc::Formula::Calculation::OpenCLMinimumDataSize::set(3 /* small */, xBatch);
+        xBatch->commit();
+    }
 
-        { // restore the minimum group size
-            std::shared_ptr<comphelper::ConfigurationChanges> xBatch(comphelper::ConfigurationChanges::create());
-            officecfg::Office::Calc::Formula::Calculation::OpenCLMinimumDataSize::set(nOrigMinimumSize, xBatch);
-            officecfg::Office::Common::Misc::SelectedOpenCLDeviceIdentifier::set(aSelectedCLDeviceVersionID, xBatch);
-            xBatch->commit();
-        }
+    // Hopefully at least basic functionality always works and broken OpenCL implementations break
+    // only when they are used to compute something. If this assumptions turns out to be not true,
+    // the driver check needs to be moved sooner.
+    bool bSucceeded = testOpenCLDriver() && testOpenCLCompute(xDesktop, aURL);
 
-        if (!bSucceeded)
-            OpenCLZone::hardDisable();
+    { // restore the minimum group size
+        std::shared_ptr<comphelper::ConfigurationChanges> xBatch(comphelper::ConfigurationChanges::create());
+        officecfg::Office::Calc::Formula::Calculation::OpenCLMinimumDataSize::set(nOrigMinimumSize, xBatch);
+        officecfg::Office::Common::Misc::SelectedOpenCLDeviceIdentifier::set(aSelectedCLDeviceVersionID, xBatch);
+        xBatch->commit();
     }
+
+    if (!bSucceeded)
+        OpenCLZone::hardDisable();
 }
 #endif // HAVE_FEATURE_OPENCL
 
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index 4ccac79a4f24..3e0ca1a7ab9c 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -978,52 +978,52 @@ void ExtensionBox_Impl::updateEntry( const uno::Reference< deployment::XPackage
 //is in the disposing state and all calls on it may result in a DisposedException.
 void ExtensionBox_Impl::removeEntry( const uno::Reference< deployment::XPackage > &xPackage )
 {
-   if ( ! m_bInDelete )
-    {
-        bool invalidate = false;
-        {
-            ::osl::ClearableMutexGuard aGuard( m_entriesMutex );
+    if (  m_bInDelete )
+        return;
 
-            auto iIndex = std::find_if(m_vEntries.begin(), m_vEntries.end(),
-                [&xPackage](const TEntry_Impl& rxEntry) { return rxEntry->m_xPackage == xPackage; });
-            if (iIndex != m_vEntries.end())
-            {
-                long nPos = iIndex - m_vEntries.begin();
+    bool invalidate = false;
+    {
+        ::osl::ClearableMutexGuard aGuard( m_entriesMutex );
 
-                // Entries mustn't be removed here, because they contain a hyperlink control
-                // which can only be deleted when the thread has the solar mutex. Therefore
-                // the entry will be moved into the m_vRemovedEntries list which will be
-                // cleared on the next paint event
-                m_vRemovedEntries.push_back( *iIndex );
-                (*iIndex)->m_xPackage->removeEventListener(m_xRemoveListener.get());
-                m_vEntries.erase( iIndex );
+        auto iIndex = std::find_if(m_vEntries.begin(), m_vEntries.end(),
+            [&xPackage](const TEntry_Impl& rxEntry) { return rxEntry->m_xPackage == xPackage; });
+        if (iIndex != m_vEntries.end())
+        {
+            long nPos = iIndex - m_vEntries.begin();
 
-                m_bNeedsRecalc = true;
+            // Entries mustn't be removed here, because they contain a hyperlink control
+            // which can only be deleted when the thread has the solar mutex. Therefore
+            // the entry will be moved into the m_vRemovedEntries list which will be
+            // cleared on the next paint event
+            m_vRemovedEntries.push_back( *iIndex );
+            (*iIndex)->m_xPackage->removeEventListener(m_xRemoveListener.get());
+            m_vEntries.erase( iIndex );
 
-                if ( IsReallyVisible() )
-                    invalidate = true;
+            m_bNeedsRecalc = true;
 
-                if ( m_bHasActive )
-                {
-                    if ( nPos < m_nActive )
-                        m_nActive -= 1;
-                    else if ( ( nPos == m_nActive ) &&
-                              ( nPos == static_cast<long>(m_vEntries.size()) ) )
-                        m_nActive -= 1;
+            if ( IsReallyVisible() )
+                invalidate = true;
 
-                    m_bHasActive = false;
-                    //clear before calling out of this method
-                    aGuard.clear();
-                    selectEntry( m_nActive );
-                }
+            if ( m_bHasActive )
+            {
+                if ( nPos < m_nActive )
+                    m_nActive -= 1;
+                else if ( ( nPos == m_nActive ) &&
+                          ( nPos == static_cast<long>(m_vEntries.size()) ) )
+                    m_nActive -= 1;
+
+                m_bHasActive = false;
+                //clear before calling out of this method
+                aGuard.clear();
+                selectEntry( m_nActive );
             }
         }
+    }
 
-        if (invalidate)
-        {
-            SolarMutexGuard g;
-            Invalidate();
-        }
+    if (invalidate)
+    {
+        SolarMutexGuard g;
+        Invalidate();
     }
 }
 
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index 446c4ae06571..66600848abd2 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -262,25 +262,25 @@ bool TheExtensionManager::installPackage( const OUString &rPackageURL, bool bWar
 
 void TheExtensionManager::terminateDialog()
 {
-    if ( ! dp_misc::office_is_running() )
+    if (  dp_misc::office_is_running() )
+        return;
+
+    const SolarMutexGuard guard;
+    if (m_xExtMgrDialog)
     {
-        const SolarMutexGuard guard;
-        if (m_xExtMgrDialog)
+        if (m_bExtMgrDialogExecuting)
+            m_xExtMgrDialog->response(RET_CANCEL);
+        else
         {
-            if (m_bExtMgrDialogExecuting)
-                m_xExtMgrDialog->response(RET_CANCEL);
-            else
-            {
-                m_xExtMgrDialog->Close();
-                m_xExtMgrDialog.reset();
-            }
+            m_xExtMgrDialog->Close();
+            m_xExtMgrDialog.reset();
         }
-        assert(!m_xExtMgrDialog);
-        if (m_xUpdReqDialog)
-            m_xUpdReqDialog->response(RET_CANCEL);
-        assert(!m_xUpdReqDialog);
-        Application::Quit();
     }
+    assert(!m_xExtMgrDialog);
+    if (m_xUpdReqDialog)
+        m_xUpdReqDialog->response(RET_CANCEL);
+    assert(!m_xUpdReqDialog);
+    Application::Quit();
 }
 
 
@@ -436,28 +436,28 @@ void TheExtensionManager::disposing( lang::EventObject const & rEvt )
         m_xDesktop.clear();
     }
 
-    if ( shutDown )
+    if ( !shutDown )
+        return;
+
+    if ( dp_misc::office_is_running() )
     {
-        if ( dp_misc::office_is_running() )
+        const SolarMutexGuard guard;
+        if (m_xExtMgrDialog)
         {
-            const SolarMutexGuard guard;
-            if (m_xExtMgrDialog)
+            if (m_bExtMgrDialogExecuting)
+                m_xExtMgrDialog->response(RET_CANCEL);
+            else
             {
-                if (m_bExtMgrDialogExecuting)
-                    m_xExtMgrDialog->response(RET_CANCEL);
-                else
-                {
-                    m_xExtMgrDialog->Close();
-                    m_xExtMgrDialog.reset();
-                }
+                m_xExtMgrDialog->Close();
+                m_xExtMgrDialog.reset();
             }
-            assert(!m_xExtMgrDialog);
-            if (m_xUpdReqDialog)
-                m_xUpdReqDialog->response(RET_CANCEL);
-            assert(!m_xUpdReqDialog);
         }
-        s_ExtMgr.clear();
+        assert(!m_xExtMgrDialog);
+        if (m_xUpdReqDialog)
+            m_xUpdReqDialog->response(RET_CANCEL);
+        assert(!m_xUpdReqDialog);
     }
+    s_ExtMgr.clear();
 }
 
 // XTerminateListener
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx
index 708c40215fa5..b8c23c60dfdb 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.cxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -931,19 +931,19 @@ void ExtensionManager::enableExtension(
         excOccurred <<= exc;
     }
 
-    if (excOccurred.hasValue())
+    if (!excOccurred.hasValue())
+        return;
+
+    try
+    {
+        activateExtension(dp_misc::getIdentifier(extension),
+                          extension->getName(), bUserDisabled, false,
+                          xAbortChannel, xCmdEnv);
+    }
+    catch (...)
     {
-        try
-        {
-            activateExtension(dp_misc::getIdentifier(extension),
-                              extension->getName(), bUserDisabled, false,
-                              xAbortChannel, xCmdEnv);
-        }
-        catch (...)
-        {
-        }
-        ::cppu::throwException(excOccurred);
     }
+    ::cppu::throwException(excOccurred);
 }
 
 sal_Int32 ExtensionManager::checkPrerequisitesAndEnable(
@@ -1032,19 +1032,19 @@ void ExtensionManager::disableExtension(
         excOccurred <<= exc;
     }
 
-    if (excOccurred.hasValue())
+    if (!excOccurred.hasValue())
+        return;
+
+    try
+    {
+        activateExtension(dp_misc::getIdentifier(extension),
+                          extension->getName(), bUserDisabled, false,
+                          xAbortChannel, xCmdEnv);
+    }
+    catch (...)
     {
-        try
-        {
-            activateExtension(dp_misc::getIdentifier(extension),
-                              extension->getName(), bUserDisabled, false,
-                              xAbortChannel, xCmdEnv);
-        }
-        catch (...)
-        {
-        }
-        ::cppu::throwException(excOccurred);
     }
+    ::cppu::throwException(excOccurred);
 }
 
 uno::Sequence< Reference<css::deployment::XPackage> >
diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
index 86e8c4508d9a..0caa69534820 100644
--- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
+++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
@@ -344,86 +344,87 @@ OUString DescriptionInfoset::getNodeValueFromExpression(OUString const & express
 
 void DescriptionInfoset::checkBlacklist() const
 {
-    if (m_element.is()) {
-        std::optional< OUString > id(getIdentifier());
-        if (!id)
-            return; // nothing to check
-        OUString currentversion(getVersion());
-        if (currentversion.getLength() == 0)
-            return;  // nothing to check
-
-        css::uno::Sequence<css::uno::Any> args(comphelper::InitAnyPropertySequence(
-        {
-            {"nodepath", css::uno::Any(OUString("/org.openoffice.Office.ExtensionDependencies/Extensions"))}
-        }));
-        css::uno::Reference< css::container::XNameAccess > blacklist(
-            (css::configuration::theDefaultProvider::get(m_context)
-             ->createInstanceWithArguments(
-                 "com.sun.star.configuration.ConfigurationAccess", args)),
-            css::uno::UNO_QUERY_THROW);
-
-        // check first if a blacklist entry is available
-        if (blacklist.is() && blacklist->hasByName(*id)) {
-            css::uno::Reference< css::beans::XPropertySet > extProps(
-                blacklist->getByName(*id), css::uno::UNO_QUERY_THROW);
-
-            css::uno::Any anyValue = extProps->getPropertyValue("Versions");
-
-            css::uno::Sequence< OUString > blversions;
-            anyValue >>= blversions;
-
-            // check if the current version requires further dependency checks from the blacklist
-            if (checkBlacklistVersion(currentversion, blversions)) {
-                anyValue = extProps->getPropertyValue("Dependencies");
-                OUString udeps;
-                anyValue >>= udeps;
-
-                if (udeps.getLength() == 0)
-                    return; // nothing todo
-
-                OString xmlDependencies = OUStringToOString(udeps, RTL_TEXTENCODING_UNICODE);
-
-                css::uno::Reference< css::xml::dom::XDocumentBuilder> docbuilder(
-                    m_context->getServiceManager()->createInstanceWithContext("com.sun.star.xml.dom.DocumentBuilder", m_context),
-                    css::uno::UNO_QUERY_THROW);
-
-                css::uno::Sequence< sal_Int8 > byteSeq(reinterpret_cast<const sal_Int8*>(xmlDependencies.getStr()), xmlDependencies.getLength());
-
-                css::uno::Reference< css::io::XInputStream> inputstream( css::io::SequenceInputStream::createStreamFromSequence(m_context, byteSeq),
-                                                                         css::uno::UNO_QUERY_THROW);
-
-                css::uno::Reference< css::xml::dom::XDocument > xDocument(docbuilder->parse(inputstream));
-                css::uno::Reference< css::xml::dom::XElement > xElement(xDocument->getDocumentElement());
-                css::uno::Reference< css::xml::dom::XNodeList > xDeps(xElement->getChildNodes());
-                sal_Int32 nLen = xDeps->getLength();
-

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list