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:
committed by
Seth Hillbrand
parent
00c1f471e4
commit
bb9a329ee4
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user