From: George Tasker Date: Tue, 30 Oct 2001 13:40:23 +0000 (+0000) Subject: Fixed code that should have been enclosed in brackets but wasn't, causing the program... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/5921a14eca14052876338c51229023496c6108c6?ds=inline Fixed code that should have been enclosed in brackets but wasn't, causing the program flow to abort part way through the function git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12213 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/contrib/src/fl/controlbar.cpp b/contrib/src/fl/controlbar.cpp index 6e87a6ed33..fd02e78c29 100644 --- a/contrib/src/fl/controlbar.cpp +++ b/contrib/src/fl/controlbar.cpp @@ -1194,34 +1194,35 @@ void wxFrameLayout::UnhookFromFrame() // FOR NOW:: if ( mpFrame->GetEventHandler() == this ) - + { mpFrame->PopEventHandler(); + return; + } - return; - - // TBD ???: Cannot reach this code if ( mpFrame ) { if ( this == mpFrame->GetEventHandler() ) - + { mpFrame->SetEventHandler( this->GetNextHandler() ); + } else - { - wxEvtHandler* pCur = mpFrame->GetEventHandler(); - - while( pCur ) - { - if ( pCur == this ) break; + { + wxEvtHandler* pCur = mpFrame->GetEventHandler(); - pCur = pCur->GetNextHandler(); - } + while ( pCur ) + { + if ( pCur == this ) + break; - // do not try to unhook ourselves if we're not hooked yet - if ( !pCur ) return; + pCur = pCur->GetNextHandler(); } - if ( GetPreviousHandler() ) + // do not try to unhook ourselves if we're not hooked yet + if ( !pCur ) + return; + } + if ( GetPreviousHandler() ) GetPreviousHandler()->SetNextHandler( GetNextHandler() ); else { @@ -1229,9 +1230,7 @@ void wxFrameLayout::UnhookFromFrame() return; } - if ( GetNextHandler() ) - GetNextHandler()->SetPreviousHandler( GetPreviousHandler() ); SetNextHandler( NULL );