This commit is contained in:
2010-06-23 18:18:09 +00:00
parent edfc3d71b0
commit ce3b1b4be9
2 changed files with 21 additions and 7 deletions

View File

@@ -176,7 +176,7 @@ namespace Volian.Controls.Library
}
public class RtfLine : List<RtfPiece>
{
private static Regex _RegRtfText = new Regex(@"((\\[^'u ]*)+( |$))?(<START\]|#Link.*?\[END>|\\'[0-9a-fA-F]{2}|\\u[0-9]*\?|[^\\]{1}|$|)");
private static Regex _RegRtfText = new Regex(@"((\\[^'u ]*|\\up[0-9]|\\ul0?)+( |$))?(<START\]|#Link.*?\[END>|\\'[0-9a-fA-F]{2}|\\u[0-9]*\?|[^\\]{1}|$|)");
public RtfLine(string text)
{
MatchCollection matches = _RegRtfText.Matches(text);
@@ -190,8 +190,11 @@ namespace Volian.Controls.Library
//Console.WriteLine(text.Substring(nextIndex));
}
nextIndex = match.Index + match.Length;
if (match.Groups[2].ToString().Length + match.Groups[4].ToString().Length > 0)
this.Add(new RtfPiece(match.Groups[2].ToString(), match.Groups[4].ToString()));
string rtfPart = match.Groups[1].ToString();
if (match.Groups[1].ToString().TrimEnd(" ".ToCharArray()).Length + match.Groups[4].ToString().Length > 0)
this.Add(new RtfPiece(match.Groups[1].ToString().TrimEnd(" ".ToCharArray()), match.Groups[4].ToString()));
//if (match.Groups[1].ToString().Length + match.Groups[4].ToString().Length > 0)
// this.Add(new RtfPiece(match.Groups[1].ToString(), match.Groups[4].ToString()));
}
}
public RtfLine(int width, string left, string fill, string right)