Some minor improvements for "Change casing" - thx dr. Jackson

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@550 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2011-07-08 22:05:45 +00:00
parent d949917d56
commit 2fbc2933d8

View File

@ -178,7 +178,7 @@ namespace Nikse.SubtitleEdit.Logic
startWithUppercase = true;
}
if (startWithUppercase && StrippedText.Length > 0)
if (startWithUppercase && StrippedText.Length > 0 && !Pre.Contains("..."))
{
StrippedText = StrippedText.Remove(0, 1).Insert(0, StrippedText[0].ToString().ToUpper());
}
@ -238,7 +238,18 @@ namespace Nikse.SubtitleEdit.Logic
{
sb.Append(s);
if (".!?:;)]}([{".Contains(s))
lastWasBreak = true;
{
if (s == "]" && sb.ToString().IndexOf("[") > 1)
{ // I [Motor roaring] love you!
string temp = sb.ToString().Substring(0, sb.ToString().IndexOf("[") - 1).Trim();
if (temp.Length > 0 && !Utilities.GetLetters(false, true, false).Contains(temp[temp.Length - 1].ToString()))
lastWasBreak = true;
}
else
{
lastWasBreak = true;
}
}
}
}
StrippedText = sb.ToString();