From 258f5b3ec3bc1b2c5f3e4037a1599bed04613108 Mon Sep 17 00:00:00 2001 From: David Webster Date: Wed, 25 Feb 2004 23:03:46 +0000 Subject: [PATCH] Updated depricated stuff git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25947 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/os2/gdiimage.h | 6 ++++-- src/os2/gdiimage.cpp | 39 +++++++++++++++++++-------------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/include/wx/os2/gdiimage.h b/include/wx/os2/gdiimage.h index 0f52414431..422d3d4b05 100644 --- a/include/wx/os2/gdiimage.h +++ b/include/wx/os2/gdiimage.h @@ -28,6 +28,8 @@ class WXDLLEXPORT wxGDIImageRefData; class WXDLLEXPORT wxGDIImageHandler; class WXDLLEXPORT wxGDIImage; +WX_DECLARE_EXPORTED_LIST(wxGDIImageHandler, wxGDIImageHandlerList); + // ---------------------------------------------------------------------------- // wxGDIImageRefData: common data fields for all derived classes // ---------------------------------------------------------------------------- @@ -149,7 +151,7 @@ class WXDLLEXPORT wxGDIImage : public wxGDIObject { public: // handlers list interface - static wxList& GetHandlers() { return ms_handlers; } + static wxGDIImageHandlerList& GetHandlers() { return ms_handlers; } static void AddHandler(wxGDIImageHandler* hHandler); static void InsertHandler(wxGDIImageHandler* hHandler); @@ -234,7 +236,7 @@ protected: // create the data for the derived class here virtual wxGDIImageRefData* CreateData() const = 0; - static wxList ms_handlers; + static wxGDIImageHandlerList ms_handlers; }; #endif // _WX_MSW_GDIIMAGE_H_ diff --git a/src/os2/gdiimage.cpp b/src/os2/gdiimage.cpp index a3ccae8a11..24c76a3dab 100644 --- a/src/os2/gdiimage.cpp +++ b/src/os2/gdiimage.cpp @@ -33,6 +33,9 @@ #include "wx/app.h" #include "wx/os2/gdiimage.h" +#include "wx/listimpl.cpp" +WX_DEFINE_LIST(wxGDIImageHandlerList); + // ---------------------------------------------------------------------------- // private classes // ---------------------------------------------------------------------------- @@ -234,7 +237,7 @@ static wxSize GetHiconSize(WXHICON hicon); // implementation // ============================================================================ -wxList wxGDIImage::ms_handlers; +wxGDIImageHandlerList wxGDIImage::ms_handlers; // ---------------------------------------------------------------------------- // wxGDIImage functions forwarded to wxGDIImageRefData @@ -333,33 +336,29 @@ wxGDIImageHandler* wxGDIImage::FindHandler( long lType ) { - wxNode* pNode = ms_handlers.First(); - - while (pNode) + wxGDIImageHandlerList::compatibility_iterator node = ms_handlers.GetFirst(); + while ( node ) { - wxGDIImageHandler* pHandler = (wxGDIImageHandler *)pNode->Data(); + wxGDIImageHandler *handler = node->GetData(); + if ( handler->GetType() == type ) + return handler; - if (pHandler->GetType() == lType) - return pHandler; - pNode = pNode->Next(); + node = node->GetNext(); } - return(NULL); + + return((wxGDIImageHandler*)NULL); } void wxGDIImage::CleanUpHandlers() { - wxNode* pNode = ms_handlers.First(); - - while (pNode) + wxGDIImageHandlerList::compatibility_iterator node = ms_handlers.GetFirst(); + while ( node ) { - wxGDIImageHandler* pHandler = (wxGDIImageHandler *)pNode->Data(); - wxNode* pNext = pNode->Next(); - - delete pHandler; -#if (!(defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 ))) - delete pNode; -#endif - pNode = pNext; + wxGDIImageHandler *handler = node->GetData(); + wxGDIImageHandlerList::compatibility_iterator next = node->GetNext(); + delete handler; + ms_handlers.Erase( node ); + node = next; } }