From ce2fe79863078b80bb3c5e4330441d0d14133c7c Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Tue, 20 Jan 2009 19:43:58 +0000 Subject: [PATCH] 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 --- src/generic/datavgen.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index f170ed7a56..b99a103b8e 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -2542,6 +2542,9 @@ wxDataViewTreeNode * wxDataViewMainWindow::FindNode( const wxDataViewItem & item wxDataViewModel * model = GetOwner()->GetModel(); if( model == NULL ) return NULL; + + if (!item.IsOk()) + return m_root; //Compose the a parent-chain of the finding item ItemList list; @@ -2743,6 +2746,7 @@ static void BuildTreeHelper( wxDataViewModel * model, wxDataViewItem & item, wx wxDataViewItemArray children; unsigned int num = model->GetChildren( item, children); + unsigned int index = 0; while( index < num ) {