bugfix: wxList's copy ctor now works with keyed lists
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4231 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -171,9 +171,38 @@ void wxListBase::DoCopy(const wxListBase& list)
|
|||||||
m_nodeFirst =
|
m_nodeFirst =
|
||||||
m_nodeLast = (wxNodeBase *) NULL;
|
m_nodeLast = (wxNodeBase *) NULL;
|
||||||
|
|
||||||
|
switch (m_keyType) {
|
||||||
|
|
||||||
|
case wxKEY_INTEGER:
|
||||||
|
{
|
||||||
|
long key;
|
||||||
for ( wxNodeBase *node = list.GetFirst(); node; node = node->GetNext() )
|
for ( wxNodeBase *node = list.GetFirst(); node; node = node->GetNext() )
|
||||||
{
|
{
|
||||||
Append(node);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user