Hopefully fixed crash in 'Fix common errors' - thx XhmikosR :)

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@1045 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2012-03-15 20:10:57 +00:00
parent aa13720843
commit 8b159c8d2a

View File

@ -3909,14 +3909,17 @@ namespace Nikse.SubtitleEdit.Forms
if (_deleteIndices.Contains(i))
index++;
}
if (index - 1 > 0)
subtitleListView1.EnsureVisible(index - 1);
if (index + 1 < subtitleListView1.Items.Count)
subtitleListView1.EnsureVisible(index + 1);
subtitleListView1.SelectNone();
subtitleListView1.Items[index].Selected = true;
subtitleListView1.EnsureVisible(index);
if (index >= 0 && index < subtitleListView1.Items.Count)
{
if (index - 1 > 0)
subtitleListView1.EnsureVisible(index - 1);
if (index + 1 < subtitleListView1.Items.Count)
subtitleListView1.EnsureVisible(index + 1);
subtitleListView1.SelectNone();
subtitleListView1.Items[index].Selected = true;
subtitleListView1.EnsureVisible(index);
}
}
}
}