svtools/source/control/ctrltool.cxx |    4 ++--
 vcl/source/control/imp_listbox.cxx  |    5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit bac07e37a03b82c5033365f8c4f487445b57caec
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue Mar 18 11:35:45 2025 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Tue Mar 18 15:32:15 2025 +0100

    If combobox is UserDraw, then don't bother measuring text
    
    the UserItemSize is all that matters in this case. Which then
    side steps the issue of a sizeable glyph cache in the long
    lived font and styles comboboxes as it no longer gets filled.
    
    cat /proc/<kitbrokerpid>/smaps_rollup |grep Private|awk '{s+=$2} END {print 
s}'
    
    before: 102684 kB
    after:  100552 kB
    
    Change-Id: Ib8a0a149ca49c17c7b1ff47b6b56c52ae28e6eff
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183072
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/vcl/source/control/imp_listbox.cxx 
b/vcl/source/control/imp_listbox.cxx
index f132cb71920c..40da5907e246 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -603,6 +603,8 @@ SalLayoutGlyphs* ImplEntryType::GetTextGlyphs(const 
OutputDevice* pOutputDevice)
 
 void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry )
 {
+    const bool bIsUserDrawEnabled = IsUserDrawEnabled();
+
     ImplEntryMetrics aMetrics;
     aMetrics.bText = !rEntry.maStr.isEmpty();
     aMetrics.bImage = !!rEntry.maImage;
@@ -612,7 +614,7 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( 
ImplEntryType& rEntry )
     aMetrics.nImgWidth = 0;
     aMetrics.nImgHeight = 0;
 
-    if ( aMetrics.bText )
+    if (aMetrics.bText && !bIsUserDrawEnabled)
     {
         if( rEntry.mnFlags & ListBoxEntryFlags::MultiLine )
         {
@@ -657,7 +659,6 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( 
ImplEntryType& rEntry )
 
     }
 
-    bool bIsUserDrawEnabled = IsUserDrawEnabled();
     if (bIsUserDrawEnabled || aMetrics.bImage)
     {
         aMetrics.nEntryWidth = std::max( aMetrics.nImgWidth, 
maUserItemSize.Width() );
commit 4d18e41ca7466ac1488da4e39388a15935991500
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue Mar 18 12:23:46 2025 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Tue Mar 18 15:32:03 2025 +0100

    ImplFontListFontMetric is an o3tl::cow_wrapper so these created copies
    
    const them up to avoid that
    
    Change-Id: I36b0b33d9868feb70824df67d1eefbda9564e153
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183076
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/svtools/source/control/ctrltool.cxx 
b/svtools/source/control/ctrltool.cxx
index cb5cbb8074bb..a117b75123b9 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -133,8 +133,8 @@ static int sortWeightValue(FontWeight eWeight)
     return 0; // eWeight == WEIGHT_NORMAL
 }
 
-static sal_Int32 ImplCompareFontMetric( ImplFontListFontMetric* pInfo1,
-                                          ImplFontListFontMetric* pInfo2 )
+static sal_Int32 ImplCompareFontMetric(const ImplFontListFontMetric* pInfo1,
+                                       const ImplFontListFontMetric* pInfo2)
 {
     //Sort non italic before italics
     if ( pInfo1->GetItalic() < pInfo2->GetItalic() )

Reply via email to