Fixed a few minor issues - thx sialivi :)

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@120 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2010-11-02 16:36:06 +00:00
parent 0e4e91281f
commit 1abd602650

View File

@ -167,6 +167,20 @@ namespace Nikse.SubtitleEdit.Forms
hit = true;
}
if (!hit)
{
string[] parts = p.Text.Trim().Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
foreach (string s in parts)
{
StripableText stSub = new StripableText(s, " >-\"'`´♪¿¡.", " -\"'`´♪.!?:");
string newText = stSub.StrippedText;
if (HasHearImpariedTagsAtStart(newText))
hit = true;
else if (HasHearImpariedTagsAtEnd(newText))
hit = true;
}
}
if (hit)
{
count++;
@ -281,15 +295,20 @@ namespace Nikse.SubtitleEdit.Forms
if (removedAtLine.Count > 0)
{
StripableText p0 = new StripableText(parts[0]);
StripableText p1 = new StripableText(parts[1]);
if (p0.Post.Contains(".") || p0.Post.Contains("!") || p0.Post.Contains("?"))
bool onlySecondSpeaker = removedAtLine.Count == 1 && removedAtLine[0] == 1 && !p1.Pre.Contains("-");
if (!onlySecondSpeaker)
{
StripableText p1 = new StripableText(parts[1]);
if (!p0.Pre.Contains("-"))
parts[0] = "- " + parts[0];
if (p0.Post.Contains(".") || p0.Post.Contains("!") || p0.Post.Contains("?"))
{
if (!p0.Pre.Contains("-"))
parts[0] = "- " + parts[0];
if (!p1.Pre.Contains("-"))
parts[1] = "- " + parts[1];
if (!p1.Pre.Contains("-"))
parts[1] = "- " + parts[1];
}
}
}