sc/source/ui/dbgui/filtdlg.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
New commits: commit 551e380ba436a82414e7f74e891972443fef3f45 Author: Mike Kaganski <[email protected]> AuthorDate: Mon Feb 23 13:36:07 2026 +0500 Commit: Mike Kaganski <[email protected]> CommitDate: Mon Feb 23 12:45:07 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/+/200029 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx index 51af5b60e842..20237d8ef68c 100644 --- a/sc/source/ui/dbgui/filtdlg.cxx +++ b/sc/source/ui/dbgui/filtdlg.cxx @@ -139,7 +139,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()); @@ -161,7 +161,7 @@ VirtualDevice* lcl_getColorImage(const Color &rColor) xDevice->DrawRect(aRect); - return xDevice.get(); + return xDevice; } } @@ -656,8 +656,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();
