Refactor (minor)

This commit is contained in:
Nikolaj Olsson 2018-03-14 22:02:40 +01:00
parent 790a3f48ec
commit 631f58c544

View File

@ -361,25 +361,21 @@ namespace Nikse.SubtitleEdit.Core
{
return true;
}
else
char lastChar = preLine[preLine.Length - 1];
if (lastChar == '♪')
{
char lastChar = preLine[preLine.Length - 1];
if (lastChar == '♪')
string tempPreLine = preLine.Substring(0, preLine.Length - 1).TrimEnd();
// update last char
if (tempPreLine.Length > 0)
{
string tempPreLine = preLine.Substring(0, preLine.Length - 1).TrimEnd();
// update last char
if (tempPreLine.Length > 0)
{
lastChar = tempPreLine[tempPreLine.Length - 1];
}
}
if (lastChar != '♪' && (lastChar == '.' || lastChar == '!' || lastChar == '?' || lastChar == ']' || lastChar == ')' || lastChar == ':' || lastChar == '_'))
{
return true;
lastChar = tempPreLine[tempPreLine.Length - 1];
}
}
if (lastChar == '.' || lastChar == '!' || lastChar == '?' || lastChar == ']' || lastChar == ')' || lastChar == ':' || lastChar == '_')
{
return true;
}
// previous line ends with music symbol but current line doesn't contains any music symbol
if ((preLine.EndsWith('♪') || preLine.EndsWith('♫')) && !Pre.Contains(new[] { '♪', '♫' }))