Fix return value of wxGenericTreeCtrl::FindItem().

We incorrectly returned the item we started from instead of invalid item if
there was no match, fix this.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72637 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-10-07 22:41:38 +00:00
parent 4d1cf9f3d3
commit e0dec8753a

View File

@@ -1599,8 +1599,12 @@ wxTreeItemId wxGenericTreeCtrl::FindItem(const wxTreeItemId& idParent,
{
itemid = GetNext(itemid);
}
// If we haven't found the item, id.IsOk() will be false, as per
// documentation
// If we haven't found the item but wrapped back to the one we started
// from, id.IsOk() must be false
if ( itemid == idParent )
{
itemid = wxTreeItemId();
}
}
return itemid;