From: Vadim Zeitlin Date: Sat, 16 Oct 2004 01:47:22 +0000 (+0000) Subject: fixed fatal bug when moving the control after itself in tab order X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ef6816ef25f4d5e0ff0100fd7e402419e9c0a794?hp=a45cd2334969f2de146a6dff7b1922c685fe0b0e fixed fatal bug when moving the control after itself in tab order git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29910 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 115b91a2c6..320bd80bee 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -2460,6 +2460,11 @@ void wxWindowBase::DoMoveInTabOrder(wxWindow *win, MoveKind move) wxCHECK_RET( GetParent(), _T("MoveBefore/AfterInTabOrder() don't work for TLWs!") ); + // detect the special case when we have nothing to do anyhow and when the + // code below wouldn't work + if ( win == this ) + return; + // find the target window in the siblings list wxWindowList& siblings = GetParent()->GetChildren(); wxWindowList::compatibility_iterator i = siblings.Find(win);