]> git.saurik.com Git - wxWidgets.git/commitdiff
Updated depricated stuff
authorDavid Webster <Dave.Webster@bhmi.com>
Wed, 25 Feb 2004 23:03:46 +0000 (23:03 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Wed, 25 Feb 2004 23:03:46 +0000 (23:03 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25947 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/os2/gdiimage.h
src/os2/gdiimage.cpp

index 0f5241443115ac4402de4f8457d86f40c037fa4b..422d3d4b05f584fe7b4d5976aa656c9c260b116f 100644 (file)
@@ -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_
index a3ccae8a117a426d1d988d17a018750146f34c90..24c76a3dabbb030449499afb52b007b173fbd16b 100644 (file)
@@ -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;
     }
 }