Output fields in both multi-unit and single-unit cases.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15811
This commit is contained in:
Jeff Young 2023-10-03 17:38:10 +01:00
parent 95f05ee869
commit 979942e31a
1 changed files with 4 additions and 5 deletions

View File

@ -182,7 +182,6 @@ void NETLIST_EXPORTER_XML::addSymbolFields( XNODE* aNode, SCH_SYMBOL* aSymbol,
value = aSymbol->GetValueFieldText( m_resolveTextVars, aSheet, false );
footprint = aSymbol->GetFootprintFieldText( m_resolveTextVars, aSheet, false );
SCH_FIELD* footprintField = aSymbol->GetField( FOOTPRINT_FIELD );
SCH_FIELD* datasheetField = aSymbol->GetField( DATASHEET_FIELD );
SCH_FIELD* descriptionField = aSymbol->GetField( DESCRIPTION_FIELD );
@ -198,10 +197,6 @@ void NETLIST_EXPORTER_XML::addSymbolFields( XNODE* aNode, SCH_SYMBOL* aSymbol,
else
description = descriptionField->GetText();
fields[footprintField->GetName()] = footprint;
fields[datasheetField->GetName()] = datasheet;
fields[descriptionField->GetName()] = description;
for( int ii = MANDATORY_FIELDS; ii < aSymbol->GetFieldCount(); ++ii )
{
const SCH_FIELD& f = aSymbol->GetFields()[ ii ];
@ -213,6 +208,10 @@ void NETLIST_EXPORTER_XML::addSymbolFields( XNODE* aNode, SCH_SYMBOL* aSymbol,
}
}
fields[GetCanonicalFieldName( FOOTPRINT_FIELD )] = footprint;
fields[GetCanonicalFieldName( DATASHEET_FIELD )] = datasheet;
fields[GetCanonicalFieldName( DESCRIPTION_FIELD )] = description;
// Do not output field values blank in netlist:
if( value.size() )
aNode->AddChild( node( wxT( "value" ), UnescapeString( value ) ) );