]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/list.h
Fixed a crash when GetMonthControl returns NULL
[wxWidgets.git] / include / wx / list.h
index d2c4bf87fc802b9f25503ee05f24038b12faab87..79a809ed59f31a7a79d32ca048e90a08c29327dd 100644 (file)
@@ -92,14 +92,14 @@ class WXDLLEXPORT wxListKey
 {
 public:
     // implicit ctors
 {
 public:
     // implicit ctors
-    wxListKey()
-        { m_keyType = wxKEY_NONE; }
-    wxListKey(long i)
-        { m_keyType = wxKEY_INTEGER; m_key.integer = i; }
-    wxListKey(const wxChar *s)
-        { m_keyType = wxKEY_STRING; m_key.string = wxStrdup(s); }
-    wxListKey(const wxString& s)
-        { m_keyType = wxKEY_STRING; m_key.string = wxStrdup(s.c_str()); }
+    wxListKey() : m_keyType(wxKEY_NONE)
+        { }
+    wxListKey(long i) : m_keyType(wxKEY_INTEGER)
+        { m_key.integer = i; }
+    wxListKey(const wxChar *s) : m_keyType(wxKEY_STRING)
+        { m_key.string = wxStrdup(s); }
+    wxListKey(const wxString& s) : m_keyType(wxKEY_STRING)
+        { m_key.string = wxStrdup(s.c_str()); }
 
     // accessors
     wxKeyType GetKeyType() const { return m_keyType; }
 
     // accessors
     wxKeyType GetKeyType() const { return m_keyType; }
@@ -183,6 +183,8 @@ private:
                 *m_previous;
 
     wxListBase  *m_list;        // list we belong to
                 *m_previous;
 
     wxListBase  *m_list;        // list we belong to
+
+    DECLARE_NO_COPY_CLASS(wxNodeBase)
 };
 
 // -----------------------------------------------------------------------------
 };
 
 // -----------------------------------------------------------------------------
@@ -198,7 +200,8 @@ private:
     void Init(wxKeyType keyType = wxKEY_NONE); // Must be declared before it's used (for VC++ 1.5)
 public:
     // default ctor & dtor
     void Init(wxKeyType keyType = wxKEY_NONE); // Must be declared before it's used (for VC++ 1.5)
 public:
     // default ctor & dtor
-    wxListBase(wxKeyType keyType = wxKEY_NONE) { Init(keyType); }
+    wxListBase(wxKeyType keyType = wxKEY_NONE)
+        { Init(keyType); }
     virtual ~wxListBase();
 
     // accessors
     virtual ~wxListBase();
 
     // accessors
@@ -399,7 +402,7 @@ private:
             : wxListBase(count, (void **)elements) { }                      \
                                                                             \
         name& operator=(const name& list)                                   \
             : wxListBase(count, (void **)elements) { }                      \
                                                                             \
         name& operator=(const name& list)                                   \
-            { return (name&)wxListBase::operator=(list); }                  \
+            { (void) wxListBase::operator=(list); return *this; }           \
                                                                             \
         nodetype *GetFirst() const                                          \
             { return (nodetype *)wxListBase::GetFirst(); }                  \
                                                                             \
         nodetype *GetFirst() const                                          \
             { return (nodetype *)wxListBase::GetFirst(); }                  \
@@ -506,7 +509,7 @@ public:
    ~wxList() { }
 
     wxList& operator=(const wxList& list)
    ~wxList() { }
 
     wxList& operator=(const wxList& list)
-        { return (wxList&)wxListBase::operator=(list); }
+        { (void) wxListBase::operator=(list); return *this; }
 
     // compatibility methods
     void Sort(wxSortCompareFunction compfunc) { wxListBase::Sort(compfunc); }
 
     // compatibility methods
     void Sort(wxSortCompareFunction compfunc) { wxListBase::Sort(compfunc); }