Fix a bug that would cause a crash under certain conditions when trying to change the properties of a recently deleted line. Patch by Plorkyeran, closes #815

Originally committed to SVN as r2858.
This commit is contained in:
Karl Blomster 2009-04-26 00:25:33 +00:00
parent 32eb3a8a62
commit 76cec3ec29
1 changed files with 4 additions and 2 deletions

View File

@ -1047,8 +1047,10 @@ void SubtitlesGrid::DeleteLines(wxArrayInt target) {
ass->FlagAsModified(_("delete"));
CommitChanges();
// Update editbox
editBox->SetToLine(MID(0,editBox->linen,GetRows()-1));
// Update selected line
int newSelected = MID(0, editBox->linen,GetRows() - 1);
editBox->SetToLine(newSelected);
SelectRow(newSelected);
}