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
(cherry picked from commit 1a70465927
)
This commit is contained in:
parent
4d56690a7e
commit
729cf7a39d
|
@ -625,9 +625,9 @@ void SCH_SYMBOL::SetValue( const SCH_SHEET_PATH* sheet, const wxString& aValue )
|
||||||
{
|
{
|
||||||
if( sheet == nullptr )
|
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 )
|
for( SYMBOL_INSTANCE_REFERENCE& instance : m_instanceReferences )
|
||||||
instance.m_Value = wxEmptyString;
|
instance.m_Value = aValue;
|
||||||
|
|
||||||
m_fields[ VALUE_FIELD ].SetText( aValue );
|
m_fields[ VALUE_FIELD ].SetText( aValue );
|
||||||
return;
|
return;
|
||||||
|
@ -676,9 +676,9 @@ void SCH_SYMBOL::SetFootprint( const SCH_SHEET_PATH* sheet, const wxString& aFoo
|
||||||
{
|
{
|
||||||
if( sheet == nullptr )
|
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 )
|
for( SYMBOL_INSTANCE_REFERENCE& instance : m_instanceReferences )
|
||||||
instance.m_Footprint = wxEmptyString;
|
instance.m_Footprint = aFootprint;
|
||||||
|
|
||||||
m_fields[ FOOTPRINT_FIELD ].SetText( aFootprint );
|
m_fields[ FOOTPRINT_FIELD ].SetText( aFootprint );
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue