Avoid wxWidgets alert when removing bottom to top

Fix assert ./src/generic/grid.cpp(5216): assert "idx >= 0 && idx < m_numRows" failed in GetRowPos(): invalid row index happening when selecting >= 3 row starting from the bottom last row. Even if not all row are selected.

This happen because wxGrid::DeleteRows will try to update the selected row between each call.
This commit is contained in:
Lucas Dumont
2024-10-24 23:11:26 +00:00
committed by Seth Hillbrand
parent 00c1f471e4
commit bb9a329ee4
3 changed files with 6 additions and 0 deletions
@@ -660,6 +660,8 @@ void PANEL_DESIGN_BLOCK_LIB_TABLE::deleteRowHandler( wxCommandEvent& event )
if( !m_cur_grid->CommitPendingChanges() )
return;
wxGridUpdateLocker noUpdates( m_cur_grid );
int curRow = m_cur_grid->GetGridCursorRow();
int curCol = m_cur_grid->GetGridCursorCol();
+2
View File
@@ -730,6 +730,8 @@ void PANEL_SYM_LIB_TABLE::deleteRowHandler( wxCommandEvent& event )
if( !m_cur_grid->CommitPendingChanges() )
return;
wxGridUpdateLocker noUpdates( m_cur_grid );
int curRow = m_cur_grid->GetGridCursorRow();
int curCol = m_cur_grid->GetGridCursorCol();
+2
View File
@@ -689,6 +689,8 @@ void PANEL_FP_LIB_TABLE::deleteRowHandler( wxCommandEvent& event )
if( !m_cur_grid->CommitPendingChanges() )
return;
wxGridUpdateLocker noUpdates( m_cur_grid );
int curRow = m_cur_grid->GetGridCursorRow();
int curCol = m_cur_grid->GetGridCursorCol();