cui/source/tabpages/page.cxx                  |   16 ++++++-------
 include/svtools/optionsdrawinglayer.hxx       |    8 ------
 svtools/source/config/optionsdrawinglayer.cxx |   31 --------------------------
 sw/source/uibase/sidebar/PageFormatPanel.cxx  |    6 ++---
 4 files changed, 11 insertions(+), 50 deletions(-)

New commits:
commit c498e2acd64688df9aa32bbcc820d8513a5373ea
Author:     Gabor Kelemen <[email protected]>
AuthorDate: Mon Nov 13 01:02:08 2023 +0100
Commit:     Thorsten Behrens <[email protected]>
CommitDate: Sat Dec 16 01:30:20 2023 +0100

    Drop some wrapper methods from SvtOptionsDrawinglayer
    
    just use the wrapped officecfg methods instead of:
    GetMaximumPaperWidth
    GetMaximumPaperHeight
    GetMaximumPaperLeftMargin
    GetMaximumPaperRightMargin
    GetMaximumPaperTopMargin
    GetMaximumPaperBottomMargin
    
    Change-Id: Id11782a306ca9118cc65607265be516ba9f0abda
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160653
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <[email protected]>

diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index d810a9471dce..0fec60690e9a 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -49,13 +49,13 @@
 #include <editeng/eerdll.hxx>
 #include <editeng/editrids.hrc>
 #include <svx/svxids.hrc>
-#include <svtools/optionsdrawinglayer.hxx>
 #include <svl/slstitm.hxx>
 #include <svx/xdef.hxx>
 #include <svx/unobrushitemhelper.hxx>
 #include <svx/SvxNumOptionsTabPageHelper.hxx>
 #include <sal/log.hxx>
 #include <svl/grabbagitem.hxx>
+#include <officecfg/Office/Common.hxx>
 
 // static ----------------------------------------------------------------
 
@@ -276,16 +276,16 @@ SvxPageDescPage::SvxPageDescPage(weld::Container* pPage, 
weld::DialogController*
 
     // #i4219# take Maximum now from configuration (1/100th cm)
     // was: 11900 -> 119 cm ;new value 3 meters -> 300 cm -> 30000
-    
m_xPaperWidthEdit->set_max(m_xPaperWidthEdit->normalize(SvtOptionsDrawinglayer::GetMaximumPaperWidth()),
 FieldUnit::CM);
-    
m_xPaperHeightEdit->set_max(m_xPaperHeightEdit->normalize(SvtOptionsDrawinglayer::GetMaximumPaperHeight()),
 FieldUnit::CM);
+    
m_xPaperWidthEdit->set_max(m_xPaperWidthEdit->normalize(officecfg::Office::Common::Drawinglayer::MaximumPaperWidth::get()),
 FieldUnit::CM);
+    
m_xPaperHeightEdit->set_max(m_xPaperHeightEdit->normalize(officecfg::Office::Common::Drawinglayer::MaximumPaperHeight::get()),
 FieldUnit::CM);
 
     // #i4219# also for margins (1/100th cm). Was: 9999, keeping.
-    
m_xLeftMarginEdit->set_max(m_xLeftMarginEdit->normalize(SvtOptionsDrawinglayer::GetMaximumPaperLeftMargin()),
 FieldUnit::MM);
-    
m_xRightMarginEdit->set_max(m_xRightMarginEdit->normalize(SvtOptionsDrawinglayer::GetMaximumPaperRightMargin()),
 FieldUnit::MM);
-    
m_xTopMarginEdit->set_max(m_xTopMarginEdit->normalize(SvtOptionsDrawinglayer::GetMaximumPaperTopMargin()),
 FieldUnit::MM);
-    
m_xBottomMarginEdit->set_max(m_xBottomMarginEdit->normalize(SvtOptionsDrawinglayer::GetMaximumPaperBottomMargin()),
 FieldUnit::MM);
+    
m_xLeftMarginEdit->set_max(m_xLeftMarginEdit->normalize(officecfg::Office::Common::Drawinglayer::MaximumPaperLeftMargin::get()),
 FieldUnit::MM);
+    
m_xRightMarginEdit->set_max(m_xRightMarginEdit->normalize(officecfg::Office::Common::Drawinglayer::MaximumPaperRightMargin::get()),
 FieldUnit::MM);
+    
m_xTopMarginEdit->set_max(m_xTopMarginEdit->normalize(officecfg::Office::Common::Drawinglayer::MaximumPaperTopMargin::get()),
 FieldUnit::MM);
+    
m_xBottomMarginEdit->set_max(m_xBottomMarginEdit->normalize(officecfg::Office::Common::Drawinglayer::MaximumPaperBottomMargin::get()),
 FieldUnit::MM);
     m_xGutterMarginEdit->set_max(
-        
m_xGutterMarginEdit->normalize(SvtOptionsDrawinglayer::GetMaximumPaperLeftMargin()),
+        
m_xGutterMarginEdit->normalize(officecfg::Office::Common::Drawinglayer::MaximumPaperLeftMargin::get()),
         FieldUnit::MM);
 
     // Get the i18n framework numberings and add them to the listbox.
diff --git a/include/svtools/optionsdrawinglayer.hxx 
b/include/svtools/optionsdrawinglayer.hxx
index ef7b96bbba58..a29d2899fef4 100644
--- a/include/svtools/optionsdrawinglayer.hxx
+++ b/include/svtools/optionsdrawinglayer.hxx
@@ -42,14 +42,6 @@ namespace SvtOptionsDrawinglayer
 SVT_DLLPUBLIC Color       GetStripeColorA();
 SVT_DLLPUBLIC Color       GetStripeColorB();
 
-// #i4219#
-SVT_DLLPUBLIC sal_uInt32  GetMaximumPaperWidth();
-SVT_DLLPUBLIC sal_uInt32  GetMaximumPaperHeight();
-SVT_DLLPUBLIC sal_uInt32  GetMaximumPaperLeftMargin();
-SVT_DLLPUBLIC sal_uInt32  GetMaximumPaperRightMargin();
-SVT_DLLPUBLIC sal_uInt32  GetMaximumPaperTopMargin();
-SVT_DLLPUBLIC sal_uInt32  GetMaximumPaperBottomMargin();
-
 // #i95644# helper to check if AA is allowed on this system. Currently, for 
WIN it's disabled
 // and OutDevSupportType::TransparentRect is checked (this  hits 
XRenderExtension, e.g.
 // currently for SunRay as long as not supported there)
diff --git a/svtools/source/config/optionsdrawinglayer.cxx 
b/svtools/source/config/optionsdrawinglayer.cxx
index f6beb66fa330..edb91e41fc34 100644
--- a/svtools/source/config/optionsdrawinglayer.cxx
+++ b/svtools/source/config/optionsdrawinglayer.cxx
@@ -43,37 +43,6 @@ Color GetStripeColorB()
     return Color(ColorTransparency, 
officecfg::Office::Common::Drawinglayer::StripeColorB::get());
 }
 
