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:
@@ -6,6 +6,7 @@ using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Volian.Base.Library;
|
||||
|
||||
namespace Volian.Controls.Library
|
||||
{
|
||||
@@ -179,7 +180,7 @@ namespace Volian.Controls.Library
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (char c in str)
|
||||
{
|
||||
if (c > 0xff)
|
||||
if (c > 0xff || c == 0xA9 || c == 0xAE) // xA9 is Copyright, xAE is Registered
|
||||
sb.Append(string.Format(@"\u{0}?", (int)c));
|
||||
else
|
||||
sb.Append(c);
|
||||
@@ -195,7 +196,7 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
ItemInfo next = (cbxReverse.Checked) ? MyEditItem.MyItemInfo.SearchPrev : MyEditItem.MyItemInfo.SearchNext;
|
||||
|
||||
while ((next != null) && !next.IsSection && !next.MyContent.Text.Contains(fndStr))
|
||||
while ((next != null) && !next.IsSection && !RtfTools.RTFConvertedSymbolsToUnicode(next.MyContent.Text).Contains(fndStr))
|
||||
{
|
||||
next = (cbxReverse.Checked) ? next.SearchPrev : next.SearchNext;
|
||||
}
|
||||
|
@@ -1230,7 +1230,7 @@ namespace Volian.Controls.Library
|
||||
// converting the unicode \u8482? to \'99, but once this is done, PROMS StepRTB (edit windows) do not show it
|
||||
// Also convert \~ to a hard spece. Again RTF is automatically converting \u160? to \~ but will then convert
|
||||
// the \~ to a regular space!
|
||||
string rtfText = this.GetDataDisplay(e.Row, e.Col).Replace(@"\~", @"\u160?").Replace(@"\'99", @"\u8482?");
|
||||
string rtfText = RtfTools.RTFConvertedSymbolsToUnicode(this.GetDataDisplay(e.Row, e.Col));//.Replace(@"\~", @"\u160?").Replace(@"\'99", @"\u8482?");
|
||||
GridItem gi = Parent as GridItem;
|
||||
if (gi != null)
|
||||
{
|
||||
@@ -4634,7 +4634,7 @@ namespace Volian.Controls.Library
|
||||
// Also convert \~ to a hard spece. Again RTF is automatically converting \u160? to \~ but will then convert
|
||||
// the \~ to a regular space!
|
||||
if (tmp.StartsWith(@"{\rtf"))
|
||||
Rtf = tmp.Replace(@"\~", @"\u160?").Replace(@"\'99", @"\u8482?");
|
||||
Rtf = RtfTools.RTFConvertedSymbolsToUnicode(tmp);//.Replace(@"\~", @"\u160?").Replace(@"\'99", @"\u8482?");
|
||||
else
|
||||
Text = tmp;
|
||||
}
|
||||
|
Reference in New Issue
Block a user