Use instance data to store values

Previous use of instance was as an "override" of the default value.
This has changed to be used as the primary storage location for all
values.  This means that we cannot clear the instance data when setting
a new value for all instances, instead we have to change the instance
data and the default value is superfluous

Fixes https://gitlab.com/kicad/code/kicad/issues/11439
This commit is contained in:
Seth Hillbrand 2022-04-25 12:46:16 -07:00
parent f5d612eaed
commit 1a70465927
1 changed files with 4 additions and 4 deletions

View File

@ -639,9 +639,9 @@ void SCH_SYMBOL::SetValue( const SCH_SHEET_PATH* sheet, const wxString& aValue )
{
if( sheet == nullptr )
{
// Clear instance overrides and set primary field value
// Set all instances to the updated value
for( SYMBOL_INSTANCE_REFERENCE& instance : m_instanceReferences )
instance.m_Value = wxEmptyString;
instance.m_Value = aValue;
m_fields[ VALUE_FIELD ].SetText( aValue );
return;
@ -690,9 +690,9 @@ void SCH_SYMBOL::SetFootprint( const SCH_SHEET_PATH* sheet, const wxString& aFoo
{
if( sheet == nullptr )
{
// Clear instance overrides and set primary field value
// Set all instances to new footprint value
for( SYMBOL_INSTANCE_REFERENCE& instance : m_instanceReferences )
instance.m_Footprint = wxEmptyString;
instance.m_Footprint = aFootprint;
m_fields[ FOOTPRINT_FIELD ].SetText( aFootprint );
return;