sc/source/ui/dbgui/filtdlg.cxx |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 75c8787d6c5c6db94af81d9abb5365a804a750c8
Author:     Mike Kaganski <[email protected]>
AuthorDate: Mon Feb 23 13:36:07 2026 +0500
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Feb 23 10:48:25 2026 +0100

    fix VirtualDevice GDI handle leaks in ScFilterDlg
    
    Similar to commit e9392c0c86fcf373e00ede92f8ceeee2c7efd233 (fix
    VirtualDevice GDI handle leaks across IconView callers, 2026-02-21).
    
    Change-Id: Ia5d25a4d316982454bbbe58a9540e0088927c21c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200030
    Reviewed-by: Andras Timar <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index 072459641687..fa46871343ae 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -135,7 +135,7 @@ ScFilterDlg::~ScFilterDlg()
 }
 
 namespace {
-VirtualDevice* lcl_getColorImage(const Color &rColor)
+ScopedVclPtr<VirtualDevice> lcl_getColorImage(const Color &rColor)
 {
     const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
     Size aImageSize(rStyleSettings.GetListBoxPreviewDefaultPixelSize());
@@ -157,7 +157,7 @@ VirtualDevice* lcl_getColorImage(const Color &rColor)
 
     xDevice->DrawRect(aRect);
 
-    return xDevice.get();
+    return xDevice;
 }
 }
 
@@ -666,8 +666,7 @@ void ScFilterDlg::UpdateColorList(size_t nList)
         }
         else
         {
-            VirtualDevice* pDev = lcl_getColorImage(rColor);
-            maColorLbArr[nPos]->append(sId, OUString(), *pDev);
+            maColorLbArr[nPos]->append(sId, OUString(), 
*lcl_getColorImage(rColor));
         }
 
         const auto& rItem = rEntry.GetQueryItem();

Reply via email to