]> git.saurik.com Git - wxWidgets.git/commitdiff
bug in SetLastFocus corrected
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 6 Aug 2001 11:58:05 +0000 (11:58 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 6 Aug 2001 11:58:05 +0000 (11:58 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11294 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/containr.cpp

index f818d7ebb1d6321695b0556aca89cfbbc5880f2b..2cac0008accd3ddc106fc5213faae21029b0835a 100644 (file)
@@ -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?") );