Browse Source

Fix duplicate symbol value fields when importing Eagle schematic.

Don't use the value field when adding Eagle part attributes to a symbol.
This issue was cause by using a mandatory symbol field ID instead of
using the next available field ID when adding new fields to as symbol.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13468
7.0
Wayne Stambaugh 3 years ago
parent
commit
52b07b8bac
  1. 17
      eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp

17
eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp

@ -1717,10 +1717,19 @@ void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode )
for( const auto& a : epart->attribute )
{
SCH_FIELD* field = symbol->AddField( *symbol->GetField( VALUE_FIELD ) );
field->SetName( a.first );
field->SetText( a.second );
field->SetVisible( false );
VECTOR2I newFieldPosition( 0, 0 );
SCH_FIELD* lastField = symbol->GetFieldById( symbol->GetFieldCount() - 1 );
if( lastField )
newFieldPosition = lastField->GetPosition();
SCH_FIELD newField( newFieldPosition, symbol->GetFieldCount(), symbol.get() );
newField.SetName( a.first );
newField.SetText( a.second );
newField.SetVisible( false );
symbol->AddField( newField );
}
for( const auto& a : epart->variant )

Loading…
Cancel
Save