panel lib tables: avoid crash when deleting the last entry in list.
From master branch
This commit is contained in:
parent
56a17b4e68
commit
567ce48cc1
|
@ -507,7 +507,8 @@ void PANEL_SYM_LIB_TABLE::deleteRowHandler( wxCommandEvent& event )
|
|||
}
|
||||
}
|
||||
|
||||
m_cur_grid->SetGridCursor( std::min( curRow, m_cur_grid->GetNumberRows() - 1 ), curCol );
|
||||
if( m_cur_grid->GetNumberRows() > 0 && curRow >= 0 )
|
||||
m_cur_grid->SetGridCursor( std::min( curRow, m_cur_grid->GetNumberRows() - 1 ), curCol );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -543,7 +543,8 @@ void PANEL_FP_LIB_TABLE::deleteRowHandler( wxCommandEvent& event )
|
|||
}
|
||||
}
|
||||
|
||||
m_cur_grid->SetGridCursor( std::min( curRow, m_cur_grid->GetNumberRows() - 1 ), curCol );
|
||||
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