Browse Source

Clean layer parsing

NameToLayer will automatically return -1 on unrecognized layer names.
We don't need to gate this on a version
pcb_db
Seth Hillbrand 10 months ago
parent
commit
4a22570e87
  1. 6
      pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp

6
pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp

@ -1946,11 +1946,7 @@ void PCB_IO_KICAD_SEXPR_PARSER::parseLayers()
// was flipped. So we instead use position in the list.
for( size_t i = 1; i < cu.size() - 1; i++ )
{
int tmpLayer = -1;
// Older versions didn't have a dedicated user name field
if( m_requiredVersion >= 20200922 )
tmpLayer = LSET::NameToLayer( cu[i].m_name );
int tmpLayer = LSET::NameToLayer( cu[i].m_name );
if( tmpLayer < 0 )
tmpLayer = ( i + 1 ) * 2;

Loading…
Cancel
Save