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:
@@ -1599,8 +1599,12 @@ wxTreeItemId wxGenericTreeCtrl::FindItem(const wxTreeItemId& idParent,
|
|||||||
{
|
{
|
||||||
itemid = GetNext(itemid);
|
itemid = GetNext(itemid);
|
||||||
}
|
}
|
||||||
// If we haven't found the item, id.IsOk() will be false, as per
|
// If we haven't found the item but wrapped back to the one we started
|
||||||
// documentation
|
// from, id.IsOk() must be false
|
||||||
|
if ( itemid == idParent )
|
||||||
|
{
|
||||||
|
itemid = wxTreeItemId();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return itemid;
|
return itemid;
|
||||||
|
|||||||
Reference in New Issue
Block a user