From 308ccc9eaa81b64cfae229848eff8fc378d0ef37 Mon Sep 17 00:00:00 2001 From: Rich Date: Tue, 4 Dec 2012 23:04:40 +0000 Subject: [PATCH] Changes CreateRtf method of DisplayText class to handle U_ID and S\u8902?ID text in display text Returns text changed in CreateRtf method of DisplayText class Created DoSearchAndReplace method to DisplayText class Added logging support to FoundMatches class --- PROMS/Volian.Controls.Library/DisplayText.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayText.cs b/PROMS/Volian.Controls.Library/DisplayText.cs index 580ab014..ae1eebbc 100644 --- a/PROMS/Volian.Controls.Library/DisplayText.cs +++ b/PROMS/Volian.Controls.Library/DisplayText.cs @@ -137,7 +137,7 @@ namespace Volian.Controls.Library // lines (the 2 spaces after the first "\par " command and 1 space before 2nd "\par"). Tried other // combinations that did not work. if (_MyItemInfo.FormatStepData.Prefix != null && _MyItemInfo.FormatStepData.Prefix != "") - text = ReplaceLinesWithUnicode(_MyItemInfo.FormatStepData.Prefix) + @"\par " + text + @" \par "; + text = ReplaceLinesWithUnicode(_MyItemInfo.FormatStepData.Prefix) + @"\par " + text + @"\par "; if (_MyItemInfo.FormatStepData.Suffix != null && _MyItemInfo.FormatStepData.Suffix != "") text = text + ReplaceLinesWithUnicode(_MyItemInfo.FormatStepData.Suffix); } @@ -199,6 +199,12 @@ namespace Volian.Controls.Library // actual edit mode are replace words left as is. if (wordsShouldBeReplaced) text = DoReplaceWords2(text); + if (_MyItemInfo != null) + { + text = DoSearchAndReplace(text, "", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_ID); + text = text.Replace(@"", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_ProcedureSetID); + text = text.Replace("", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Number); + } // Adjust RO display if (ROsShouldBeAdjusted) text = DoTransitionAdjustments(text); @@ -253,9 +259,13 @@ namespace Volian.Controls.Library indxsym = NextUnicode(text, indxsym + incrindx);//text.IndexOf(@"\u", indxsym + incrindx); } } - return text; } + + private string DoSearchAndReplace(string text, string find, string replace) + { + return text.Replace(find, replace); + } private static string DoColorLinks(string text) { string origtext = text; @@ -1581,6 +1591,7 @@ namespace Volian.Controls.Library #endregion public class FoundMatches : SortedList { + private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private string _Text; public FoundMatches(string text) : base()