From 21022b4fa4786ffc4bf8b824eecf2f9f82a74a92 Mon Sep 17 00:00:00 2001 From: Mike Williams Date: Mon, 20 May 2024 08:52:00 -0400 Subject: [PATCH] Symbol Fields Table: better handle variable fields with attributes Attributes need to be checked first since we do some internally hackery to make the checkboxes work. Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18005 --- eeschema/fields_data_model.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/eeschema/fields_data_model.cpp b/eeschema/fields_data_model.cpp index e75b171812..9dc8da718f 100644 --- a/eeschema/fields_data_model.cpp +++ b/eeschema/fields_data_model.cpp @@ -53,11 +53,10 @@ void FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn( const wxString& aFieldName, const void FIELDS_EDITOR_GRID_DATA_MODEL::updateDataStoreSymbolField( const SCH_SYMBOL& aSymbol, const wxString& aFieldName ) { - if( const SCH_FIELD* field = aSymbol.GetFieldByName( aFieldName ) ) - m_dataStore[aSymbol.m_Uuid][aFieldName] = field->GetText(); - else if( isAttribute( aFieldName ) ) + if( isAttribute( aFieldName ) ) m_dataStore[aSymbol.m_Uuid][aFieldName] = getAttributeValue( aSymbol, aFieldName ); - + else if( const SCH_FIELD* field = aSymbol.GetFieldByName( aFieldName ) ) + m_dataStore[aSymbol.m_Uuid][aFieldName] = field->GetText(); // Handle fields with variables as names that are not present in the symbol // by giving them the correct value else if( IsTextVar( aFieldName ) )