From a24912d01dc3ee161451bb7c40e97454296c4c1d Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 21 Feb 2022 18:19:39 +0000 Subject: [PATCH] A bit of safety. --- pcbnew/plugins/kicad/pcb_parser.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pcbnew/plugins/kicad/pcb_parser.cpp b/pcbnew/plugins/kicad/pcb_parser.cpp index bc873150e1..8b93c00b94 100644 --- a/pcbnew/plugins/kicad/pcb_parser.cpp +++ b/pcbnew/plugins/kicad/pcb_parser.cpp @@ -4012,6 +4012,8 @@ PAD* PCB_PARSER::parsePAD( FOOTPRINT* aParent ) std::unique_ptr pad = std::make_unique( aParent ); + // File only contains a token if RemoveUnconnected is true + pad->SetRemoveUnconnected( false ); // File only contains a token if KeepTopBottom is true pad->SetKeepTopBottom( false ); @@ -4493,6 +4495,9 @@ PAD* PCB_PARSER::parsePAD( FOOTPRINT* aParent ) pad->SetNumber( wxEmptyString ); } + if( !pad->GetRemoveUnconnected() ) + pad->SetKeepTopBottom( true ); + return pad.release(); } @@ -4791,6 +4796,11 @@ PCB_VIA* PCB_PARSER::parsePCB_VIA() std::unique_ptr via = std::make_unique( m_board ); + // File only contains a token if RemoveUnconnected is true + via->SetRemoveUnconnected( false ); + // File only contains a token if KeepTopBottom is true + via->SetKeepTopBottom( false ); + for( token = NextTok(); token != T_RIGHT; token = NextTok() ) { if( token == T_locked ) @@ -4895,6 +4905,9 @@ PCB_VIA* PCB_PARSER::parsePCB_VIA() } } + if( !via->GetRemoveUnconnected() ) + via->SetKeepTopBottom( true ); + return via.release(); }