Fixed logic for Find/Replace of backslash and symbol characters B2016-156

Moved repeated logic to a static function RTFConvertedSymbolsToUnicode which is needed for Find/Replace. Used in DisplayText.cs, FindReplace.cs, and VlnFlexGrid  B2016-156
Fixed finding backslash and symbols B2016-156
Fixed finding backslash and symbols in tables (grids) B2016-156
This commit is contained in:
2016-07-06 15:23:30 +00:00
parent ebdfc812a3
commit b7e0e78ca9
4 changed files with 32 additions and 11 deletions

View File

@@ -331,10 +331,11 @@ namespace VEPROMS.CSLA.Library
{
// as a precaution, convert any \~ to \u160?. This is for Hard spaces. see the commentary in the
// save portion of this code for an explanation.
text = text.Replace(@"\~", @"\u160?");
//text = text.Replace(@"\~", @"\u160?");
// convert \'99 to \u8482? this is for the trade mark symbol. For some reason RTF is automatically
// converting the unicode \u8482? to \'99, but once this is done, PROMS StepRTB (edit windows) do not show it
text = text.Replace(@"\'99", @"\u8482?");
//text = text.Replace(@"\'99", @"\u8482?");
text = RtfTools.RTFConvertedSymbolsToUnicode(text);
text = text.Replace("\r\n", @"\line "); // replace a \r\n with a \line instead of a \par
text = text.Replace(@"\line", @"\pard\line");
text = text.Replace(@"\pard\pard\line", @"\pard\line");
@@ -1147,12 +1148,13 @@ namespace VEPROMS.CSLA.Library
// Note that if the \~ is sent to the rtb, it is treated as a regular space,
// i.e. no longer a hardspace, and actually is converted to a regular space.
// SO, on the way out, convert any \~ to \u160?
string noExtraRtfStr = text.Replace(@"\~", @"\u160?");
noExtraRtfStr = noExtraRtfStr.Replace(@"\'a0", @"\u160?");
//string noExtraRtfStr = text.Replace(@"\~", @"\u160?");
//noExtraRtfStr = noExtraRtfStr.Replace(@"\'a0", @"\u160?");
// convert \'99 to \u8482? this is for the trade mark symbol. For some reason RTF is automatically
// converting the unicode \u8482? to \'99, but once this is done, PROMS StepRTB (edit windows) do not show it
noExtraRtfStr = noExtraRtfStr.Replace(@"\'99", @"\u8482?");
//noExtraRtfStr = noExtraRtfStr.Replace(@"\'99", @"\u8482?");
string noExtraRtfStr = RtfTools.RTFConvertedSymbolsToUnicode(text);
// Check for two links in a row & if found, add separating rtf comment
// commands (these get removed in the richtextbox:
// RHM 20100303 Not sure why this is here. The RichTextBox will always remove it.
@@ -1315,10 +1317,12 @@ namespace VEPROMS.CSLA.Library
// Note that if the \~ is sent to the rtb, it is treated as a regular space,
// i.e. no longer a hardspace, and actually is converted to a regular space.
// SO, on the way out, convert any \~ to \u160?
retval = retval.Replace(@"\~", @"\u160?");
//retval = retval.Replace(@"\~", @"\u160?");
// convert \'99 to \u8482? this is for the trade mark symbol. For some reason RTF is automatically
// converting the unicode \u8482? to \'99, but once this is done, PROMS StepRTB (edit windows) do not show it
retval = retval.Replace(@"\'99", @"\u8482?");
//retval = retval.Replace(@"\'99", @"\u8482?");
retval = RtfTools.RTFConvertedSymbolsToUnicode(retval);
// remove carriage return/newlines after \par commands (these are introduced by rtb
// for hard returns, goes into rtb as \par and comes out as \par\r\n):