From 214d8d3703b391f560dbbfcef0be6b57a324b133 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Tue, 18 Dec 2018 07:11:32 -0700 Subject: [PATCH] kicad2step: Handle quoted layers Quoted layers are parsed by kicad2step as strings but were only expecting symbols. This threw an error when exporting. --- utils/kicad2step/pcb/kicadpcb.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/utils/kicad2step/pcb/kicadpcb.cpp b/utils/kicad2step/pcb/kicadpcb.cpp index 4796d54e10..7cb6822ef3 100644 --- a/utils/kicad2step/pcb/kicadpcb.cpp +++ b/utils/kicad2step/pcb/kicadpcb.cpp @@ -323,9 +323,14 @@ bool KICADPCB::parseLayers( SEXPR::SEXPR* data ) wxLogMessage( "%s\n", ostr.str().c_str() ); return false; } + std::string ref; - m_layersNames[child->GetChild( 1 )->GetSymbol()] = - child->GetChild( 0 )->GetInteger(); + if( child->GetChild( 1 )->IsSymbol() ) + ref = child->GetChild( 1 )->GetSymbol(); + else + ref = child->GetChild( 1 )->GetString(); + + m_layersNames[ref] = child->GetChild( 0 )->GetInteger(); } return true;