Correctly set value and footprint fields from Symbol Fields editor.

Fixes https://gitlab.com/kicad/code/kicad/issues/5689
This commit is contained in:
Jeff Young 2020-09-18 23:29:38 +01:00
parent 7062a3b29b
commit ef48dba7ff
1 changed files with 18 additions and 8 deletions

View File

@ -621,15 +621,25 @@ public:
if( !destField )
{
comp.RemoveField( srcName );
continue;
}
// Reference and value fields cannot be empty. All other fields can.
if( srcValue.IsEmpty()
&& (destField->GetId() == REFERENCE || destField->GetId() == VALUE))
continue;
destField->SetText( srcValue );
else if( destField->GetId() == REFERENCE )
{
// Reference is not editable
}
else if( destField->GetId() == VALUE )
{
// Value field cannot be empty
if( !srcValue.IsEmpty() )
comp.SetValue( srcValue );
}
else if( destField->GetId() == FOOTPRINT )
{
comp.SetFootprint( srcValue );
}
else
{
destField->SetText( srcValue );
}
}
}