Symbol Fields Table: check against data model col for grouping

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/14870
This commit is contained in:
Mike Williams 2023-06-04 14:42:55 -04:00
parent bb6555ff36
commit 039f23eba8
1 changed files with 3 additions and 1 deletions

View File

@ -775,8 +775,10 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnColumnItemToggled( wxDataViewEvent& event )
case GROUP_BY_COLUMN:
{
bool value = m_fieldsCtrl->GetToggleValue( row, col );
int dataCol = m_dataModel->GetFieldNameCol(
m_fieldsCtrl->GetTextValue( row, FIELD_NAME_COLUMN ) );
if( m_dataModel->ColIsQuantity( row ) && value )
if( m_dataModel->ColIsQuantity( dataCol ) && value )
{
DisplayError( this, _( "The Quantity column cannot be grouped by." ) );