From 8b56b3d9991e4de5d150df41b0c420a5b55c5093 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 23 Jan 2024 12:37:02 +0000 Subject: [PATCH] Formatting. --- eeschema/dialogs/dialog_symbol_fields_table.cpp | 14 ++++++++++++-- eeschema/fields_data_model.cpp | 2 ++ eeschema/sch_field.cpp | 6 ++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/eeschema/dialogs/dialog_symbol_fields_table.cpp b/eeschema/dialogs/dialog_symbol_fields_table.cpp index 11f794a8e6..edb3d61c9c 100644 --- a/eeschema/dialogs/dialog_symbol_fields_table.cpp +++ b/eeschema/dialogs/dialog_symbol_fields_table.cpp @@ -562,8 +562,10 @@ void DIALOG_SYMBOL_FIELDS_TABLE::AddField( const wxString& aFieldName, const wxS // Users can add fields with variable names that match the special names in the grid, // e.g. ${QUANTITY} so make sure we don't add them twice for( int i = 0; i < m_fieldsCtrl->GetItemCount(); i++ ) + { if( m_fieldsCtrl->GetTextValue( i, FIELD_NAME_COLUMN ) == aFieldName ) return; + } m_dataModel->AddColumn( aFieldName, aLabelValue, addedByUser ); @@ -1416,8 +1418,10 @@ void DIALOG_SYMBOL_FIELDS_TABLE::ApplyBomPreset( const BOM_PRESET& aPreset ) else m_currentBomPreset = nullptr; - m_lastSelectedBomPreset = - ( m_currentBomPreset && !m_currentBomPreset->readOnly ) ? m_currentBomPreset : nullptr; + if( m_currentBomPreset && !m_currentBomPreset->readOnly ) + m_lastSelectedBomPreset = m_currentBomPreset; + else + m_lastSelectedBomPreset = nullptr; updateBomPresetSelection( aPreset.name ); doApplyBomPreset( aPreset ); @@ -1488,18 +1492,24 @@ void DIALOG_SYMBOL_FIELDS_TABLE::syncBomPresetSelection() && preset.filterString == current.filterString && preset.groupSymbols == current.groupSymbols && preset.excludeDNP == current.excludeDNP ) ) + { return false; + } // Only compare shown or grouped fields std::vector A, B; for( const BOM_FIELD& field : preset.fieldsOrdered ) + { if( field.show || field.groupBy ) A.emplace_back( field ); + } for( const BOM_FIELD& field : current.fieldsOrdered ) + { if( field.show || field.groupBy ) B.emplace_back( field ); + } return A == B; } ); diff --git a/eeschema/fields_data_model.cpp b/eeschema/fields_data_model.cpp index 3c8b4ff834..3bfbd73daf 100644 --- a/eeschema/fields_data_model.cpp +++ b/eeschema/fields_data_model.cpp @@ -43,8 +43,10 @@ void FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn( const wxString& aFieldName, const m_cols.push_back( { aFieldName, aLabel, aAddedByUser, false, false } ); for( unsigned i = 0; i < m_symbolsList.GetCount(); ++i ) + { if( SCH_SYMBOL* symbol = m_symbolsList[i].GetSymbol() ) updateDataStoreSymbolField( *symbol, aFieldName ); + } } diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index d9d1ab7b8c..6abbccff93 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -1051,13 +1051,19 @@ wxString SCH_FIELD::GetCanonicalName() const { // These should be stored in canonical format, but just in case: if( m_name == _( "Net Class" ) || m_name == wxT( "Net Class" ) ) + { return wxT( "Netclass" ); + } else if( m_name == _( "Sheet References" ) || m_name == wxT( "Sheet References" ) || m_name == wxT( "Intersheet References" ) ) + { return wxT( "Intersheetrefs" ); + } else + { return m_name; + } } else {