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
This commit is contained in:
@@ -1194,34 +1194,35 @@ void wxFrameLayout::UnhookFromFrame()
|
|||||||
// FOR NOW::
|
// FOR NOW::
|
||||||
|
|
||||||
if ( mpFrame->GetEventHandler() == this )
|
if ( mpFrame->GetEventHandler() == this )
|
||||||
|
{
|
||||||
mpFrame->PopEventHandler();
|
mpFrame->PopEventHandler();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// TBD ???: Cannot reach this code
|
|
||||||
if ( mpFrame )
|
if ( mpFrame )
|
||||||
{
|
{
|
||||||
if ( this == mpFrame->GetEventHandler() )
|
if ( this == mpFrame->GetEventHandler() )
|
||||||
|
{
|
||||||
mpFrame->SetEventHandler( this->GetNextHandler() );
|
mpFrame->SetEventHandler( this->GetNextHandler() );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxEvtHandler* pCur = mpFrame->GetEventHandler();
|
wxEvtHandler* pCur = mpFrame->GetEventHandler();
|
||||||
|
|
||||||
while( pCur )
|
while ( pCur )
|
||||||
{
|
{
|
||||||
if ( pCur == this ) break;
|
if ( pCur == this )
|
||||||
|
break;
|
||||||
|
|
||||||
pCur = pCur->GetNextHandler();
|
pCur = pCur->GetNextHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
// do not try to unhook ourselves if we're not hooked yet
|
// do not try to unhook ourselves if we're not hooked yet
|
||||||
if ( !pCur ) return;
|
if ( !pCur )
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( GetPreviousHandler() )
|
if ( GetPreviousHandler() )
|
||||||
|
|
||||||
GetPreviousHandler()->SetNextHandler( GetNextHandler() );
|
GetPreviousHandler()->SetNextHandler( GetNextHandler() );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1229,9 +1230,7 @@ void wxFrameLayout::UnhookFromFrame()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( GetNextHandler() )
|
if ( GetNextHandler() )
|
||||||
|
|
||||||
GetNextHandler()->SetPreviousHandler( GetPreviousHandler() );
|
GetNextHandler()->SetPreviousHandler( GetPreviousHandler() );
|
||||||
|
|
||||||
SetNextHandler( NULL );
|
SetNextHandler( NULL );
|
||||||
|
|||||||
Reference in New Issue
Block a user