diff --git a/gerbview/gerber_file_image.cpp b/gerbview/gerber_file_image.cpp index e40ced885f..5293559241 100644 --- a/gerbview/gerber_file_image.cpp +++ b/gerbview/gerber_file_image.cpp @@ -385,9 +385,10 @@ void GERBER_FILE_IMAGE::RemoveAttribute( X2_ATTRIBUTE& aAttribute ) * if a attribute name is specified (for instance %TD.CN*%) is specified, * only this attribute is cleared */ - m_NetAttributeDict.ClearAttribute( &aAttribute.GetPrm( 1 ) ); + wxString cmd = aAttribute.GetPrm( 0 ); + m_NetAttributeDict.ClearAttribute( &cmd ); - if( aAttribute.GetPrm( 1 ).IsEmpty() || aAttribute.GetPrm( 1 ) == ".AperFunction" ) + if( cmd.IsEmpty() || cmd == ".AperFunction" ) m_AperFunction.Clear(); } diff --git a/gerbview/rs274x.cpp b/gerbview/rs274x.cpp index f5d34a2b54..7c8eeb73a1 100644 --- a/gerbview/rs274x.cpp +++ b/gerbview/rs274x.cpp @@ -171,8 +171,10 @@ bool GERBER_FILE_IMAGE::ReadRS274XCommand( char *aBuff, unsigned int aBuffSize, default: code_command = ReadXCommandID( aText ); ok = ExecuteRS274XCommand( code_command, aBuff, aBuffSize, aText ); + if( !ok ) goto exit; + break; } } @@ -363,7 +365,7 @@ bool GERBER_FILE_IMAGE::ExecuteRS274XCommand( int aCommand, char* aBuff, case FILE_ATTRIBUTE: // Command %TF ... m_IsX2_file = true; - { + { X2_ATTRIBUTE dummy; dummy.ParseAttribCmd( m_Current_File, aBuff, aBuffSize, aText, m_LineNum ); @@ -380,7 +382,7 @@ bool GERBER_FILE_IMAGE::ExecuteRS274XCommand( int aCommand, char* aBuff, { m_PartString = dummy.GetPrm( 1 ); } - } + } break; case APERTURE_ATTRIBUTE: // Command %TA