B2026-022-Adding-RO-Editor-symbols-to-RO-Tables #738

Merged
jjenko merged 5 commits from B2026-022-Adding-RO-Editor-symbols-to-RO-Tables into Development 2026-03-17 16:09:56 -04:00
3 changed files with 50 additions and 4 deletions
Showing only changes of commit 7636fe7686 - Show all commits

View File

@@ -419,6 +419,7 @@ namespace ROEditor
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
// The data path the was passed in.
PassedInPath = @"V:\Active Project Files\Farley PROMS Delivery\2022\RO";
DbConnectPath = PassedInPath;
// Setup the context menu

View File

@@ -2142,7 +2142,21 @@ namespace RODBInterface
wraccid = accid;
string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now);
string xmlstr = GenerateXmlString(ro, false);
string strUpdate = "UPDATE " + ro.GetAttribute("Table") + " SET Info = '" + xmlstr + "'";
StringBuilder xmlstrTmp = new StringBuilder(); // B2026-025 prep the info field data so it will be saved correctly.
char[] chrAry = xmlstr.ToCharArray();
foreach (int chr in chrAry)
{
if (chr > 166)
mschill marked this conversation as resolved
Review

Should there be a blank line inserted here?

Should there be a blank line inserted here?
Review

I removed the blank line

I removed the blank line
{
xmlstrTmp.Append($"\\u{(int)chr}?");
}
else
{
xmlstrTmp.Append((char)chr);
}
}
string strUpdate = "UPDATE " + ro.GetAttribute("Table") + " SET Info = '" + xmlstrTmp.ToString() + "'";
if (movedRO)
{
VlnXmlElement parent = (VlnXmlElement)ro.ParentNode;
@@ -2186,6 +2200,21 @@ namespace RODBInterface
}
string xmlstr = GenerateXmlString(ro, false);
StringBuilder xmlstrTmp = new StringBuilder(); // B2026-025 prep the info field data so it will be saved correctly.
char[] chrAry = xmlstr.ToCharArray();
foreach (int chr in chrAry)
{
if (chr > 166)
mschill marked this conversation as resolved
Review

Should there be a blank line inserted here?

Should there be a blank line inserted here?
Review

I removed the blank line

I removed the blank line
{
xmlstrTmp.Append($"\\u{(int)chr}?");
}
else
{
xmlstrTmp.Append((char)chr);
}
}
string wraccid = null;
if (ro.HasAttribute("AccPageID"))
{
@@ -2209,13 +2238,13 @@ namespace RODBInterface
// strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, AccPageID, ModDateTime, Info ) ";
strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, ModDateTime, AccPageID, Info ) ";
strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.Group + ",'" + ro.GetAttribute("ParentID");
strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstr + "');";
strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstrTmp.ToString() + "');";
}
else
{
strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, ModDateTime, Info ) ";
strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.Group + ",'" + ro.GetAttribute("ParentID");
strInsert = strInsert + "','" + dt + "','" + xmlstr + "');";
strInsert = strInsert + "','" + dt + "','" + xmlstrTmp.ToString() + "');";
}
}
@@ -2223,7 +2252,7 @@ namespace RODBInterface
{
strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, AccPageId, ModDateTime, Info ) ";
strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.RRO + ",'" + ro.GetAttribute("ParentID");
strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstr + "');";
strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstrTmp.ToString() + "');";
}
try

View File

@@ -2473,6 +2473,19 @@ namespace Volian.Controls.Library
private string ConvertTableText(string str)
{
string rtn = str;
string pattern = @"\\u([0-9]{1,4})\?";
string mValue, mValue2 = "";
foreach (Match match in Regex.Matches(rtn, pattern, RegexOptions.IgnoreCase))
{
mValue = match.Value;
mValue2 = @"\f1 " + mValue + @"\f0";
mschill marked this conversation as resolved Outdated

Performance - Would avoid adding together strings - would suggest string interpolation.

mValue2 = $"\f1 {mValue}\f0";

note that this viewer changes the double slashes to single ones (unless you click edit on the comment - so see screenshot below)

Performance - Would avoid adding together strings - would suggest string interpolation. mValue2 = $"\\f1 {mValue}\\f0"; note that this viewer changes the double slashes to single ones (unless you click edit on the comment - so see screenshot below)

I made the change.

I made the change.
rtn = rtn.Replace(match.Value, mValue2);
// @"\f1\u9474 ?\f0")
mschill marked this conversation as resolved
Review

Commented out code should be removed or have text designating why it is not?

Commented out code should be removed or have text designating why it is not?
// linkValue = linkValue.Replace(match.Value, "\\f1 " + match.Value + "\\f0");
}
//ShowRawString(str, "ConvertTableText IN");
rtn = rtn.Replace(@"START]\v0", @"START]\cf1\v0");
rtn = rtn.Replace(@"\v #Link:", @"\cf0\v #Link:");
@@ -3827,6 +3840,9 @@ namespace Volian.Controls.Library
this.MergedRanges.Clear();
this.Clear();
this.IsRoTable = true;
//valtext = valtext.Replace(@"\u8209?", "-");
mschill marked this conversation as resolved Outdated

Commented out code should be removed or have text designating why it is not?

Commented out code should be removed or have text designating why it is not?

I remove the comment

I remove the comment
//valtext = Regex.Replace(valtext, @"\\u([0-9]{1,4})\?", m => int.TryParse(m?.Groups[1]?.Value, out int result) ? Convert.ToChar(result).ToString() : "");
//valtext = valtext.Replace("-", @"\u8209?");
this.ParseTableFromText(valtext, GridLinePattern.Single);
this.AutoSizeCols();
this.AutoSizeRows();