mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 12:44:46 +01:00
Optimized: Remove text from Hearing Impaired
This commit is contained in:
parent
9371fb8f2d
commit
5bc0ff83ee
@ -159,11 +159,12 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
public int RemoveTextFromHearImpaired()
|
||||
{
|
||||
int count = 0;
|
||||
for (int i = _subtitle.Paragraphs.Count - 1; i >= 0; i--)
|
||||
for (int i = listViewFixes.Items.Count - 1; i >= 0; i--)
|
||||
{
|
||||
Paragraph p = _subtitle.Paragraphs[i];
|
||||
if (IsFixAllowed(p))
|
||||
var item = listViewFixes.Items[i];
|
||||
if (item.Checked)
|
||||
{
|
||||
Paragraph p = (Paragraph)item.Tag;
|
||||
_removeTextForHILib.Settings = GetSettings();
|
||||
string newText = _removeTextForHILib.RemoveTextFromHearImpaired(p.Text);
|
||||
if (string.IsNullOrEmpty(newText))
|
||||
@ -180,16 +181,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
return count;
|
||||
}
|
||||
|
||||
private bool IsFixAllowed(Paragraph p)
|
||||
{
|
||||
foreach (ListViewItem item in listViewFixes.Items)
|
||||
{
|
||||
if (item.Tag.ToString() == p.ToString())
|
||||
return item.Checked;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void CheckBoxRemoveTextBetweenCheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
@ -282,10 +273,11 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
RemoveTextBetweenBrackets = checkBoxRemoveTextBetweenBrackets.Checked,
|
||||
RemoveTextBetweenQuestionMarks = checkBoxRemoveTextBetweenQuestionMarks.Checked,
|
||||
RemoveTextBetweenParentheses = checkBoxRemoveTextBetweenParentheses.Checked,
|
||||
CustomStart = comboBoxCustomStart.Text, CustomEnd = comboBoxCustomEnd.Text
|
||||
CustomStart = comboBoxCustomStart.Text,
|
||||
CustomEnd = comboBoxCustomEnd.Text
|
||||
};
|
||||
return settings;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user