Set fields into instance data.

Fixes https://gitlab.com/kicad/code/kicad/issues/12915
This commit is contained in:
Jeff Young 2022-11-16 13:33:25 +00:00
parent 1b3f03a800
commit bb446c8d01
1 changed files with 7 additions and 3 deletions

View File

@ -159,9 +159,13 @@ SCH_SYMBOL::SCH_SYMBOL( const LIB_SYMBOL& aSymbol, const SCH_SHEET_PATH* aSheet,
// Set any fields that were modified as part of the symbol selection
for( const std::pair<int, wxString>& i : aSel.Fields )
{
SCH_FIELD* field = GetFieldById( i.first );
if( field )
if( i.first == REFERENCE_FIELD )
SetRef( aSheet, i.second );
else if( i.first == VALUE_FIELD )
SetValue( aSheet, i.second );
else if( i.first == FOOTPRINT_FIELD )
SetFootprint( aSheet, i.second );
else if( SCH_FIELD* field = GetFieldById( i.first ) )
field->SetText( i.second );
}
}