include/svx/SvxColorValueSet.hxx         |    1 -
 svx/source/tbxctrls/PaletteManager.cxx   |    8 +++++++-
 svx/source/tbxctrls/SvxColorValueSet.cxx |   21 ---------------------
 3 files changed, 7 insertions(+), 23 deletions(-)

New commits:
commit a930454879cfa98934e983f01decb05a23c959da
Author:     Michael Weghorn <[email protected]>
AuthorDate: Thu Feb 5 14:33:06 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Thu Feb 5 22:28:51 2026 +0100

    svx: Move relevant SvxColorValueSet::addEntriesForColorSet logic
    
    There is only one caller that always calls the method with
    a non-empty prefix.
    
    Inline the relevant logic into the only caller, and drop
    unused logic that would have handled the case of an
    empty prefix.
    
    Change-Id: I5ef0b289d8993f0a246fce89d3237534636b4f5a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198762
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/include/svx/SvxColorValueSet.hxx b/include/svx/SvxColorValueSet.hxx
index 10076027c356..77d6e247ae74 100644
--- a/include/svx/SvxColorValueSet.hxx
+++ b/include/svx/SvxColorValueSet.hxx
@@ -39,7 +39,6 @@ public:
     static sal_uInt32 getColumnCount();
 
     void addEntriesForXColorList(const XColorList& rXColorList);
-    void addEntriesForColorSet(const std::set<Color>& rColorSet, 
std::u16string_view rNamePrefix);
     Size layoutAllVisible(sal_uInt32 nEntryCount);
     void layoutToGivenHeight(sal_uInt32 nHeight, sal_uInt32 nEntryCount);
 
diff --git a/svx/source/tbxctrls/PaletteManager.cxx 
b/svx/source/tbxctrls/PaletteManager.cxx
index fb592d1b3a06..cde719e6a114 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -235,7 +235,13 @@ void PaletteManager::ReloadColorSet(SvxColorValueSet 
&rColorSet)
             std::set<Color> aColors = pDocSh->GetDocColors();
             mnColorCount = aColors.size();
             rColorSet.Clear();
-            rColorSet.addEntriesForColorSet(aColors, Concat2View(SvxResId( 
RID_SVXSTR_DOC_COLOR_PREFIX ) + " ") );
+            const OUString sNamePrefix = SvxResId(RID_SVXSTR_DOC_COLOR_PREFIX) 
+ u" ";
+            sal_uInt32 nIndex = 1;
+            for(const auto& rColor : aColors)
+            {
+                rColorSet.InsertItem(nIndex, rColor, sNamePrefix + 
OUString::number(nIndex));
+                nIndex++;
+            }
         }
     }
     else
diff --git a/svx/source/tbxctrls/SvxColorValueSet.cxx 
b/svx/source/tbxctrls/SvxColorValueSet.cxx
index 737b0ab93874..ee24b81170dd 100644
--- a/svx/source/tbxctrls/SvxColorValueSet.cxx
+++ b/svx/source/tbxctrls/SvxColorValueSet.cxx
@@ -71,27 +71,6 @@ void SvxColorValueSet::addEntriesForXColorList(const 
XColorList& rXColorList)
     }
 }
 
-void SvxColorValueSet::addEntriesForColorSet(const std::set<Color>& rColorSet, 
std::u16string_view rNamePrefix)
-{
-    sal_uInt32 nStartIndex = 1;
-    if(!rNamePrefix.empty())
-    {
-        for(const auto& rColor : rColorSet)
-        {
-            InsertItem(nStartIndex, rColor, rNamePrefix + 
OUString::number(nStartIndex));
-            nStartIndex++;
-        }
-    }
-    else
-    {
-        for(const auto& rColor : rColorSet)
-        {
-            InsertItem(nStartIndex, rColor, u""_ustr);
-            nStartIndex++;
-        }
-    }
-}
-
 Size SvxColorValueSet::layoutAllVisible(sal_uInt32 nEntryCount)
 {
     if(!nEntryCount)

Reply via email to