Don't say a gerber is an X2 unless the whole attribute is loaded

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7303
This commit is contained in:
Jon Evans 2021-01-27 17:17:32 -05:00
parent 3e42ba18a9
commit ff4c01c4a4
2 changed files with 6 additions and 1 deletions

View File

@ -788,6 +788,8 @@ int LAYERS_MAP_DIALOG::findNumX2GerbersLoaded( std::vector<int>& aGerber2KicadMa
if( images->GetGbrImage( ii )->m_IsX2_file )
{
wxCHECK( x2, numKicadMatches );
if( x2->IsCopper() )
{
// This is a copper layer, so figure out which one

View File

@ -383,7 +383,6 @@ bool GERBER_FILE_IMAGE::ExecuteRS274XCommand( int aCommand, char* aBuff,
break;
case FILE_ATTRIBUTE: // Command %TF ...
m_IsX2_file = true;
{
X2_ATTRIBUTE dummy;
dummy.ParseAttribCmd( m_Current_File, aBuff, aBuffSize, aText, m_LineNum );
@ -392,6 +391,10 @@ bool GERBER_FILE_IMAGE::ExecuteRS274XCommand( int aCommand, char* aBuff,
{
delete m_FileFunction;
m_FileFunction = new X2_ATTRIBUTE_FILEFUNCTION( dummy );
// Don't set this until we get a file function; other code expects m_IsX2_file == true
// to mean that we have a valid m_FileFunction
m_IsX2_file = true;
}
else if( dummy.IsFileMD5() )
{