FindNode() must return m_root for wxDataViewItem(0)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58248 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2009-01-20 19:43:58 +00:00
parent 821baf7da4
commit ce2fe79863

View File

@@ -2543,6 +2543,9 @@ wxDataViewTreeNode * wxDataViewMainWindow::FindNode( const wxDataViewItem & item
if( model == NULL ) if( model == NULL )
return NULL; return NULL;
if (!item.IsOk())
return m_root;
//Compose the a parent-chain of the finding item //Compose the a parent-chain of the finding item
ItemList list; ItemList list;
list.DeleteContents( true ); list.DeleteContents( true );
@@ -2743,6 +2746,7 @@ static void BuildTreeHelper( wxDataViewModel * model, wxDataViewItem & item, wx
wxDataViewItemArray children; wxDataViewItemArray children;
unsigned int num = model->GetChildren( item, children); unsigned int num = model->GetChildren( item, children);
unsigned int index = 0; unsigned int index = 0;
while( index < num ) while( index < num )
{ {