Use fileds from flattened lib symbol when updating.

Fixes https://gitlab.com/kicad/code/kicad/issues/14577
This commit is contained in:
Jeff Young 2023-04-26 12:46:50 +01:00
parent 5b56cb6bdb
commit d816fb071f
1 changed files with 3 additions and 3 deletions

View File

@ -611,9 +611,9 @@ int DIALOG_CHANGE_SYMBOLS::processSymbols( const std::map<SCH_SYMBOL*,
continue; continue;
if( i < MANDATORY_FIELDS ) if( i < MANDATORY_FIELDS )
libField = libSymbol->GetFieldById( (int) i ); libField = symbol->GetLibSymbolRef()->GetFieldById( (int) i );
else else
libField = libSymbol->FindField( field.GetName() ); libField = symbol->GetLibSymbolRef()->FindField( field.GetName() );
if( libField ) if( libField )
{ {
@ -672,7 +672,7 @@ int DIALOG_CHANGE_SYMBOLS::processSymbols( const std::map<SCH_SYMBOL*,
} }
std::vector<LIB_FIELD*> libFields; std::vector<LIB_FIELD*> libFields;
libSymbol->GetFields( libFields ); symbol->GetLibSymbolRef()->GetFields( libFields );
for( unsigned i = MANDATORY_FIELDS; i < libFields.size(); ++i ) for( unsigned i = MANDATORY_FIELDS; i < libFields.size(); ++i )
{ {