-// #i4219#
-sal_uInt32 GetMaximumPaperWidth()
-{
-    return officecfg::Office::Common::Drawinglayer::MaximumPaperWidth::get();
-}
-
-sal_uInt32 GetMaximumPaperHeight()
-{
-    return officecfg::Office::Common::Drawinglayer::MaximumPaperHeight::get();
-}
-
-sal_uInt32 GetMaximumPaperLeftMargin()
-{
-    return 
officecfg::Office::Common::Drawinglayer::MaximumPaperLeftMargin::get();
-}
-
-sal_uInt32 GetMaximumPaperRightMargin()
-{
-    return 
officecfg::Office::Common::Drawinglayer::MaximumPaperRightMargin::get();
-}
-
-sal_uInt32 GetMaximumPaperTopMargin()
-{
-    return 
officecfg::Office::Common::Drawinglayer::MaximumPaperTopMargin::get();
-}
-
-sal_uInt32 GetMaximumPaperBottomMargin()
-{
-    return 
officecfg::Office::Common::Drawinglayer::MaximumPaperBottomMargin::get();
-}
-
 static bool gbPixelSnapHairlineForwardInitial(false);
 static bool gbPixelSnapHairlineForwardLast(true);
 
diff --git a/sw/source/uibase/sidebar/PageFormatPanel.cxx 
b/sw/source/uibase/sidebar/PageFormatPanel.cxx
index fdfa9ce6616d..4706dbc8bc25 100644
--- a/sw/source/uibase/sidebar/PageFormatPanel.cxx
+++ b/sw/source/uibase/sidebar/PageFormatPanel.cxx
@@ -34,10 +34,10 @@
 #include <sfx2/viewfrm.hxx>
 #include <pageformatpanel.hrc>
 #include <cmdid.h>
-#include <svtools/optionsdrawinglayer.hxx>
 #include <unotools/localedatawrapper.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/svapp.hxx>
+#include <officecfg/Office/Common.hxx>
 
 #include <com/sun/star/lang/IllegalArgumentException.hpp>
 
@@ -132,8 +132,8 @@ void PageFormatPanel::Initialize()
     SetMarginFieldUnit();
     m_aCustomEntry = mxCustomEntry->get_label();
 
-    
mxPaperWidth->set_max(mxPaperWidth->normalize(SvtOptionsDrawinglayer::GetMaximumPaperWidth()),
 FieldUnit::CM);
-    
mxPaperHeight->set_max(mxPaperHeight->normalize(SvtOptionsDrawinglayer::GetMaximumPaperHeight()),
 FieldUnit::CM);
+    
mxPaperWidth->set_max(mxPaperWidth->normalize(officecfg::Office::Common::Drawinglayer::MaximumPaperWidth::get()),
 FieldUnit::CM);
+    
mxPaperHeight->set_max(mxPaperHeight->normalize(officecfg::Office::Common::Drawinglayer::MaximumPaperHeight::get()),
 FieldUnit::CM);
 
     mxPaperSizeBox->connect_changed( LINK(this, PageFormatPanel, 
PaperFormatModifyHdl ));
     mxPaperOrientation->connect_changed( LINK(this, PageFormatPanel, 
PaperFormatModifyHdl ));

Reply via email to