From bb446c8d01d6686a924ea6f48e6ed38dfc8c99d5 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 16 Nov 2022 13:33:25 +0000 Subject: [PATCH] Set fields into instance data. Fixes https://gitlab.com/kicad/code/kicad/issues/12915 --- eeschema/sch_symbol.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/eeschema/sch_symbol.cpp b/eeschema/sch_symbol.cpp index c2bd8bc88b..720127bc67 100644 --- a/eeschema/sch_symbol.cpp +++ b/eeschema/sch_symbol.cpp @@ -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& 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 ); } }