cui/source/inc/cuitabarea.hxx    |    6 +++---
 cui/source/tabpages/tpbitmap.cxx |    6 +++---
 cui/source/tabpages/tpgradnt.cxx |    8 ++++----
 cui/source/tabpages/tphatch.cxx  |    8 ++++----
 4 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit e05be93be0c4e8fb2bc99dc5c0ff23fd7f5ba348
Author:     Mike Kaganski <[email protected]>
AuthorDate: Sat Feb 21 17:50:32 2026 +0500
Commit:     Mike Kaganski <[email protected]>
CommitDate: Sat Feb 21 16:11:59 2026 +0100

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

diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 5d3b5d4ba786..229615f56ec0 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -506,7 +506,7 @@ private:
 
     sal_Int32 SearchHatchList(std::u16string_view rHatchName);
 
-    static VclPtr<VirtualDevice> GetVirtualDevice(BitmapEx aBitmap);
+    static ScopedVclPtr<VirtualDevice> GetVirtualDevice(BitmapEx aBitmap);
     void FillPresetListBox();
     void ShowContextMenu(const Point& pPos);
     void MenuSelect(const OUString& rIdent);
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index f5646875b0a3..b9067eef2f5c 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -153,7 +153,7 @@ void SvxHatchTabPage::FillPresetListBox()
 
         OUString sId = OUString::number(nId);
         BitmapEx aBitmap = m_pHatchingList->GetBitmapForPreview(nId, 
aIconSize);
-        VclPtr<VirtualDevice> aVDev = GetVirtualDevice(aBitmap);
+        auto aVDev = GetVirtualDevice(aBitmap);
 
         if (!m_xHatchLB->get_id(nId).isEmpty())
         {
@@ -447,7 +447,7 @@ void SvxHatchTabPage::AddHatch(const OUString& aName, 
tools::Long nCount)
     OUString sId = nCount > 0 ? m_xHatchLB->get_id( nCount - 1 ) : OUString();
     sal_Int32 nId = !sId.isEmpty() ? sId.toInt32() : -1;
     BitmapEx aBitmap = m_pHatchingList->GetBitmapForPreview( nCount, aIconSize 
);
-    VclPtr<VirtualDevice> pVDev = GetVirtualDevice(aBitmap);
+    auto pVDev = GetVirtualDevice(aBitmap);
 
     m_xHatchLB->insert( nId + 1, &aName, &sId, pVDev, nullptr);
     FillPresetListBox();
@@ -529,7 +529,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickModifyHdl_Impl, 
weld::Button&, void)
     m_pHatchingList->Replace(std::make_unique<XHatchEntry>(aXHatch, aName), 
nPos);
 
     BitmapEx aBitmap = m_pHatchingList->GetBitmapForPreview( 
static_cast<sal_uInt16>(nPos), aIconSize );
-    VclPtr<VirtualDevice> pVDev = GetVirtualDevice(aBitmap);
+    auto pVDev = GetVirtualDevice(aBitmap);
 
     m_xHatchLB->remove( nPos );
     m_xHatchLB->insert( nPos, &aName, &sId, pVDev, nullptr);
@@ -546,7 +546,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickModifyHdl_Impl, 
weld::Button&, void)
     m_nHatchingListState |= ChangeType::MODIFIED;
 }
 
-VclPtr<VirtualDevice> SvxHatchTabPage::GetVirtualDevice(BitmapEx aBitmap)
+ScopedVclPtr<VirtualDevice> SvxHatchTabPage::GetVirtualDevice(BitmapEx aBitmap)
 {
     VclPtr<VirtualDevice> pVDev = VclPtr<VirtualDevice>::Create();
     const Point aNull(0, 0);
commit aa5fc54d295b9e7446c993bae8cc2a15ca75f710
Author:     Mike Kaganski <[email protected]>
AuthorDate: Sat Feb 21 17:46:30 2026 +0500
Commit:     Mike Kaganski <[email protected]>
CommitDate: Sat Feb 21 16:11:52 2026 +0100

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

diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 343d7ca9044d..5d3b5d4ba786 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -427,7 +427,7 @@ private:
     // MCGR: Preserve ColorStops until we have a UI to edit these
     basegfx::BColorStops createColorStops();
 
-    static VclPtr<VirtualDevice> GetVirtualDevice(BitmapEx aBitmap);
+    static ScopedVclPtr<VirtualDevice> GetVirtualDevice(BitmapEx aBitmap);
     void FillPresetListBox();
     void ShowContextMenu(const Point& pPos);
     void MenuSelect(const OUString& rIdent);
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index 048c9c638d5d..2d5d3cd63bd9 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -152,7 +152,7 @@ void SvxGradientTabPage::FillPresetListBox()
 
         OUString sId = OUString::number(nId);
         BitmapEx aBitmap = m_pGradientList->GetBitmapForPreview(nId, 
aIconSize);
-        VclPtr<VirtualDevice> aVDev = GetVirtualDevice(aBitmap);
+        auto aVDev = GetVirtualDevice(aBitmap);
 
         if (!m_xGradientLB->get_id(nId).isEmpty())
         {
@@ -414,7 +414,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, 
weld::Button&, void)
         OUString sId = nCount > 0 ? m_xGradientLB->get_id( nCount - 1 ) : 
OUString();
         sal_Int32 nId = !sId.isEmpty() ? sId.toInt32() : -1;
         BitmapEx aBitmap = m_pGradientList->GetBitmapForPreview( nCount, 
aIconSize );
-        VclPtr<VirtualDevice> pVDev = GetVirtualDevice(aBitmap);
+        auto pVDev = GetVirtualDevice(aBitmap);
 
         m_xGradientLB->insert( nId + 1, &aName, &sId, pVDev, nullptr);
         FillPresetListBox();
@@ -430,7 +430,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, 
weld::Button&, void)
         m_xBtnModify->set_sensitive(true);
 }
 
