Merge pull request #881 from ivandrofly/patch-4

Minor refact
This commit is contained in:
Nikolaj Olsson 2015-06-19 19:31:52 +02:00
commit 765884ce66
2 changed files with 8 additions and 8 deletions

View File

@ -37,14 +37,14 @@ namespace Nikse.SubtitleEdit.Logic.Forms
s = s.Remove(0, 1);
if (s.StartsWith(' '))
{
if (s.StartsWith(" <i>"))
if (s.StartsWith(" <i>", StringComparison.Ordinal))
pre = " <i>";
else
pre = " ";
}
else if (s.StartsWith("<i>"))
else if (s.StartsWith("<i>", StringComparison.Ordinal))
pre = "<i>";
else if (s.StartsWith("</i>"))
else if (s.StartsWith("</i>", StringComparison.Ordinal))
pre = "</i>";
if (pre.Length > 0)
@ -509,10 +509,10 @@ namespace Nikse.SubtitleEdit.Logic.Forms
{
text = text.TrimStart().TrimStart('-').TrimStart();
}
if (oldText.TrimStart().StartsWith("-", StringComparison.Ordinal) &&
!oldText.TrimStart().StartsWith("--", StringComparison.Ordinal) &&
if (oldText.TrimStart().StartsWith("-", StringComparison.Ordinal) &&
!oldText.TrimStart().StartsWith("--", StringComparison.Ordinal) &&
text != null && !text.Contains(Environment.NewLine) &&
(oldText.Contains(Environment.NewLine + "-", StringComparison.Ordinal) && !(oldText.Contains(Environment.NewLine + "--", StringComparison.Ordinal)) ||
(oldText.Contains(Environment.NewLine + "-", StringComparison.Ordinal) && !(oldText.Contains(Environment.NewLine + "--", StringComparison.Ordinal)) ||
oldText.Contains(Environment.NewLine + " - ", StringComparison.Ordinal) || oldText.Contains(Environment.NewLine + "<i>- ", StringComparison.Ordinal) || oldText.Contains(Environment.NewLine + "<i> - ", StringComparison.Ordinal)))
{
text = text.TrimStart().TrimStart('-').TrimStart();
@ -1074,4 +1074,4 @@ namespace Nikse.SubtitleEdit.Logic.Forms
}
}
}
}

View File

@ -38,4 +38,4 @@
}
}
}
}