From 9910c670d2abfc526d662a0c8a867e8003cbd1d5 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 22 Dec 2023 13:57:43 +0000 Subject: [PATCH] Ignore reference and value when computing "allChecked". Fixes https://gitlab.com/kicad/code/kicad/-/issues/16408 --- eeschema/dialogs/dialog_change_symbols.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/eeschema/dialogs/dialog_change_symbols.cpp b/eeschema/dialogs/dialog_change_symbols.cpp index 06eaac5c2b..e61b1f1f89 100644 --- a/eeschema/dialogs/dialog_change_symbols.cpp +++ b/eeschema/dialogs/dialog_change_symbols.cpp @@ -356,13 +356,22 @@ void DIALOG_CHANGE_SYMBOLS::updateFieldsList() m_fieldsBox->GetCheckedItems( checkedItems ); - for( int i : checkedItems ) - checkedNames.push_back( m_fieldsBox->GetString( i ) ); + for( int ii : checkedItems ) + checkedNames.push_back( m_fieldsBox->GetString( ii ) ); - bool allChecked = checkedItems.size() == m_fieldsBox->GetCount(); + bool allChecked = true; - for( unsigned i = m_fieldsBox->GetCount() - 1; i >= MANDATORY_FIELDS; --i ) - m_fieldsBox->Delete( i ); + for( unsigned ii = 0; ii < m_fieldsBox->GetCount(); ++ii ) + { + if( ii == REFERENCE_FIELD || ii == VALUE_FIELD ) + continue; + + if( !m_fieldsBox->IsChecked( ii ) ) + allChecked = false; + } + + for( unsigned ii = m_fieldsBox->GetCount() - 1; ii >= MANDATORY_FIELDS; --ii ) + m_fieldsBox->Delete( ii ); for( const wxString& fieldName : fieldNames ) {