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,6 +507,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 );
|
m_cur_grid->SetGridCursor( std::min( curRow, m_cur_grid->GetNumberRows() - 1 ), curCol );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -543,6 +543,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 );
|
m_cur_grid->SetGridCursor( std::min( curRow, m_cur_grid->GetNumberRows() - 1 ), curCol );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue