]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/list.cpp
a micro bug (but which was enough to break regtest sample) corrected
[wxWidgets.git] / src / common / list.cpp
index ac936bb26570a3d1b6b1de7304c059d9c1ae2012..8622d286bc0f25cbbfc084cdc7f9cb2b12cc65b1 100644 (file)
@@ -24,6 +24,7 @@
 #include "wx/defs.h"
 #include "wx/list.h"
 #include "wx/utils.h"
 #include "wx/defs.h"
 #include "wx/list.h"
 #include "wx/utils.h"
+#include <wx/intl.h>
 #endif
 
 // Sun CC compatibility (interference with xview/pkg.h, apparently...)
 #endif
 
 // Sun CC compatibility (interference with xview/pkg.h, apparently...)
@@ -132,7 +133,7 @@ wxList::wxList (void)
   key_type = wxKEY_NONE;
 }
 
   key_type = wxKEY_NONE;
 }
 
-wxList::wxList (const int N, wxObject * Objects[])
+wxList::wxList (int N, wxObject * Objects[])
 {
   wxNode *last = NULL;
 
 {
   wxNode *last = NULL;
 
@@ -174,7 +175,7 @@ wxList::wxList (wxObject * first_one...)
     {
       wxObject *object = va_arg (ap, wxObject *);
 //    if (object == NULL) // Doesn't work in Windows -- segment is non-zero for NULL!
     {
       wxObject *object = va_arg (ap, wxObject *);
 //    if (object == NULL) // Doesn't work in Windows -- segment is non-zero for NULL!
-#ifdef __WINDOWS__
+#ifdef __WXMSW__
       if ((int) object == 0)
 #else
       if ((long) object == 0)
       if ((int) object == 0)
 #else
       if ((long) object == 0)
@@ -210,40 +211,6 @@ wxList::~wxList (void)
     }
 }
 
     }
 }
 
-#ifdef USE_STORABLE_CLASSES
-wxList::wxList( istream &stream, char *WXUNUSED(data) )
-{
-  char buf[200];
-  unsigned int num;
-  stream.read( (char*)(&num), sizeof(num) );
-  for (unsigned int i = 0; i < num; i++)
-  {
-    int len;
-    stream.read( (char*)(&len), sizeof(len) );
-    stream.read( (char*)(&buf), len );
-    buf[len] = 0;
-    Append( wxCreateStoredObject( buf, stream, NULL ) );
-  };
-};
-
-void wxList::StoreObject( ostream &stream )
-{
-  unsigned int num = Number();
-  stream.write( (char*)(&num), sizeof(num) );
-  wxNode *node = First();
-  while (node)
-  {
-    wxObject *obj = (wxObject*) node->Data();
-    wxClassInfo *obj_info = obj->GetClassInfo();
-    int len = strlen(obj_info->className);
-    stream.write( (char*)(&len), sizeof(len) );
-    stream.write( obj_info->className, len );
-    obj->StoreObject( stream );
-    node = node->Next();
-  };
-};
-#endif
-  
 wxNode *wxList::Append(wxObject *object)
 {
     wxNode *node = new wxNode(this, last_node, NULL, object);
 wxNode *wxList::Append(wxObject *object)
 {
     wxNode *node = new wxNode(this, last_node, NULL, object);
@@ -254,7 +221,7 @@ wxNode *wxList::Append(wxObject *object)
     return node;
 }
 
     return node;
 }
 
-wxNode *wxList::Nth (const int i) const
+wxNode *wxList::Nth (int i) const
 {
   int j = 0;
   for (wxNode * current = First (); current; current = current->Next ())
 {
   int j = 0;
   for (wxNode * current = First (); current; current = current->Next ())
@@ -266,7 +233,7 @@ wxNode *wxList::Nth (const int i) const
 
 }
 
 
 }
 
-wxNode *wxList::Find (const long key) const
+wxNode *wxList::Find (long key) const
 {
   wxNode *current = First();
   while (current)
 {
   wxNode *current = First();
   while (current)
@@ -286,7 +253,7 @@ wxNode *wxList::Find (const char *key) const
   {
       if (!current->key.string)
        {
   {
       if (!current->key.string)
        {
-         wxFatalError ("wxList: string key not present, probably did not Append correctly!");
+         wxFatalError (_("wxList: string key not present, probably did not Append correctly!"));
          break;
        }
       if (strcmp (current->key.string, key) == 0)
          break;
        }
       if (strcmp (current->key.string, key) == 0)
@@ -370,7 +337,7 @@ wxNode *wxList::Insert (wxNode * position, wxObject * object)
 }
 
 // Keyed append
 }
 
 // Keyed append
-wxNode *wxList::Append (const long key, wxObject * object)
+wxNode *wxList::Append (long key, wxObject * object)
 {
   wxNode *node = new wxNode (this, last_node, NULL, object, key);
   if (!first_node)
 {
   wxNode *node = new wxNode (this, last_node, NULL, object, key);
   if (!first_node)
@@ -525,7 +492,7 @@ wxStringList::wxStringList (const char *first...)
     {
       char *s = va_arg (ap, char *);
 //    if (s == NULL)
     {
       char *s = va_arg (ap, char *);
 //    if (s == NULL)
-#ifdef __WINDOWS__
+#ifdef __WXMSW__
       if ((int) s == 0)
 #else
       if ((long) s == 0)
       if ((int) s == 0)
 #else
       if ((long) s == 0)
@@ -582,7 +549,7 @@ void wxStringList::Delete (const char *s)
 }
 
 // Only makes new strings if arg is TRUE
 }
 
 // Only makes new strings if arg is TRUE
-char **wxStringList::ListToArray (const bool new_copies) const
+char **wxStringList::ListToArray (bool new_copies) const
 {
   char **string_array = new char *[Number ()];
   wxNode *node = First ();
 {
   char **string_array = new char *[Number ()];
   wxNode *node = First ();