Footprint viewer: Fix crash when truing to open the View menu.
This commit is contained in:
parent
c35ec8ae7c
commit
d701637eab
|
@ -50,7 +50,7 @@ ACTION_MENU* CONDITIONAL_MENU::create() const
|
||||||
void CONDITIONAL_MENU::AddItem( const TOOL_ACTION& aAction, const SELECTION_CONDITION& aCondition,
|
void CONDITIONAL_MENU::AddItem( const TOOL_ACTION& aAction, const SELECTION_CONDITION& aCondition,
|
||||||
int aOrder )
|
int aOrder )
|
||||||
{
|
{
|
||||||
assert( aAction.GetId() > 0 ); // Check if action was previously registered in ACTION_MANAGER
|
wxASSERT( aAction.GetId() > 0 ); // Check if action was previously registered in ACTION_MANAGER
|
||||||
addEntry( ENTRY( &aAction, aCondition, aOrder, false ) );
|
addEntry( ENTRY( &aAction, aCondition, aOrder, false ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ void CONDITIONAL_MENU::AddItem( const TOOL_ACTION& aAction, const SELECTION_COND
|
||||||
void CONDITIONAL_MENU::AddCheckItem( const TOOL_ACTION& aAction,
|
void CONDITIONAL_MENU::AddCheckItem( const TOOL_ACTION& aAction,
|
||||||
const SELECTION_CONDITION& aCondition, int aOrder )
|
const SELECTION_CONDITION& aCondition, int aOrder )
|
||||||
{
|
{
|
||||||
assert( aAction.GetId() > 0 ); // Check if action was previously registered in ACTION_MANAGER
|
wxASSERT( aAction.GetId() > 0 ); // Check if action was previously registered in ACTION_MANAGER
|
||||||
addEntry( ENTRY( &aAction, aCondition, aOrder, true ) );
|
addEntry( ENTRY( &aAction, aCondition, aOrder, true ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,29 +133,37 @@ void CONDITIONAL_MENU::Evaluate( SELECTION& aSelection )
|
||||||
menuItem = Add( *entry.Action(), entry.IsCheckmarkEntry() );
|
menuItem = Add( *entry.Action(), entry.IsCheckmarkEntry() );
|
||||||
menu_count++;
|
menu_count++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ENTRY::MENU:
|
case ENTRY::MENU:
|
||||||
menuItem = Add( entry.Menu() );
|
menuItem = Add( entry.Menu() );
|
||||||
menu_count++;
|
menu_count++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ENTRY::WXITEM:
|
case ENTRY::WXITEM:
|
||||||
menuItem = Append( entry.wxItem()->GetId(), entry.wxItem()->GetItemLabel(),
|
menuItem = Append( entry.wxItem()->GetId(), entry.wxItem()->GetItemLabel(),
|
||||||
entry.wxItem()->GetHelp(), entry.wxItem()->GetKind() );
|
entry.wxItem()->GetHelp(), entry.wxItem()->GetKind() );
|
||||||
menu_count++;
|
menu_count++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ENTRY::SEPARATOR:
|
case ENTRY::SEPARATOR:
|
||||||
if( menu_count )
|
if( menu_count )
|
||||||
menuItem = AppendSeparator();
|
menuItem = AppendSeparator();
|
||||||
|
|
||||||
menu_count = 0;
|
menu_count = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
assert( false );
|
wxASSERT( false );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( entry.IsCheckmarkEntry() )
|
if( menuItem )
|
||||||
menuItem->Check( result );
|
{
|
||||||
else
|
if( entry.IsCheckmarkEntry() )
|
||||||
menuItem->Enable( result );
|
menuItem->Check( result );
|
||||||
|
else
|
||||||
|
menuItem->Enable( result );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue