Correctly set value and footprint fields from Symbol Fields editor.
Fixes https://gitlab.com/kicad/code/kicad/issues/5689
This commit is contained in:
parent
7062a3b29b
commit
ef48dba7ff
|
@ -621,17 +621,27 @@ 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;
|
||||
|
||||
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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_edited = false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue