Remove useless check for NULL in wxFindWindowRecursively().
This is an internal function which is only ever called with non-NULL window. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78492 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1912,23 +1912,20 @@ wxWindow *wxFindWindowRecursively(const wxWindow *parent,
|
|||||||
long id,
|
long id,
|
||||||
wxFindWindowCmp cmp)
|
wxFindWindowCmp cmp)
|
||||||
{
|
{
|
||||||
if ( parent )
|
// see if this is the one we're looking for
|
||||||
{
|
if ( (*cmp)(parent, label, id) )
|
||||||
// see if this is the one we're looking for
|
return (wxWindow *)parent;
|
||||||
if ( (*cmp)(parent, label, id) )
|
|
||||||
return (wxWindow *)parent;
|
|
||||||
|
|
||||||
// It wasn't, so check all its children
|
// It wasn't, so check all its children
|
||||||
for ( wxWindowList::compatibility_iterator node = parent->GetChildren().GetFirst();
|
for ( wxWindowList::compatibility_iterator node = parent->GetChildren().GetFirst();
|
||||||
node;
|
node;
|
||||||
node = node->GetNext() )
|
node = node->GetNext() )
|
||||||
{
|
{
|
||||||
// recursively check each child
|
// recursively check each child
|
||||||
wxWindow *win = (wxWindow *)node->GetData();
|
wxWindow *win = (wxWindow *)node->GetData();
|
||||||
wxWindow *retwin = wxFindWindowRecursively(win, label, id, cmp);
|
wxWindow *retwin = wxFindWindowRecursively(win, label, id, cmp);
|
||||||
if (retwin)
|
if (retwin)
|
||||||
return retwin;
|
return retwin;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not found
|
// Not found
|
||||||
|
Reference in New Issue
Block a user