Handle new fields in global field editor.
Fixes: lp:1765443 * https://bugs.launchpad.net/kicad/+bug/1765443
This commit is contained in:
parent
f81c77cd4e
commit
9201417c06
|
@ -353,12 +353,15 @@ public:
|
||||||
|
|
||||||
std::map<wxString, wxString>& fieldStore = m_dataStore[ comp->GetTimeStamp() ];
|
std::map<wxString, wxString>& fieldStore = m_dataStore[ comp->GetTimeStamp() ];
|
||||||
|
|
||||||
for( int j = 0; j < comp->GetFieldCount(); ++j )
|
for( std::pair<wxString, wxString> fieldData : fieldStore )
|
||||||
{
|
{
|
||||||
SCH_FIELD* field = comp->GetField( j );
|
wxString fieldName = fieldData.first;
|
||||||
auto fieldStoreData = fieldStore.find( field->GetName() );
|
SCH_FIELD* field = comp->FindField( fieldName );
|
||||||
if( fieldStoreData != fieldStore.end() )
|
|
||||||
field->SetText( fieldStoreData->second );
|
if( !field )
|
||||||
|
field = comp->AddField( SCH_FIELD( wxPoint( 0, 0 ), -1, comp, fieldName ) );
|
||||||
|
|
||||||
|
field->SetText( fieldData.second );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue