Fixed Replace words logic to handle underline better.

This commit is contained in:
John Jenko 2014-04-17 16:25:41 +00:00
parent 8c429b93dc
commit d7407d60fa

View File

@ -1833,9 +1833,15 @@ namespace Volian.Controls.Library
// had replaced OR's turning underline off in the middle of a transition, "EOP-0 UNIT 1, RACTORE TRIP OR SAFETY INJECTION".
if (!IsUnderline)
{
int repidxst = text.LastIndexOf(@"\ul ", foundMatch.MyMatch.Index);
int repidxend = text.IndexOf(@"\ulnone", foundMatch.MyMatch.Index + foundMatch.MyMatch.Length);
if (repidxst > -1 && repidxend > -1 && repidxst < foundMatch.MyMatch.Index && repidxend > (foundMatch.MyMatch.Index + foundMatch.MyMatch.Length)) IsUnderline = true;
int repidxulnone = text.LastIndexOf(@"\ulnone", foundMatch.MyMatch.Index + offset);
int repidxst = text.LastIndexOf(@"\ul", foundMatch.MyMatch.Index + offset);
if (repidxulnone > 0)
{
repidxst = text.Substring(repidxulnone + 7, foundMatch.MyMatch.Index + offset - (repidxulnone + 7)).LastIndexOf(@"\ul");
if (repidxst >= 0)
repidxst += (repidxulnone + 7);
}
if (repidxst >= 0) IsUnderline = true;
}
if (IsUnderline)
{