From dcf69d53f022a599a13cde3592e8c2a041088449 Mon Sep 17 00:00:00 2001 From: Roberto Fernandez Bautista Date: Wed, 14 Oct 2020 00:41:16 +0100 Subject: [PATCH] CADSTAR PCB Archive Importer: Fix unhandled case statements Note: UNITS::DESIGN refer to the units defined in Assignments.Technology.Units Fixes https://gitlab.com/kicad/code/kicad/-/issues/5725 --- pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp | 10 ++++++++++ pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp | 2 ++ 2 files changed, 12 insertions(+) diff --git a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp index a79fd99bff..463b2b2326 100644 --- a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp +++ b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp @@ -946,6 +946,11 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions() dimension->Text().SetTextSize( wxSize( getKiCadLength( dimText.Width ), getKiCadLength( dimText.Height ) ) ); + if( csDim.LinearUnits == UNITS::DESIGN ) + { + csDim.LinearUnits = Assignments.Technology.Units; + } + switch( csDim.LinearUnits ) { case UNITS::METER: @@ -962,6 +967,11 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions() case UNITS::THOU: dimension->SetUnits( EDA_UNITS::MILS ); break; + + case UNITS::DESIGN: + wxASSERT( false ); // Should not be here + break; + } } continue; diff --git a/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp b/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp index 21b7d07cc4..c787464622 100644 --- a/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp +++ b/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp @@ -684,6 +684,8 @@ void CADSTAR_PCB_ARCHIVE_PARSER::PAD_SHAPE::Parse( XNODE* aNode ) LeftLength = GetXmlAttributeIDLong( aNode, 1 ); KI_FALLTHROUGH; + case PAD_SHAPE_TYPE::DIAMOND: + case PAD_SHAPE_TYPE::OCTAGON: case PAD_SHAPE_TYPE::SQUARE: if( aNode->GetChildren() )