From 214cc7769ec1c83140cca7a3b82fc60d1022d3e6 Mon Sep 17 00:00:00 2001 From: Rich Date: Mon, 11 Jan 2010 22:19:28 +0000 Subject: [PATCH] In the method that strips RTF prior to saving, when a LineBreak token is followed by a Font Change token, remove the fontchange and leave the space --- PROMS/Volian.Controls.Library/DisplayText.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PROMS/Volian.Controls.Library/DisplayText.cs b/PROMS/Volian.Controls.Library/DisplayText.cs index b4fa8be8..6044a522 100644 --- a/PROMS/Volian.Controls.Library/DisplayText.cs +++ b/PROMS/Volian.Controls.Library/DisplayText.cs @@ -606,7 +606,10 @@ namespace Volian.Controls.Library retval = Regex.Replace(retval, @"^\{(.*)\}$", "$1", RegexOptions.Singleline); // Strip Opening and Closing Braces retval = Regex.Replace(retval, @"\{[^{]*?\}", "", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces retval = Regex.Replace(retval, @"\{[^{]*?\}", "", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces - retval = Regex.Replace(retval, @"\\v\\f[0-9] ", "\\v "); // remove font command - if next to Comment keep space + retval = Regex.Replace(retval, @"(\\[^ \\?]+)\\f[0-9] ", "$1 "); // remove font command - if next to another command, keep other command and space + // OLD: The following two lines are replaced by the more generic replace above. + //retval = Regex.Replace(retval, @"\\v\\f[0-9] ", "\\v "); // remove font command - if next to Comment keep space + //retval = Regex.Replace(retval, @"\\line\\f[0-9] ", "\\line "); // remove font command - if next to Line keep space retval = Regex.Replace(retval, @"\\f[0-9] ", ""); // remove font command with ending space retval = Regex.Replace(retval, @"\\f[0-9]", ""); // remove font command without ending space retval = Regex.Replace(retval, @"\\par ", "\r\n");