Merge pull request #1191 from ivandrofly/patch-1a

Fix (src/Forms/FixCommonErrors.cs)
This commit is contained in:
Nikolaj Olsson 2015-08-25 18:44:13 +02:00
commit f36875ba10

View File

@ -4763,10 +4763,6 @@ namespace Nikse.SubtitleEdit.Forms
indexes.Add(item.Index);
int firstIndex = subtitleListView1.SelectedItems[0].Index;
int startNumber = _originalSubtitle.Paragraphs[0].Number;
if (startNumber == 2)
startNumber = 1;
// save de-seleced fixes
var deSelectedFixes = new List<string>();
foreach (ListViewItem item in listViewFixes.Items)
@ -4776,6 +4772,7 @@ namespace Nikse.SubtitleEdit.Forms
int number = Convert.ToInt32(item.SubItems[1].Text);
if (number > firstIndex)
number -= subtitleListView1.SelectedItems.Count;
if (number >= 0)
deSelectedFixes.Add(number + item.SubItems[2].Text + item.SubItems[3].Text);
}
}
@ -4785,7 +4782,7 @@ namespace Nikse.SubtitleEdit.Forms
{
_originalSubtitle.Paragraphs.RemoveAt(i);
}
_originalSubtitle.Renumber(startNumber);
_originalSubtitle.Renumber();
subtitleListView1.Fill(_originalSubtitle);
if (subtitleListView1.Items.Count > firstIndex)
{
@ -4802,6 +4799,8 @@ namespace Nikse.SubtitleEdit.Forms
Next();
// restore de-selected fixes
if (deSelectedFixes.Count > 0)
{
foreach (ListViewItem item in listViewFixes.Items)
{
if (deSelectedFixes.Contains(item.SubItems[1].Text + item.SubItems[2].Text + item.SubItems[3].Text))
@ -4809,6 +4808,7 @@ namespace Nikse.SubtitleEdit.Forms
}
}
}
}
private void MergeSelectedLinesToolStripMenuItemClick(object sender, EventArgs e)
{