Fix bugs 1264236, 1264238, 1264254

This commit is contained in:
jean-pierre charras 2013-12-29 12:01:54 +01:00
parent 46e82e4e18
commit a455ab4a90
3 changed files with 23 additions and 9 deletions

View File

@ -636,7 +636,7 @@ void EDA_DRAW_FRAME::ClearMsgPanel( void )
void EDA_DRAW_FRAME::SetMsgPanel( const MSG_PANEL_ITEMS& aList )
{
if( m_messagePanel == NULL && !aList.empty() )
if( m_messagePanel == NULL )
return;
ClearMsgPanel();

View File

@ -71,6 +71,7 @@ double AM_PARAM::GetValue( const D_CODE* aDcode ) const
double paramvalue = 0.0;
double curr_value = 0.0;
parm_item_type state = POPVALUE;
for( unsigned ii = 0; ii < m_paramStack.size(); ii++ )
{
AM_PARAM_ITEM item = m_paramStack[ii];
@ -85,12 +86,19 @@ double AM_PARAM::GetValue( const D_CODE* aDcode ) const
case PUSHPARM:
// get the parameter from the aDcode
if( aDcode && item.GetIndex() <= aDcode->GetParamCount() )
curr_value = aDcode->GetParam( item.GetIndex() );
else // Get parameter from local param definition
if( aDcode ) // should be always true here
{
const APERTURE_MACRO * am_parent = aDcode->GetMacro();
curr_value = am_parent->GetLocalParam( aDcode, item.GetIndex() );
if( item.GetIndex() <= aDcode->GetParamCount() )
curr_value = aDcode->GetParam( item.GetIndex() );
else // Get parameter from local param definition
{
const APERTURE_MACRO * am_parent = aDcode->GetMacro();
curr_value = am_parent->GetLocalParam( aDcode, item.GetIndex() );
}
}
else
{
wxLogDebug( wxT( "AM_PARAM::GetValue(): NULL param aDcode\n" ) );
}
// Fall through
case PUSHVALUE: // a value is on the stack:

View File

@ -1154,12 +1154,18 @@ void TRACK::GetMsgPanelInfoBase( std::vector< MSG_PANEL_ITEM >& aList )
LAYER_NUM top_layer, bottom_layer;
Via->ReturnLayerPair( &top_layer, &bottom_layer );
msg = board->GetLayerName( top_layer ) + wxT( "/" )
+ board->GetLayerName( bottom_layer );
if( board )
msg = board->GetLayerName( top_layer ) + wxT( "/" )
+ board->GetLayerName( bottom_layer );
else
msg.Printf(wxT("%d/%d"), top_layer, bottom_layer );
}
else
{
msg = board->GetLayerName( m_Layer );
if( board )
msg = board->GetLayerName( m_Layer );
else
msg.Printf(wxT("%d"), m_Layer );
}
aList.push_back( MSG_PANEL_ITEM( _( "Layer" ), msg, BROWN ) );