drawinglayer/Library_drawinglayer.mk                    |    4 ++
 drawinglayer/source/primitive2d/controlprimitive2d.cxx  |    4 +-
 drawinglayer/source/primitive2d/sceneprimitive2d.cxx    |    3 +
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx |    6 +--
 include/svtools/optionsdrawinglayer.hxx                 |    6 ---
 svtools/source/config/optionsdrawinglayer.cxx           |   31 ----------------
 svx/source/sdr/overlay/overlayselection.cxx             |    3 +
 svx/source/svdraw/svddrgv.cxx                           |    6 +--
 8 files changed, 16 insertions(+), 47 deletions(-)

New commits:
commit 94dc600334cbadeb5d37205893688b29ce856e90
Author:     Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>
AuthorDate: Mon Nov 13 02:36:26 2023 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Fri Feb 23 11:04:32 2024 +0100

    Drop some wrapper methods from SvtOptionsDrawinglayer
    
    just use the wrapped officecfg methods instead of:
    IsSolidDragCreate
    IsRenderDecoratedTextDirect
    IsRenderSimpleTextDirect
    GetQuadratic3DRenderLimit
    GetQuadraticFormControlRenderLimit
    IsTransparentSelection
    
    Change-Id: Ie0f3ec0f8fdbbf08facfff1a372c666c8a0c8979
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160654
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163792
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/drawinglayer/Library_drawinglayer.mk 
b/drawinglayer/Library_drawinglayer.mk
index c654275bdd11..e5c02487741a 100644
--- a/drawinglayer/Library_drawinglayer.mk
+++ b/drawinglayer/Library_drawinglayer.mk
@@ -57,6 +57,10 @@ $(eval $(call gb_Library_use_libraries,drawinglayer,\
     vcl \
 ))
 
+$(eval $(call gb_Library_use_custom_headers,drawinglayer,\
+    officecfg/registry \
+))
+
 ifeq ($(OS),WNT)
 $(eval $(call gb_Library_use_system_win32_libs,drawinglayer,\
        gdi32 \
diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx 
b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
index c8448efa981f..fc6f69be521d 100644
--- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
@@ -37,10 +37,10 @@
 #include <basegfx/polygon/b2dpolygon.hxx>
 #include <drawinglayer/primitive2d/PolygonHairlinePrimitive2D.hxx>
 #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
-#include <svtools/optionsdrawinglayer.hxx>
 #include <vcl/window.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
+#include <officecfg/Office/Common.hxx>
 
 using namespace com::sun::star;
 
@@ -99,7 +99,7 @@ namespace drawinglayer::primitive2d
                     basegfx::B2DVector 
aDiscreteSize(rViewInformation.getObjectToViewTransformation() * aScale);
 
                     // limit to a maximum square size, e.g. 300x150 pixels 
(45000)
-                    const double 
fDiscreteMax(SvtOptionsDrawinglayer::GetQuadraticFormControlRenderLimit());
+                    const double 
fDiscreteMax(officecfg::Office::Common::Drawinglayer::QuadraticFormControlRenderLimit::get());
                     const double fDiscreteQuadratic(aDiscreteSize.getX() * 
aDiscreteSize.getY());
                     const bool bScaleUsed(fDiscreteQuadratic > fDiscreteMax);
                     double fFactor(1.0);
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx 
b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index e2f44b690aa5..78402a22ba3f 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -36,6 +36,7 @@
 #include <comphelper/threadpool.hxx>
 #include <comphelper/lok.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
+#include <officecfg/Office/Common.hxx>
 
 using namespace com::sun::star;
 
@@ -243,7 +244,7 @@ namespace drawinglayer::primitive2d
             double fViewSizeX(aVisibleDiscreteRange.getWidth());
             double fViewSizeY(aVisibleDiscreteRange.getHeight());
             const double fViewVisibleArea(fViewSizeX * fViewSizeY);
-            const double 
fMaximumVisibleArea(SvtOptionsDrawinglayer::GetQuadratic3DRenderLimit());
+            const double 
fMaximumVisibleArea(officecfg::Office::Common::Drawinglayer::Quadratic3DRenderLimit::get());
             double fReduceFactor(1.0);
 
             if(fViewVisibleArea > fMaximumVisibleArea)
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 8748b78cd34e..f9b0e0df6159 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -63,7 +63,7 @@
 #include <com/sun/star/awt/XWindow2.hpp>
 #include <com/sun/star/awt/XControl.hpp>
 
-#include <svtools/optionsdrawinglayer.hxx>
+#include <officecfg/Office/Common.hxx>
 #include <vcl/gradient.hxx>
 
 using namespace com::sun::star;
@@ -403,7 +403,7 @@ void 
VclPixelProcessor2D::processTextSimplePortionPrimitive2D(
     const DrawModeFlags nOriginalDrawMode(mpOutputDevice->GetDrawMode());
     adaptTextToFillDrawMode();
 
-    if (SvtOptionsDrawinglayer::IsRenderSimpleTextDirect())
+    if (officecfg::Office::Common::Drawinglayer::RenderSimpleTextDirect::get())
     {
         RenderTextSimpleOrDecoratedPortionPrimitive2D(rCandidate);
     }
@@ -423,7 +423,7 @@ void 
VclPixelProcessor2D::processTextDecoratedPortionPrimitive2D(
     const DrawModeFlags nOriginalDrawMode(mpOutputDevice->GetDrawMode());
     adaptTextToFillDrawMode();
 
-    if (SvtOptionsDrawinglayer::IsRenderDecoratedTextDirect())
+    if 
(officecfg::Office::Common::Drawinglayer::RenderDecoratedTextDirect::get())
     {
         RenderTextSimpleOrDecoratedPortionPrimitive2D(rCandidate);
     }
diff --git a/include/svtools/optionsdrawinglayer.hxx 
b/include/svtools/optionsdrawinglayer.hxx
index 5d6316aa30e6..d5a0856763c3 100644
--- a/include/svtools/optionsdrawinglayer.hxx
+++ b/include/svtools/optionsdrawinglayer.hxx
@@ -80,16 +80,10 @@ SVT_DLLPUBLIC bool       IsAAPossibleOnThisSystem();
 // primitives
 SVT_DLLPUBLIC bool        IsAntiAliasing();
 SVT_DLLPUBLIC bool        IsSnapHorVerLinesToDiscrete();
-SVT_DLLPUBLIC bool        IsSolidDragCreate();
-SVT_DLLPUBLIC bool        IsRenderDecoratedTextDirect();
-SVT_DLLPUBLIC bool        IsRenderSimpleTextDirect();
-SVT_DLLPUBLIC sal_uInt32  GetQuadratic3DRenderLimit();
-SVT_DLLPUBLIC sal_uInt32  GetQuadraticFormControlRenderLimit();
 
 SVT_DLLPUBLIC void        SetAntiAliasing( bool bOn, bool bTemporary );
 
 // #i97672# selection settings
-SVT_DLLPUBLIC bool        IsTransparentSelection();
 SVT_DLLPUBLIC sal_uInt16  GetTransparentSelectionPercent();
 SVT_DLLPUBLIC sal_uInt16  GetSelectionMaximumLuminancePercent();
 
diff --git a/svtools/source/config/optionsdrawinglayer.cxx 
b/svtools/source/config/optionsdrawinglayer.cxx
index 227b9ef0ad25..9f5657cb5359 100644
--- a/svtools/source/config/optionsdrawinglayer.cxx
+++ b/svtools/source/config/optionsdrawinglayer.cxx
@@ -167,37 +167,6 @@ bool IsSnapHorVerLinesToDiscrete()
     return bRetval;
 }
 
-bool IsSolidDragCreate()
-{
-    return officecfg::Office::Common::Drawinglayer::SolidDragCreate::get();
-}
-
-bool IsRenderDecoratedTextDirect()
-{
-    return 
officecfg::Office::Common::Drawinglayer::RenderDecoratedTextDirect::get();
-}
-
-bool IsRenderSimpleTextDirect()
-{
-    return 
officecfg::Office::Common::Drawinglayer::RenderSimpleTextDirect::get();
-}
-
-sal_uInt32 GetQuadratic3DRenderLimit()
-{
-    return 
officecfg::Office::Common::Drawinglayer::Quadratic3DRenderLimit::get();
-}
-
-sal_uInt32 GetQuadraticFormControlRenderLimit()
-{
-    return 
officecfg::Office::Common::Drawinglayer::QuadraticFormControlRenderLimit::get();
-}
-
-// #i97672# selection settings
-bool IsTransparentSelection()
-{
-    return 
officecfg::Office::Common::Drawinglayer::TransparentSelection::get();
-}
-
 sal_uInt16 GetTransparentSelectionPercent()
 {
     sal_uInt16 aRetval = 
officecfg::Office::Common::Drawinglayer::TransparentSelectionPercent::get();
diff --git a/svx/source/sdr/overlay/overlayselection.cxx 
b/svx/source/sdr/overlay/overlayselection.cxx
index 8319a259bc4b..9d805fdb25c7 100644
--- a/svx/source/sdr/overlay/overlayselection.cxx
+++ b/svx/source/sdr/overlay/overlayselection.cxx
@@ -30,6 +30,7 @@
 #include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
 #include <basegfx/polygon/b2dpolypolygoncutter.hxx>
 #include <svx/sdr/overlay/overlaymanager.hxx>
+#include <officecfg/Office/Common.hxx>
 
 
 namespace sdr::overlay
@@ -63,7 +64,7 @@ namespace sdr::overlay
         {
             if(OverlayType::Invert != aOverlayType)
             {
-                if(!SvtOptionsDrawinglayer::IsTransparentSelection())
+                
if(!officecfg::Office::Common::Drawinglayer::TransparentSelection::get())
                 {
                     // not possible when switched off by user
                     return OverlayType::Invert;
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index 8b9567c20be0..c0cd0988d8ad 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -34,11 +34,11 @@
 #include <svx/svdoashp.hxx>
 #include <svx/sdrpaintwindow.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
-#include <svtools/optionsdrawinglayer.hxx>
 #include <svx/sdr/overlay/overlaymanager.hxx>
 #include <svx/sdrpagewindow.hxx>
 #include <unotools/configmgr.hxx>
 #include <comphelper/lok.hxx>
+#include <officecfg/Office/Common.hxx>
 
 using namespace sdr;
 
@@ -53,7 +53,7 @@ SdrDragView::SdrDragView(SdrModel& rSdrModel, OutputDevice* 
pOut)
     , mbDragLimit(false)
     , mbDragHdl(false)
     , mbDragStripes(false)
-    , mbSolidDragging(utl::ConfigManager::IsFuzzing() || 
SvtOptionsDrawinglayer::IsSolidDragCreate())
+    , mbSolidDragging(utl::ConfigManager::IsFuzzing() || 
officecfg::Office::Common::Drawinglayer::SolidDragCreate::get())
     , mbResizeAtCenter(false)
     , mbCrookAtCenter(false)
     , mbDragWithCopy(false)
@@ -914,7 +914,7 @@ bool SdrDragView::IsSolidDragging() const
 {
     // allow each user to disable by having a local setting, but using AND for
     // checking allowance
-    return mbSolidDragging && SvtOptionsDrawinglayer::IsSolidDragCreate();
+    return mbSolidDragging && 
officecfg::Office::Common::Drawinglayer::SolidDragCreate::get();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to