B2021-054 Needed to start a rtf string search from the last index we found for cases when there are more than one transition in the text.

This commit is contained in:
John Jenko 2021-04-22 15:47:20 +00:00
parent 8d05b057aa
commit 700321f4e5

View File

@ -393,7 +393,7 @@ namespace VEPROMS.CSLA.Library
if (tText.Contains(@"\fs")) if (tText.Contains(@"\fs"))
{ {
tText = Regex.Replace(tText, @"\\v\\fs[0-9]+ ", "\\v "); tText = Regex.Replace(tText, @"\\v\\fs[0-9]+ ", "\\v ");
start = tText.IndexOf("<START]"); start = tText.IndexOf("<START]",Math.Max(lastIndex - 3,0)); //B2021-054 start looking from the last index or zero - which ever is greater
} }
string defPrefix = tText.Substring(start - 3, 3); string defPrefix = tText.Substring(start - 3, 3);
if (defPrefix != @"\v ") throw new Exception(string.Format("rtf string {0} does not match expected format", defPrefix)); if (defPrefix != @"\v ") throw new Exception(string.Format("rtf string {0} does not match expected format", defPrefix));