diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index c0661359..5bd95ddb 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -1400,15 +1400,25 @@ namespace Volian.Controls.Library if (SelectionLength > 0)HandleDeleteKeyWithSelectedText(new KeyEventArgs(Keys.None), null); int position = SelectionStart; SelectionLength = 0; + // B2026-036 fixed issue where numbers after a dash character (in an RO return value) were trucated + // Needed to add a space after the \f0 in the string replace below. RTF was getting confused + // when there are number right after the \f0. Note also remove the space charcter after + // the \f1 command, as it is not needed since the \u commdn follows it. + // Here is the old code prior to when the foreach loop was added to handle symbols in RO value: + // + // linkValue = linkValue.Replace("\\u8209?", "\\f1\\u8209?\\f0 "); // dash character + // linkValue = linkValue.Replace("\\u9586?", "\\f1\\u9586?\\f0 "); // backslash symbol + // linkValue = linkValue.Replace("\\u916?", "\\f1\\u916?\\f0 "); // delta symbol var pattern = @"\\u([0-9]{1,4})\?"; // RO Editor add symbols C2022 - 003 foreach (Match match in Regex.Matches(linkValue, pattern, RegexOptions.IgnoreCase)) { - linkValue = linkValue.Replace(match.Value, "\\f1 " + match.Value + "\\f0"); + linkValue = linkValue.Replace(match.Value, "\\f1" + match.Value + "\\f0 "); } linkValue = linkValue.Replace(@"{", @"\{"); linkValue = linkValue.Replace(@"}", @"\}"); + SelectedRtf = @"{\rtf1\ansi" + FontTable + @"{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}\v" + FontSize + @" \v0 }"; this.SelectionLength = 0; this.SelectionStart = position;