Fix B2016-167: underlined page list text was not resolving the underline on/off commands

This commit is contained in:
Kathy Ruffing 2016-07-14 16:04:24 +00:00
parent 85ea4d6efb
commit 45e3c85c3b

View File

@ -765,8 +765,22 @@ namespace Volian.Svg.Library
text = Regex.Replace(text, @"\\[Uu][0-9]+[?]", new MatchEvaluator(ReplaceSpecialCharacter));
text = Regex.Replace(text, @"\\'[0-9a-fA-F][0-9a-fA-F]", new MatchEvaluator(ReplaceHexCharacter));
text += " ";
if (text.Contains("\\"))
text = text.Replace("\\", ((char)9586).ToString()); // B2016-155 convert backslash char to the unicode symbol - to allow processing rtf commands \ul, \up, \dn, etc.
//if (text.Contains("\\")) -- these 2 lines made \ul and \ulnone in page list text not get resolved and would then print
//text = text.Replace("\\", ((char)9586).ToString()); // B2016-155 convert backslash char to the unicode symbol - to allow processing rtf commands \ul, \up, \dn, etc.
// B2016-167: handle backslashes but don't do if the backslash is an underline rtf command
int stindx = text.IndexOf("\\");
while (stindx != -1)
{
if (stindx+2 < text.Length-1 && text.ToUpper().IndexOf("UL",stindx+1)==stindx+1) //don't replace it
stindx = text.IndexOf("\\",stindx+1);
else
{
text = text.Remove(stindx,1);
text = text.Insert(stindx, ((char)9586).ToString());
stindx = text.IndexOf("\\",stindx);
}
}
Phrase ph = new Phrase();
while (text.Length > 0)
{