]> git.saurik.com Git - wxWidgets.git/commitdiff
FindNode() must return m_root for wxDataViewItem(0)
authorRobert Roebling <robert@roebling.de>
Tue, 20 Jan 2009 19:43:58 +0000 (19:43 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 20 Jan 2009 19:43:58 +0000 (19:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58248 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/datavgen.cpp

index f170ed7a569fb1c73af7626304e0e9a0ee9729cd..b99a103b8e6144593467f24dff0555ab7a8fe74f 100644 (file)
@@ -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 )
     {