]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed wxList copy ctor (patch 985473)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 25 Jul 2004 15:59:23 +0000 (15:59 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 25 Jul 2004 15:59:23 +0000 (15:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28478 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/list.h

index c4e483ecd7fec4a33d905ec92a8658cbaf8325eb..80353b3fdb28feebb8d86c1688e1b18adbe31e0c 100644 (file)
@@ -446,11 +446,8 @@ public:
     wxListBase(void *object, ... /* terminate with NULL */);
 
 protected:
-        // copy ctor and assignment operator
-    wxListBase(const wxListBase& list) : wxObject()
-        { Init(); DoCopy(list); }
-    wxListBase& operator=(const wxListBase& list)
-        { Clear(); DoCopy(list); return *this; }
+    void Assign(const wxListBase& list)
+        { Clear(); DoCopy(list); }
 
         // get list head/tail
     wxNodeBase *GetFirst() const { return m_nodeFirst; }
@@ -604,11 +601,13 @@ private:
                                                                             \
         name(wxKeyType keyType = wxKEY_NONE) : wxListBase(keyType)          \
             { }                                                             \
+        name(const name& list) : wxListBase(list.GetKeyType())              \
+            { Assign(list); }                                               \
         name(size_t count, T *elements[])                                   \
             : wxListBase(count, (void **)elements) { }                      \
                                                                             \
         name& operator=(const name& list)                                   \
-            { (void) wxListBase::operator=(list); return *this; }           \
+            { Assign(list); return *this; }                                 \
                                                                             \
         nodetype *GetFirst() const                                          \
             { return (nodetype *)wxListBase::GetFirst(); }                  \