vcl/inc/win/saldata.hxx     |    1 -
 vcl/win/app/salinst.cxx     |    1 -
 vcl/win/window/salframe.cxx |   15 ---------------
 3 files changed, 17 deletions(-)

New commits:
commit 16c2ef1f18666d8eed414e9133e171558f2c376d
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Mon Jul 14 11:12:10 2025 +0200
Commit:     Noel Grandin <noelgran...@gmail.com>
CommitDate: Tue Jul 15 10:55:58 2025 +0200

    remove mnCacheDCInUse
    
    Windows95 has not been supported for some time, we don't need this
    limitation anymore.
    
    Change-Id: I52a476bb1da4db8fc8e7a420f049c3f895549fa1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187891
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx
index 9ad1a925ced3..0f778866e772 100644
--- a/vcl/inc/win/saldata.hxx
+++ b/vcl/inc/win/saldata.hxx
@@ -113,7 +113,6 @@ public:
     sal_uInt16              mnStockPenCount;        // count of static pens
     sal_uInt16              mnStockBrushCount;      // count of static brushes
     WPARAM                  mnSalObjWantKeyEvt;     // KeyEvent that should be 
processed by SalObj-Hook
-    BYTE                    mnCacheDCInUse;         // count of CacheDC in use
     bool                    mbObjClassInit;         // is SALOBJECTCLASS 
initialised
     DWORD                   mnAppThreadId;          // Id from 
Application-Thread
     SalIcon*                mpFirstIcon;            // icon cache, points to 
first icon, NULL if none
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index 6f080a3f83e5..8f374dbe39d2 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -269,7 +269,6 @@ SalData::SalData()
     mnStockPenCount = 0;        // count of static pens
     mnStockBrushCount = 0;      // count of static brushes
     mnSalObjWantKeyEvt = 0;     // KeyEvent for the SalObj hook
-    mnCacheDCInUse = 0;         // count of CacheDC in use
     mbObjClassInit = false;     // is SALOBJECTCLASS initialised
     mnAppThreadId = 0;          // Id from Application-Thread
     mpFirstIcon = nullptr;      // icon cache, points to first icon, NULL if 
none
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index ddbce3e9e9ce..f2b78ea3bf05 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -947,8 +947,6 @@ bool WinSalFrame::ReleaseFrameGraphicsDC( WinSalGraphics* 
pGraphics )
     pGraphics->setHDC(nullptr);
     SendMessageW( pSalData->mpInstance->mhComWnd, SAL_MSG_RELEASEDC,
         reinterpret_cast<WPARAM>(mhWnd), reinterpret_cast<LPARAM>(hDC) );
-    if ( pGraphics == mpThreadGraphics )
-        pSalData->mnCacheDCInUse--;
     return true;
 }
 
@@ -1009,7 +1007,6 @@ WinSalFrame::~WinSalFrame()
 
 bool WinSalFrame::InitFrameGraphicsDC( WinSalGraphics *pGraphics, HDC hDC, 
HWND hWnd )
 {
-    SalData* pSalData = GetSalData();
     assert( pGraphics );
     pGraphics->setHWND( hWnd );
 
@@ -1021,9 +1018,6 @@ bool WinSalFrame::InitFrameGraphicsDC( WinSalGraphics 
*pGraphics, HDC hDC, HWND
 
     if ( !hDC )
         return false;
-
-    if ( pGraphics == mpThreadGraphics )
-        pSalData->mnCacheDCInUse++;
     return true;
 }
 
@@ -1041,11 +1035,6 @@ SalGraphics* WinSalFrame::AcquireGraphics()
     // WM_ERASEBACKGROUND message
     if ( !pSalData->mpInstance->IsMainThread() )
     {
-        // We use only three CacheDC's for all threads, because W9x is limited
-        // to max. 5 Cache DC's per thread
-        if ( pSalData->mnCacheDCInUse >= 3 )
-            return nullptr;
-
         if ( !mpThreadGraphics )
             mpThreadGraphics = new WinSalGraphics(WinSalGraphics::WINDOW, 
true, mhWnd, this);
         pGraphics = mpThreadGraphics;
@@ -1502,8 +1491,6 @@ void WinSalFrame::ImplSetParentFrame( HWND hNewParentWnd, 
bool bAsChild )
     HPEN    hPen    = nullptr;
     HBRUSH  hBrush  = nullptr;
 
-    int oldCount = pSalData->mnCacheDCInUse;
-
     // release the thread DC
     if ( mpThreadGraphics )
     {
@@ -1550,8 +1537,6 @@ void WinSalFrame::ImplSetParentFrame( HWND hNewParentWnd, 
bool bAsChild )
                 SelectObject( hDC, hPen );
             if( hBrush )
                 SelectObject( hDC, hBrush );
-
-            SAL_WARN_IF( oldCount != pSalData->mnCacheDCInUse, "vcl", 
"WinSalFrame::SetParent() hDC count corrupted");
         }
     }
 

Reply via email to