Add some sanity checking to SelectRow to prevent an invalid row from being selected when undoing line insertions

Originally committed to SVN as r3006.
This commit is contained in:
harukalover 2009-06-03 19:04:54 +00:00
parent 1c5ff247f6
commit 1d55e6b7b2

View file

@ -170,6 +170,10 @@ void BaseGrid::MakeCellVisible(int row, int col,bool center) {
////////////////
// Select a row
void BaseGrid::SelectRow(int row, bool addToSelected, bool select) {
// Sanity checking
if (row >= GetRows()) row = GetRows()-1;
else if (row < 0) row = 0;
if (!addToSelected) ClearSelection();
try {
bool cur = selMap.at(row);