git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12736
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
void wxControlContainer::SetLastFocus(wxWindow *win)
{
// find the last _immediate_ child which got focus
void wxControlContainer::SetLastFocus(wxWindow *win)
{
// find the last _immediate_ child which got focus
- while ( win && win != m_winParent )
- win = win->GetParent();
+ wxWindow *winParent = win->GetParent();
+ if ( winParent == m_winParent )
+ break;
+
+ win = winParent;
}
wxASSERT_MSG( win, _T("attempt to set last focus to not a child?") );
}
wxASSERT_MSG( win, _T("attempt to set last focus to not a child?") );