If undo/redo would result in there being no lines selected, select the last line

Originally committed to SVN as r4592.
This commit is contained in:
Thomas Goyne 2010-06-24 07:16:21 +00:00
parent d8e8f9eb68
commit e2a42ccb6c

View file

@ -847,8 +847,13 @@ void SubtitlesGrid::LoadFromAss (AssFile *_ass,bool keepSelection,bool dontModif
// Restore selection // Restore selection
if (keepSelection) { if (keepSelection) {
for (size_t i=0;i<srows.size();i++) { if (srows.empty() || srows[0] >= (signed)selMap.size()) {
SelectRow(srows[i],true); SelectRow(selMap.size() - 1);
}
else {
for (size_t i=0;i<srows.size();i++) {
SelectRow(srows[i],true);
}
} }
} }