panel lib tables: avoid crash when deleting the last entry in list.
This commit is contained in:
parent
461d0e9a49
commit
a8d5d9b690
|
@ -567,6 +567,7 @@ void PANEL_SYM_LIB_TABLE::deleteRowHandler( wxCommandEvent& event )
|
|||
}
|
||||
}
|
||||
|
||||
if( m_cur_grid->GetNumberRows() > 0 && curRow >= 0 )
|
||||
m_cur_grid->SetGridCursor( std::min( curRow, m_cur_grid->GetNumberRows() - 1 ), curCol );
|
||||
}
|
||||
|
||||
|
|
|
@ -660,6 +660,7 @@ void PANEL_FP_LIB_TABLE::deleteRowHandler( wxCommandEvent& event )
|
|||
}
|
||||
}
|
||||
|
||||
if( m_cur_grid->GetNumberRows() > 0 && curRow >= 0 )
|
||||
m_cur_grid->SetGridCursor( std::min( curRow, m_cur_grid->GetNumberRows() - 1 ), curCol );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue