Fix broken value and footprint field text values.

Only update value and footprint fields from instance data if it's not
empty.  These fields were not always stored in the instance data so
loading them from instance data that does not contain them will clear
the fields.

https://gitlab.com/kicad/code/kicad/-/issues/13735
This commit is contained in:
Wayne Stambaugh 2023-02-03 09:48:00 -05:00
parent b427ad80f6
commit 9e03a71b44
1 changed files with 7 additions and 2 deletions

View File

@ -1102,8 +1102,13 @@ void SCH_SHEET_LIST::UpdateSymbolInstanceData(
// the full path here.
symbol->AddHierarchicalReference( sheetPath.Path(), it->m_Reference, it->m_Unit );
symbol->GetField( REFERENCE_FIELD )->SetText( it->m_Reference );
symbol->SetValueFieldText( it->m_Value );
symbol->SetFootprintFieldText( it->m_Footprint );
if( !it->m_Value.IsEmpty() )
symbol->SetValueFieldText( it->m_Value );
if( !it->m_Footprint.IsEmpty() )
symbol->SetFootprintFieldText( it->m_Footprint );
symbol->UpdatePrefix();
}
}