Fix appending of non-leaf node to wxGTK's wxDataViewCtrl.
This was accidentally broken in r68965: appending a branch node after all others node resulted in corruption of m_nodes, as the node was never added to the list. Fixes #13467. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69070 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -380,6 +380,7 @@ public:
|
|||||||
// Insert into m_nodes so that the order of nodes in m_nodes is the
|
// Insert into m_nodes so that the order of nodes in m_nodes is the
|
||||||
// same as the order of their corresponding IDs in m_children:
|
// same as the order of their corresponding IDs in m_children:
|
||||||
const unsigned int count = m_nodes.GetCount();
|
const unsigned int count = m_nodes.GetCount();
|
||||||
|
bool inserted = false;
|
||||||
for (unsigned i = 0; i < count; i++)
|
for (unsigned i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
wxGtkTreeModelNode *node = m_nodes[i];
|
wxGtkTreeModelNode *node = m_nodes[i];
|
||||||
@@ -387,9 +388,12 @@ public:
|
|||||||
if ( (unsigned)posInChildren >= pos )
|
if ( (unsigned)posInChildren >= pos )
|
||||||
{
|
{
|
||||||
m_nodes.Insert(child, i);
|
m_nodes.Insert(child, i);
|
||||||
|
inserted = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ( !inserted )
|
||||||
|
m_nodes.Add(child);
|
||||||
|
|
||||||
m_children.Insert( id, pos );
|
m_children.Insert( id, pos );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user