cui/source/inc/cuitabline.hxx     |    2 ++
 cui/source/options/cfgchart.cxx   |    4 ++--
 cui/source/options/dbregister.cxx |    2 +-
 cui/source/options/optjava.cxx    |    6 ++----
 cui/source/options/optpath.cxx    |    2 +-
 cui/source/tabpages/tplnedef.cxx  |    2 --
 cui/source/tabpages/tplneend.cxx  |    2 --
 7 files changed, 8 insertions(+), 12 deletions(-)

New commits:
commit 3a856d6a3cc82d3ebf46ac9d73052ca2de85dd0b
Author:     Pierre F <f...@bger.ch>
AuthorDate: Wed Apr 9 14:40:34 2025 +0200
Commit:     Hossein <hoss...@libreoffice.org>
CommitDate: Wed Apr 23 10:10:45 2025 +0200

    tdf#145614 Convert #define to constexpr
    
    Change-Id: I8d7033ff588de7e12300398297ff363f8e65c74d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183930
    Reviewed-by: Hossein   <hoss...@libreoffice.org>
    Tested-by: Jenkins

diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx
index ce2a9c4887c8..0118eff685c6 100644
--- a/cui/source/inc/cuitabline.hxx
+++ b/cui/source/inc/cuitabline.hxx
@@ -234,6 +234,8 @@ public:
 
 /*************************************************************************/
 
+constexpr tools::Long XOUT_WIDTH = 150;
+
 class SvxLineDefTabPage : public SfxTabPage
 {
 private:
diff --git a/cui/source/options/cfgchart.cxx b/cui/source/options/cfgchart.cxx
index 8d1bd5e4130e..d128b1b9cd3a 100644
--- a/cui/source/options/cfgchart.cxx
+++ b/cui/source/options/cfgchart.cxx
@@ -26,8 +26,6 @@
 #include <utility>
 #include <officecfg/Office/Chart.hxx>
 
-#define ROW_COLOR_COUNT 12
-
 using namespace com::sun::star;
 
 // accessors
@@ -90,6 +88,8 @@ void SvxChartColorTable::replace( size_t _nIndex, const 
XColorEntry & _rEntry )
 
 void SvxChartColorTable::useDefault()
 {
+    constexpr sal_Int32 ROW_COLOR_COUNT = 12;
+
     static const Color aColors[] = {
         Color( 0x00, 0x45, 0x86 ),
         Color( 0xff, 0x42, 0x0e ),
diff --git a/cui/source/options/dbregister.cxx 
b/cui/source/options/dbregister.cxx
index 45c8398d23a6..59221c8293fd 100644
--- a/cui/source/options/dbregister.cxx
+++ b/cui/source/options/dbregister.cxx
@@ -39,7 +39,7 @@
 #include <svx/databaseregistrationui.hxx>
 #include <o3tl/string_view.hxx>
 
-#define COL_TYPE       0
+constexpr int COL_TYPE = 0;
 
 namespace svx
 {
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 4a4ea15ff695..5a90fdeb3a0d 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -55,10 +55,6 @@
 #include <jvmfwk/framework.hxx>
 #endif
 
-// define ----------------------------------------------------------------
-
-#define CLASSPATH_DELIMITER SAL_PATHSEPARATOR
-
 using namespace ::com::sun::star::ui::dialogs;
 using namespace ::com::sun::star::uno;
 
@@ -960,6 +956,8 @@ bool SvxJavaClassPathDlg::IsPathDuplicate( 
std::u16string_view _rPath )
 
 OUString SvxJavaClassPathDlg::GetClassPath() const
 {
+    constexpr char CLASSPATH_DELIMITER = SAL_PATHSEPARATOR;
+
     OUStringBuffer sPath;
     int nCount = m_xPathList->n_children();
     for (int i = 0; i < nCount; ++i)
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index 4ddf728a1bcf..6f1276d45940 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -131,7 +131,7 @@ static OUString getCfgName_Impl( SvtPathOptions::Paths 
_nHandle )
     return sCfgName;
 }
 
-#define MULTIPATH_DELIMITER     ';'
+constexpr char MULTIPATH_DELIMITER = ';';
 
 static OUString Convert_Impl( std::u16string_view rValue )
 {
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index f40aae97531f..7a5a3663641e 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -45,8 +45,6 @@
 #include <svtools/unitconv.hxx>
 #include <osl/diagnose.h>
 
-#define XOUT_WIDTH    150
-
 using namespace com::sun::star;
 
 
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index 360bec01199d..62edad474f97 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -47,8 +47,6 @@
 #include <svx/strings.hrc>
 #include <osl/diagnose.h>
 
-#define XOUT_WIDTH    150
-
 SvxLineEndDefTabPage::SvxLineEndDefTabPage(weld::Container* pPage, 
weld::DialogController* pController, const SfxItemSet& rInAttrs)
     : SfxTabPage(pPage, pController, u"cui/ui/lineendstabpage.ui"_ustr, 
u"LineEndPage"_ustr, &rInAttrs)
     , rOutAttrs(rInAttrs)

Reply via email to