X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/223d09f6b523aac674ef9b72a883dfa8d37c5d4e..61f0d452ea7e47fea18d0ab748095dc42d7dd66d:/src/common/list.cpp diff --git a/src/common/list.cpp b/src/common/list.cpp index e442699d80..9d88dea967 100644 --- a/src/common/list.cpp +++ b/src/common/list.cpp @@ -171,9 +171,38 @@ void wxListBase::DoCopy(const wxListBase& list) m_nodeFirst = m_nodeLast = (wxNodeBase *) NULL; - for ( wxNodeBase *node = list.GetFirst(); node; node = node->GetNext() ) - { - Append(node); + switch (m_keyType) { + + case wxKEY_INTEGER: + { + long key; + for ( wxNodeBase *node = list.GetFirst(); node; node = node->GetNext() ) + { + key = node->GetKeyInteger(); + Append(key, node->GetData()); + } + break; + } + + case wxKEY_STRING: + { + const wxChar *key; + for ( wxNodeBase *node = list.GetFirst(); node; node = node->GetNext() ) + { + key = node->GetKeyString(); + Append(key, node->GetData()); + } + break; + } + + default: + { + for ( wxNodeBase *node = list.GetFirst(); node; node = node->GetNext() ) + { + Append(node->GetData()); + } + break; + } } }