-VclPtr<VirtualDevice> SvxGradientTabPage::GetVirtualDevice(BitmapEx aBitmap)
+ScopedVclPtr<VirtualDevice> SvxGradientTabPage::GetVirtualDevice(BitmapEx 
aBitmap)
 {
     VclPtr<VirtualDevice> pVDev = VclPtr<VirtualDevice>::Create();
     const Point aNull(0, 0);
@@ -471,7 +471,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl, 
weld::Button&, void)
     m_pGradientList->Replace(std::make_unique<XGradientEntry>(aBGradient, 
aName), nPos);
 
     BitmapEx aBitmap = m_pGradientList->GetBitmapForPreview( 
static_cast<sal_uInt16>(nPos), aIconSize );
-    VclPtr<VirtualDevice> pVDev = GetVirtualDevice(aBitmap);
+    auto pVDev = GetVirtualDevice(aBitmap);
 
     m_xGradientLB->remove( nPos );
     m_xGradientLB->insert( nPos, &aName, &sId, pVDev, nullptr);
commit d4776eb870a0dbcd1c2f39f6e4e61ec85a3cbd20
Author:     Mike Kaganski <[email protected]>
AuthorDate: Sat Feb 21 17:40:50 2026 +0500
Commit:     Mike Kaganski <[email protected]>
CommitDate: Sat Feb 21 16:11:47 2026 +0100

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

diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 7b73d54b1c48..343d7ca9044d 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -597,7 +597,7 @@ private:
     void CalculateBitmapPresetSize();
     sal_Int32 SearchBitmapList(std::u16string_view rBitmapName);
     sal_Int32 SearchBitmapList(const GraphicObject& rGraphicObject);
-    static VclPtr<VirtualDevice> GetVirtualDevice(BitmapEx aBitmap);
+    static ScopedVclPtr<VirtualDevice> GetVirtualDevice(BitmapEx aBitmap);
     void FillPresetListBox();
     void ShowContextMenu(const Point& pPos);
     void ClickRenameHdl();
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index f5df6a344aec..63b53a63f721 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -168,7 +168,7 @@ void SvxBitmapTabPage::FillPresetListBox()
 
         OUString sId = OUString::number(nId);
         BitmapEx aBitmap = m_pBitmapList->GetBitmapForPreview(nId, aIconSize);
-        VclPtr<VirtualDevice> aVDev = GetVirtualDevice(aBitmap);
+        auto aVDev = GetVirtualDevice(aBitmap);
         OUString sImageName = pEntry->GetName();
 
         if (!m_xBitmapLB->get_id(nId).isEmpty())
@@ -872,7 +872,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, 
weld::Button&, void)
             OUString sId = nCount > 0 ? m_xBitmapLB->get_id( nCount - 1 ) : 
OUString();
             sal_Int32 nId = !sId.isEmpty() ? sId.toInt32() : -1;
             BitmapEx aBitmap = m_pBitmapList->GetBitmapForPreview( nCount, 
aIconSize );
-            VclPtr<VirtualDevice> pVDev = GetVirtualDevice(aBitmap);
+            auto pVDev = GetVirtualDevice(aBitmap);
 
             m_xBitmapLB->insert( nId + 1, &aName, &sId, pVDev, nullptr);
             FillPresetListBox();
@@ -892,7 +892,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, 
weld::Button&, void)
     }
 }
 
-VclPtr<VirtualDevice> SvxBitmapTabPage::GetVirtualDevice(BitmapEx aBitmap)
+ScopedVclPtr<VirtualDevice> SvxBitmapTabPage::GetVirtualDevice(BitmapEx 
aBitmap)
 {
     VclPtr<VirtualDevice> pVDev = VclPtr<VirtualDevice>::Create();
     const Point aNull(0, 0);

Reply via email to