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,17 +621,27 @@ public:
if( !destField ) if( !destField )
{ {
comp.RemoveField( srcName ); comp.RemoveField( srcName );
continue;
} }
else if( destField->GetId() == REFERENCE )
// Reference and value fields cannot be empty. All other fields can. {
if( srcValue.IsEmpty() // Reference is not editable
&& (destField->GetId() == REFERENCE || destField->GetId() == VALUE)) }
continue; 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 ); destField->SetText( srcValue );
} }
} }
}
m_edited = false; m_edited = false;
} }