Fix field deletion in Symbol Fields Table not updating grid
When deleting a field in the Symbol Fields Table, the underlying data model column was removed but the grid was never notified of the change. This caused the grid to have a stale view with more columns than the data model actually had, resulting in field corruption where the next field would appear to "merge" and become uneditable. Added wxGRIDTABLE_NOTIFY_COLS_DELETED notification in RemoveColumn() to properly sync the grid state after column removal. Fixes https://gitlab.com/kicad/code/kicad/-/issues/22406
This commit is contained in:
@@ -265,6 +265,12 @@ void FIELDS_EDITOR_GRID_DATA_MODEL::RemoveColumn( int aCol )
|
||||
}
|
||||
|
||||
m_cols.erase( m_cols.begin() + aCol );
|
||||
|
||||
if( wxGrid* grid = GetView() )
|
||||
{
|
||||
wxGridTableMessage msg( this, wxGRIDTABLE_NOTIFY_COLS_DELETED, aCol, 1 );
|
||||
grid->ProcessTableMessage( msg );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user