Don't store resolved values in symbol fields table editor dataStore.

We're going to use the dataStore to update the symbol, so
if we store resolved values it will nuke any text variables
even if the field wasn't edited.

Not sure if the BOM generator has a separate resolve-variables
step or not.  But it will need one as the code removed here
only worked for Values and Footprint fields anyway.

Fixes https://gitlab.com/kicad/code/kicad/issues/14423
This commit is contained in:
Jeff Young 2023-05-04 00:01:14 +01:00
parent 8b73b0549f
commit c4668c1d3a
1 changed files with 4 additions and 14 deletions

View File

@ -20,18 +20,8 @@ void FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn( const wxString& aFieldName, const
for( unsigned i = 0; i < m_symbolsList.GetCount(); ++i )
{
SCH_SYMBOL* symbol = m_symbolsList[i].GetSymbol();
wxCHECK( symbol && ( symbol->GetInstanceReferences().size() != 0 ), /* void */ );
wxString val = symbol->GetFieldText( aFieldName );
if( aFieldName == wxT( "Value" ) )
val = symbol->GetValueFieldText( true );
else if( aFieldName == wxT( "Footprint" ) )
val = symbol->GetFootprintFieldText( true );
m_dataStore[symbol->m_Uuid][aFieldName] = val;
if( SCH_SYMBOL* symbol = m_symbolsList[i].GetSymbol() )
m_dataStore[symbol->m_Uuid][aFieldName] = symbol->GetFieldText( aFieldName );
}
}
@ -40,8 +30,8 @@ void FIELDS_EDITOR_GRID_DATA_MODEL::RemoveColumn( int aCol )
{
for( unsigned i = 0; i < m_symbolsList.GetCount(); ++i )
{
SCH_SYMBOL* symbol = m_symbolsList[i].GetSymbol();
m_dataStore[symbol->m_Uuid].erase( m_cols[aCol].m_fieldName );
if( SCH_SYMBOL* symbol = m_symbolsList[i].GetSymbol() )
m_dataStore[symbol->m_Uuid].erase( m_cols[aCol].m_fieldName );
}
m_cols.erase( m_cols.begin() + aCol );