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 )
|
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue