7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 00:21:25 +00:00

Clean layer parsing

NameToLayer will automatically return -1 on unrecognized layer names.
We don't need to gate this on a version
This commit is contained in:
Seth Hillbrand 2025-01-08 15:48:18 -08:00
parent 066380ffeb
commit 4a22570e87

View File

@ -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;