Fixed minor bug in "Remove text for hear impaired" - thx pson :)

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@1346 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2012-08-17 07:25:15 +00:00
parent 82b58d938e
commit 4642714b99
2 changed files with 17 additions and 6 deletions

View File

@ -436,7 +436,12 @@ namespace Nikse.SubtitleEdit.Forms
}
if (removedInFirstLine && !removedInSecondLine && !text.StartsWith("-") && !text.StartsWith("<i>-"))
insertDash = false;
{
if (insertDash && removedInFirstLine && (arr[1].StartsWith("-") || arr[1].StartsWith("<i>-")))
insertDash = true;
else
insertDash = false;
}
}
if (insertDash)

View File

@ -177,10 +177,16 @@ namespace Test
}
//
//
[TestMethod()]
[DeploymentItem("SubtitleEdit.exe")]
public void RemoveRemoveNameOfFirstLine()
{
FormRemoveTextForHearImpaired_Accessor target = new FormRemoveTextForHearImpaired_Accessor();
string text = "HECTOR: Hi." + Environment.NewLine + "-Oh, hey, Hector.";
string expected = "- Hi." + Environment.NewLine + "- Oh, hey, Hector.";
string actual = target.RemoveTextFromHearImpaired(text);
Assert.AreEqual(expected, actual);
}
}
}