From 1f8b8785bf01e2bde40e50130a610a20f2909247 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 6 Aug 2001 11:58:05 +0000 Subject: [PATCH] bug in SetLastFocus corrected git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11294 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/containr.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/common/containr.cpp b/src/common/containr.cpp index f818d7ebb1..2cac0008ac 100644 --- a/src/common/containr.cpp +++ b/src/common/containr.cpp @@ -51,13 +51,9 @@ wxControlContainer::wxControlContainer(wxWindow *winParent) void wxControlContainer::SetLastFocus(wxWindow *win) { // find the last _immediate_ child which got focus - while ( win ) + while ( win && win != m_winParent ) { - wxWindow *parent = win->GetParent(); - if ( parent == m_winParent ) - break; - - win = parent; + win = win->GetParent(); } wxASSERT_MSG( win, _T("attempt to set last focus to not a child?") ); -- 2.47.2