sc/source/ui/sidebar/CellLineStyleControl.cxx |   40 +++++++++++---------------
 sc/source/ui/sidebar/CellLineStyleControl.hxx |    2 -
 2 files changed, 18 insertions(+), 24 deletions(-)

New commits:
commit 4ef43c135db2f41372c1d8cc2287014392a892d7
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Nov 28 09:47:54 2025 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sat Nov 29 06:51:59 2025 +0100

    sc: Merge CellLineStylePopup::Initialize into ctor
    
    Change-Id: I2f0e8a96c3569cfe120b5ffa5d9fd97e4557b27d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194763
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/sc/source/ui/sidebar/CellLineStyleControl.cxx 
b/sc/source/ui/sidebar/CellLineStyleControl.cxx
index 2a01afd981dc..767ae307979c 100644
--- a/sc/source/ui/sidebar/CellLineStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellLineStyleControl.cxx
@@ -40,15 +40,6 @@ CellLineStylePopup::CellLineStylePopup(weld::Toolbar* 
pParent, const OUString& r
     , mxCellLineStyleValueSet(new sc::sidebar::CellLineStyleValueSet)
     , mxCellLineStyleValueSetWin(new weld::CustomWeld(*m_xBuilder, 
u"linestylevalueset"_ustr, *mxCellLineStyleValueSet))
     , mxPushButtonMoreOptions(m_xBuilder->weld_button(u"more"_ustr))
-{
-    Initialize();
-}
-
-CellLineStylePopup::~CellLineStylePopup()
-{
-}
-
-void CellLineStylePopup::Initialize()
 {
     mxPushButtonMoreOptions->connect_clicked(LINK(this, CellLineStylePopup, 
PBClickHdl));
 
@@ -85,6 +76,10 @@ void CellLineStylePopup::Initialize()
     mxCellLineStyleValueSet->SetSelectHdl(LINK(this, CellLineStylePopup, 
VSSelectHdl));
 }
 
+CellLineStylePopup::~CellLineStylePopup()
+{
+}
+
 void CellLineStylePopup::GrabFocus()
 {
     mxCellLineStyleValueSet->GrabFocus();
diff --git a/sc/source/ui/sidebar/CellLineStyleControl.hxx 
b/sc/source/ui/sidebar/CellLineStyleControl.hxx
index 18889ecd4c73..341d38fd38a0 100644
--- a/sc/source/ui/sidebar/CellLineStyleControl.hxx
+++ b/sc/source/ui/sidebar/CellLineStyleControl.hxx
@@ -35,7 +35,6 @@ private:
     std::unique_ptr<weld::CustomWeld> mxCellLineStyleValueSetWin;
     std::unique_ptr<weld::Button> mxPushButtonMoreOptions;
 
-    void Initialize();
     void SetAllNoSel();
 
     DECL_LINK(VSSelectHdl, ValueSet*, void);
commit d7751a7599042130e9193f219ad5c136587b6fac
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Nov 28 09:46:48 2025 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sat Nov 29 06:51:50 2025 +0100

    sc: Use local var instead of CellLineStyleControl::maStr
    
    It's only used in CellLineStylePopup::Initialize, so no need
    to have it as a class member.
    
    Change-Id: Id3b0790ff6f9177e9b38a1ed3f9e974af89b9cd6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194762
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/sc/source/ui/sidebar/CellLineStyleControl.cxx 
b/sc/source/ui/sidebar/CellLineStyleControl.cxx
index b763c6a4f6db..2a01afd981dc 100644
--- a/sc/source/ui/sidebar/CellLineStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellLineStyleControl.cxx
@@ -60,24 +60,25 @@ void CellLineStylePopup::Initialize()
     }
 
     const vcl::I18nHelper& rI18nHelper = 
Application::GetSettings().GetLocaleI18nHelper();
-    maStr[0] = ScResId(STR_BORDER_HAIRLINE).replaceFirst("%s", 
rI18nHelper.GetNum(5, 2));
-    maStr[1] = ScResId(STR_BORDER_VERY_THIN).replaceFirst("%s", 
rI18nHelper.GetNum(50, 2));
-    maStr[2] = ScResId(STR_BORDER_THIN).replaceFirst("%s", 
rI18nHelper.GetNum(75, 2));
-    maStr[3] = ScResId(STR_BORDER_MEDIUM).replaceFirst("%s", 
rI18nHelper.GetNum(150, 2));
-    maStr[4] = ScResId(STR_BORDER_THICK).replaceFirst("%s", 
rI18nHelper.GetNum(225, 2));
-    maStr[5] = ScResId(STR_BORDER_EXTRA_THICK).replaceFirst("%s", 
rI18nHelper.GetNum(450, 2));
+    OUString aStr[CELL_LINE_STYLE_ENTRIES];
+    aStr[0] = ScResId(STR_BORDER_HAIRLINE).replaceFirst("%s", 
rI18nHelper.GetNum(5, 2));
+    aStr[1] = ScResId(STR_BORDER_VERY_THIN).replaceFirst("%s", 
rI18nHelper.GetNum(50, 2));
+    aStr[2] = ScResId(STR_BORDER_THIN).replaceFirst("%s", 
rI18nHelper.GetNum(75, 2));
+    aStr[3] = ScResId(STR_BORDER_MEDIUM).replaceFirst("%s", 
rI18nHelper.GetNum(150, 2));
+    aStr[4] = ScResId(STR_BORDER_THICK).replaceFirst("%s", 
rI18nHelper.GetNum(225, 2));
+    aStr[5] = ScResId(STR_BORDER_EXTRA_THICK).replaceFirst("%s", 
rI18nHelper.GetNum(450, 2));
 
     // Numbers in pt are the total width of the double line (inner + outer + 
distance)
-    maStr[6] = ScResId(STR_BORDER_DOUBLE_1).replaceFirst("%s", 
rI18nHelper.GetNum(110, 2));
-    maStr[7] = ScResId(STR_BORDER_DOUBLE_1).replaceFirst("%s", 
rI18nHelper.GetNum(235, 2));
-    maStr[8] = ScResId(STR_BORDER_DOUBLE_2).replaceFirst("%s", 
rI18nHelper.GetNum(300, 2));
-    maStr[9] = ScResId(STR_BORDER_DOUBLE_3).replaceFirst("%s", 
rI18nHelper.GetNum(305, 2));
-    maStr[10] = ScResId(STR_BORDER_DOUBLE_4).replaceFirst("%s", 
rI18nHelper.GetNum(450, 2));
-    mxCellLineStyleValueSet->SetUnit(&maStr[0]);
+    aStr[6] = ScResId(STR_BORDER_DOUBLE_1).replaceFirst("%s", 
rI18nHelper.GetNum(110, 2));
+    aStr[7] = ScResId(STR_BORDER_DOUBLE_1).replaceFirst("%s", 
rI18nHelper.GetNum(235, 2));
+    aStr[8] = ScResId(STR_BORDER_DOUBLE_2).replaceFirst("%s", 
rI18nHelper.GetNum(300, 2));
+    aStr[9] = ScResId(STR_BORDER_DOUBLE_3).replaceFirst("%s", 
rI18nHelper.GetNum(305, 2));
+    aStr[10] = ScResId(STR_BORDER_DOUBLE_4).replaceFirst("%s", 
rI18nHelper.GetNum(450, 2));
+    mxCellLineStyleValueSet->SetUnit(&aStr[0]);
 
     for (sal_uInt16 i = 1; i <= CELL_LINE_STYLE_ENTRIES; ++i)
     {
-        mxCellLineStyleValueSet->SetItemText(i, maStr[i-1]);
+        mxCellLineStyleValueSet->SetItemText(i, aStr[i-1]);
     }
 
     SetAllNoSel();
diff --git a/sc/source/ui/sidebar/CellLineStyleControl.hxx 
b/sc/source/ui/sidebar/CellLineStyleControl.hxx
index 0955592e4998..18889ecd4c73 100644
--- a/sc/source/ui/sidebar/CellLineStyleControl.hxx
+++ b/sc/source/ui/sidebar/CellLineStyleControl.hxx
@@ -34,7 +34,6 @@ private:
     std::unique_ptr<CellLineStyleValueSet> mxCellLineStyleValueSet;
     std::unique_ptr<weld::CustomWeld> mxCellLineStyleValueSetWin;
     std::unique_ptr<weld::Button> mxPushButtonMoreOptions;
-    OUString maStr[CELL_LINE_STYLE_ENTRIES];
 
     void Initialize();
     void SetAllNoSel();

Reply via email to