diff --git a/PROMS/Volian.Controls.Library/DisplayText.cs b/PROMS/Volian.Controls.Library/DisplayText.cs index 5260e92d..08569205 100644 --- a/PROMS/Volian.Controls.Library/DisplayText.cs +++ b/PROMS/Volian.Controls.Library/DisplayText.cs @@ -168,11 +168,18 @@ namespace Volian.Controls.Library } // Replace Hard Hyphens with normal hyphen so the PDF search for hyphens will work properly if (text.Contains(@"\u8209?") && epMode == E_EditPrintMode.Print) + { + // Handle RTF Tokens followed immediately by a hard hyphen + text =Regex.Replace(text, @"(?<=\\[^\\?' \r\n\t]+)\\u8209\?", " -"); text = text.Replace(@"\u8209?", "-"); + } + _MyStaticItemInfo = _MyItemInfo; text = CreateRtf(colorLinks, text, tableShouldBeOutlined, wordsShouldBeReplaced, numbersShouldBeFormated, tableHasBorder, ROsShouldBeAdjusted, underlineAfterDashSpace); + _MyStaticItemInfo = null; StartText = text; ProfileTimer.Pop(profileDepth); } + private static ItemInfo _MyStaticItemInfo = null; // Used to report errors private string ReplaceLinesWithUnicode(string text) { text = text.Replace("\x2500", @"\u9472?"); // Horizontal @@ -1142,7 +1149,11 @@ namespace Volian.Controls.Library if (token == "\\viewkind4 ") break; if (Regex.IsMatch(token, @"^\\v0? ?$")) return token; // comment part of link - _MyLog.WarnFormat("<<>>\r\n==> Token including Comment not processed '{0}'", token); + // If possible show what procedure was being processed. + if(_MyStaticItemInfo == null) + _MyLog.WarnFormat("<<>>\r\n==> Token including Comment not processed '{0}'", token); + else + _MyLog.WarnFormat("<<>>\r\n==> Token including Comment not processed '{0}' in {1},[{2}]", token, _MyStaticItemInfo.ShortPath, _MyStaticItemInfo.ItemID); break; case 'l': if (Regex.IsMatch(token, @"^\\line ?$")) return token; @@ -1484,6 +1495,7 @@ namespace Volian.Controls.Library if (Regex.IsMatch(mynum, @".*\\'[A-Fa-f0-9]{2,2}$")) ind -= 4; units = prevValue.Substring(ind+1); + //if (rtnstr.EndsWith(units) && units != "") if (rtnstr.EndsWith(units)) { rtnstr = rtnstr.Replace(units, "");