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
This commit is contained in:
Roberto Fernandez Bautista 2020-10-14 00:41:16 +01:00 committed by Jon Evans
parent d780cb7e7c
commit dcf69d53f0
2 changed files with 12 additions and 0 deletions

View File

@ -946,6 +946,11 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions()
dimension->Text().SetTextSize( wxSize( dimension->Text().SetTextSize( wxSize(
getKiCadLength( dimText.Width ), getKiCadLength( dimText.Height ) ) ); getKiCadLength( dimText.Width ), getKiCadLength( dimText.Height ) ) );
if( csDim.LinearUnits == UNITS::DESIGN )
{
csDim.LinearUnits = Assignments.Technology.Units;
}
switch( csDim.LinearUnits ) switch( csDim.LinearUnits )
{ {
case UNITS::METER: case UNITS::METER:
@ -962,6 +967,11 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions()
case UNITS::THOU: case UNITS::THOU:
dimension->SetUnits( EDA_UNITS::MILS ); dimension->SetUnits( EDA_UNITS::MILS );
break; break;
case UNITS::DESIGN:
wxASSERT( false ); // Should not be here
break;
} }
} }
continue; continue;

View File

@ -684,6 +684,8 @@ void CADSTAR_PCB_ARCHIVE_PARSER::PAD_SHAPE::Parse( XNODE* aNode )
LeftLength = GetXmlAttributeIDLong( aNode, 1 ); LeftLength = GetXmlAttributeIDLong( aNode, 1 );
KI_FALLTHROUGH; KI_FALLTHROUGH;
case PAD_SHAPE_TYPE::DIAMOND:
case PAD_SHAPE_TYPE::OCTAGON:
case PAD_SHAPE_TYPE::SQUARE: case PAD_SHAPE_TYPE::SQUARE:
if( aNode->GetChildren() ) if( aNode->GetChildren() )