fixed spurious assert in FindControl() (fixes patch 696147)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19446 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-03-03 00:00:52 +00:00
parent 7dc85fe2be
commit 652ab15353

View File

@@ -229,14 +229,22 @@ wxControl *wxToolBarBase::FindControl( int id )
node;
node = node->GetNext() )
{
wxControl *control = node->GetData()->GetControl();
if (control)
const wxToolBarToolBase * const tool = node->GetData();
if ( tool->IsControl() )
{
if (control->GetId() == id)
wxControl * const control = tool->GetControl();
if ( !control )
{
wxFAIL_MSG( _T("NULL control in toolbar?") );
}
else if ( control->GetId() == id )
{
// found
return control;
}
}
}
return NULL;
}