C2022-003-Change-Textboxes-to-RTF-3 #676
Closed
plarsen
wants to merge 0 commits from
C2022-003-Change-Textboxes-to-RTF-3 into Development
pull from: C2022-003-Change-Textboxes-to-RTF-3
merge into: Volian:Development
Volian:master
Volian:Development
Volian:B2026-017
Volian:B2026-024
Volian:C2022-003-Change-Textboxes-to-RTF-4
Volian:B2026-019
Volian:F2026-010_VogtleBack_fontsize
Volian:C2024_006_The_Admin_tool_that_Check_for_bad_RO_links_could_be_improved_to_fix-some-additional_cases-4
Volian:C2026-023
Volian:B2025-064_v2
Volian:B2026-016
Volian:C2026-010
Volian:C024-039_Button_on_Applicability_Tab_to_change_all_at_same_level_for_setting_the_item_mode-2
Volian:B2026-015
Volian:F2026-007_F2026-009
Volian:B2026-014
Volian:F2026-008_VogtleBackgroundsPagination
Volian:C2026-009
Volian:B2026-012
Volian:F2026-006
Volian:C2026-013
Volian:F2026-004_F2026-005_VogtleBackgroundChanges
Volian:C2026-012
Volian:B2026-011
Volian:C2026-062
Volian:B2026-009_VogtleCAS
Volian:F2026-003_VogtleBckGndChanges
Volian:C2026-006
Volian:B2026-007_C2026-004
Volian:B2026-003_crash_fixing_ROs_in_table
Volian:B2026-006
Volian:C2026-003_Vogtle_RNO_ContActionStep
Volian:B2026-001-Sort-order--for-ROs-Wolf-Creek-4
Volian:B2026-001-Sort-order--for-ROs-Wolf-Creek-2
Volian:C2026-002
Volian:Update_ForSQL_Compat_1_19_2026
Volian:F2026-002_Vogtle_Top_Continue_Message
Volian:B2026-002
Volian:F2026-001_Add_Parent_Tab_To_CAS_Step
Volian:C2025-043
Volian:B2025-065
Volian:Rollback_B2025-064
Volian:Code_Cleanup_12_16_2025
Volian:C2025-060
Volian:F2025-042_Vogtle3&4_nonboldCAS
Volian:F2025-040_VogtleSingleColAtt_ContActStep_Box
Volian:B2025-064
Volian:B2019-140_B2022-099
Volian:F2025-038_Vogtle_3&4_CAS_Formating
Volian:F2025-039_Vogtle_3&4_ReplaceWordsUpdate
Volian:F2025-037_Vogtle_ReplaceWords_Tweak
Volian:C2025-063
Volian:B2025-063
Volian:C2019-036
Volian:B2025-062_Vogtle_AOP_Null_Ref
Volian:B2025_060_SectContPrintBug
Volian:F2025-036_Vogtle_3_4_rmvExtraSectStyle
Volian:F2025-035_Vogtle_3_4_substep_tab
Volian:F2025-034_VogtleTransitions
Volian:F2025-033_Vogtle_3&4_Remove_Operator_Actions
Volian:B2025-058_061_Vogtle_TransitionFix
Volian:F2025-031_Vogtle3&4_ReplaceWordsFix
Volian:C2021-035
Volian:F2025-030_Vogtle_End
Volian:F2025-029_Vogtle_Westinghouse_Footer
Volian:B2021-092
Volian:B2025-053
Volian:B2025-056
Volian:C2024-047
Volian:F2025-028_Vogtle3_4_Bold_RNO
Volian:F2025-027_Vogtle_3_4_Backgrounds_PSI
Volian:B2025-057
Volian:B2025-055
Volian:B2025-054
Volian:F2025-026_Vogtle_Background_Formats
Volian:C2025-053
Volian:F2025_025_Vogtle3&4_SubSect_single_Att
Volian:C2025-037
Volian:F2025-024_Vogtle_Dont_Bold_RNO
Volian:F2025-023_Vogtle_3_4_Replacewords_Fix
Volian:B2025-046_B2025-043_B2024-082
Volian:Vogtle34_EOP_Format_Changes
Volian:B2025-051
Volian:B2025-048
Volian:Vogtle_Format_Tweaks_EOPs
Volian:C2015-028
Volian:B2025-050_SaveUserSettings
Volian:B2025-049
Volian:B2025-047
Volian:F2025-018-019_BVPS_2colAttSect_SetPtUnits
Volian:C2025-055
Volian:C2021-058_C2025-052
Volian:C2025-054_UpMinorRev
Volian:C2025-034
Volian:C2025-009
Volian:C2025-022-PROMS-FIXES_CHECKIN
Volian:C2024-036
Volian:C2025-017_PrintAllApproved
Volian:C2025-022-Remove-UCF-2
Volian:B2025-044
Volian:C2025-051
Volian:C2025-001
Volian:C2025-035
Volian:B2025-041-Set-Quick-Print-overwrite-pdf-to-false
Volian:B2025-042
Volian:C2025-048-Set-Quick-Print-overwrite-pdf-to-false
Volian:B2025-037
Volian:C2025-045
Volian:C2025-049-update_StandardHyphens_AdminTools
Volian:C2025-015_ViewMultipleApprovedPDFsOfSameName
Volian:B2025-038-Copy-a-step-between-two-screens
Volian:C2025-024
Volian:B2025-036-SplitScreen-Print-Error
Volian:C2025-039_allowStepTransToAllWordProc
Volian:C2025-047-cleanup
Volian:C2025-047-AnnotationsTypeSelectChanges
Volian:C2025-047-AnnotationsTypeSelectChanges-5
Volian:SQL_Optimization_7_31_2025
Volian:C2025-027-AnnotationsTypeSelect-3
Volian:C2025-027-AnnotationsTypeSelect-2
Volian:C2025-027-AnnotationsTypeSelect
Volian:C2025-044
Volian:DEV_Proj_File_Dependency_Update
Volian:B2025-039_PropFontColorRplWrds
Volian:General_Debugging
Volian:C2025-038_EventCalls
Volian:F2025-016
Volian:B2025-035-Hold-Procedure-Set-Bug
Volian:C2025-023
Volian:C2025-036_CleanupTabCode
Volian:B2025-034-Add-error-message-documents-2
Volian:B2025-034-Add-error-message-documents
Volian:F2025-015_SharonHarris
Volian:B2025-024-Document-Unit-Print
Volian:C2025-021
Volian:C2025-023-New-EP-Format-File
Volian:F2024-089_BNPP_LOGO
Volian:C2025-013
Volian:C2025-028_B2025-032
Volian:DemoFormats
Volian:B2025-028
Volian:C2025_031_OptionsTooltips_Cleanup
Volian:B2025-031
Volian:B2025-030
Volian:C2025-032
Volian:F2025-012
Volian:B2025-026_B2025-027
Volian:C2025-027-Develop-a-way-to-filter-annotations-so-the-user-can-view-only-the-types-they-want-to-see-EP
Volian:F2025-011
Volian:B2025-010
Volian:B2022-031-Add-filtering-for-Proc-and-Section-name-from-Global-Search-2
Volian:B2022-031-Add-filtering-for-Proc-and-Section-name-from-Global-Search
Volian:ACME_formats
Volian:C2024-041-Disable-UCF-(User-Control-of-Format)-options-3
Volian:C2024-041-Disable-UCF-(User-Control-of-Format)-options-2
Volian:C2024-041-Disable-UCF-(User-Control-of-Format)-options
Volian:F2025-004_Ginna
Volian:B2025-017-Print-Section-Sub-Section-v2
Volian:DeveloperToolUpdate
Volian:B2025-020_UpdateTransitions
Volian:B2025-018
Volian:C2025-019
Volian:B2025-015
Volian:C2025-014_PDF_Step_BckMrk_Zoom
Volian:B2025-019
Volian:C2024-038_v2
Volian:F2025-002_Farley
Volian:B2025-016
Volian:C2024-038
Volian:OrgDotNetBar
Volian:B2025-013
Volian:B2025-011-Global-search-is-not-finding-question-marks
Volian:DotNetBar_net4.8.1
Volian:CLSA481Build
Volian:B2025-014
Volian:B2025-012
Volian:C2025-011
Volian:F2025-001_BNPP
Volian:C2019-025_Ability-to-Toggle-Replace-Words-3
Volian:C2025-005
Volian:C2019-025_Ability-to-Toggle-Replace-Words-2
Volian:C2019-025_Ability-to-Toggle-Replace-Words
Volian:B2025-005
Volian:C2025-008
Volian:B2025-008
Volian:B2025-007
Volian:C2025-007
Volian:B2025-009
Volian:B2025-004_v2
Volian:B2025-004
Volian:C2025-006_B2025-006
Volian:C2025-003
Volian:B2025-003
Volian:C2020-049-Add-the-ability-for-PROMS-to-remember-the-procedure-tabs-that-were-open-when-you-closed-PROMS-6
Volian:F2024-074-Farley_TOC
Volian:C2020-049-Add-the-ability-for-PROMS-to-remember-the-procedure-tabs-that-were-open-when-you-closed-PROMS
Volian:B2024-063-Invalid-Format-message-box-displays-when-rev-date-empty
Volian:B2024-062_EmptyProcedure
Volian:B2024-068-VCS-Deviation-Format
Volian:C2024-005
Volian:C2024-016-Write-Info-to-Results-Window-Delete-Annotations
Volian:B2024-046-Set-Default-Tab-In-Admin-Tools
Volian:C2024-005-Annotations-Cleanup
Volian:B2024-041
Volian:C2024-004_fix
Volian:C2021-059
Volian:B2024-032-Fix-Quick-Print
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "C2022-003-Change-Textboxes-to-RTF-3"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
C2022-003 The symbols that can be entered into the PROMS editor should be added to the RO editor.
see notes. Let me know if you have any questions.
@@ -302,13 +302,18 @@ using Org.Mentalis.Files;using System.Runtime.InteropServices;using System.Linq;using System.Collections.Generic;//using Volian.Controls.Library;remove commented out code
Removed
@@ -304,1 +304,4 @@using System.Collections.Generic;//using Volian.Controls.Library;using Volian.Base.Library;using VEPROMS.CSLA.Library;Not seeing where this is needed - should this be here?
can't see needing CSLA as a dependency.
Removed
@@ -309,3 +314,3 @@namespace ROEditor{/// <summary>/// <summary>Not critical -- but just a side suggestion to make things easier for future possible changes ---- I would suggest reviewing this file and try to fix some of the spacing issues --- there are a lot of items showing as changes that are not actual changes (i.e. removed blank lines or added / removed spaces) -- this makes it difficult to tell what was / wasn't changed and more likely to miss something / make a mistake. It also means that all these items will show up in history as being changed by this project. This could make diagnosing future issues more difficult (i.e. something that may have always been a certain way may appear it was changed with this project.)
OK I will remove added blank lines if I have time.
still outstanding?
still outstanding
@@ -1163,2 +1187,4 @@menuROSave.Enabled = rbtnSave.Enabled;}public void RTBSymbolsOnOff(string nm)It looks like this function isn't called by anything - we should remove code that isn't called.
I removed function
@@ -1165,0 +1212,4 @@}}//EnableDisableSymbolsBtn(sender, new ctlXMLEditEventArgs(args.idName));Remove commented out code,
Removed commented out line.
@@ -1345,0 +1378,4 @@this.tbar = new System.Windows.Forms.ToolBar();this.imageListToolBar = new System.Windows.Forms.ImageList(this.components);this.lblDuplicateRO = new System.Windows.Forms.Label();this.galleryContainerSymbolsCM = new DevComponents.DotNetBar.GalleryContainer();There are all these: galleryContainerSymbolsCM, CM3, galleryContainerSymbolsGrid, etc...
but it looks like the only gallery used is:
galleryContainerSymbols from line 1386
we shouldn't add these if they aren't used.
I removed all unneeded galleryContainerSymbols* objects.
@@ -2947,0 +3217,4 @@if (nd == null) nd = curele.SelectSingleNode("*/" + nm);if (nd == null)nd = curele.GetCurrentOfMultiFields(curele, nm); // RO Editor add symbols C2022 - 003Should these lines be removed?
if (nd==null) nd = curele.SelectSingleNode(nm+"a");
if (nd==null) nd = curele.SelectSingleNode(nm+"b");
if (nd==null) nd = curele.SelectSingleNode(nm+"c");
if (nd==null) nd = curele.SelectSingleNode(nm+"d");
These lines have been removed.
I am more questioning why these were removed
as these were here before this project?
still outstanding?
I am not sure what these were in here for originally --- maybe parent/child? Will removing this code cause this to not work?
Never mind - I didn't notice that these lines were commented out in the original (lines 2942-2946 in the original file.
@@ -3031,0 +3312,4 @@DevComponents.DotNetBar.ButtonItem btn = new DevComponents.DotNetBar.ButtonItem();btn.Image = symCharBtmp;//btnCM.Text = string.Format("{0}", SymbolNode.SelectSingleNode("unicode").InnerText);remove commented out code
Line removed
@@ -3031,0 +3323,4 @@btn.FontBold = true;btn.Click += new System.EventHandler(rbtnSymbols_Click);galleryContainerSymbols.SubItems.Add(btn);////galleryContainerSymbolsremove commented out code
Removed
@@ -3057,0 +3453,4 @@// later on, we could add logic to use either FreeMono or Arial Unicode MS based on the format being used// but for now, we are going to use FreeMono to create the symbol listFont objFont = new Font("FreeMono", 18, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);//Font objFont = new Font("Arial Unicode MS", 18, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);remove commented out code
//StartGridEditing(SelectionOption.Start); // If in a FlexGrid, start the editor for a cell
//_MyStepRTB.InsertSymbol(Convert.ToInt32(b.Tag));
are still in code
still outstanding?
@@ -3057,0 +3473,4 @@objGraphics.SmoothingMode = SmoothingMode.AntiAlias;objGraphics.TextContrast = 0;objGraphics.TextRenderingHint = TextRenderingHint.AntiAlias;//objGraphics.DrawString(txt, objFont, new SolidBrush(Color.FromArgb(102, 102, 102)), 0, 0);remove commented out code
Line removed.
@@ -3057,0 +3478,4 @@objGraphics.Flush();return (objBmpImage);}private void btnSym_Click(object sender, EventArgs e)what does this do? / is this used?
looks like only sets a local variable that is never used?
I removed function. it was used in previous code before RTB.
@@ -3057,0 +3482,4 @@{DevComponents.DotNetBar.ButtonItem b = (DevComponents.DotNetBar.ButtonItem)sender;//if (cbxTextSearchAnnotation.Focused)remove commented out code
Line removed.
@@ -3071,0 +3565,4 @@{DevComponents.DotNetBar.ButtonItem b = (DevComponents.DotNetBar.ButtonItem)sender;ctlXMLEdit2.TextBoxFocus.InsertSymbol(Convert.ToInt32(b.Tag));//StartGridEditing(SelectionOption.Start); // If in a FlexGrid, start the editor for a cellRemove commented out code
This appears to still be in there.
Still in there - now line 3453/4.
Removed commented out code.
@@ -124,6 +128,10 @@<Reference Include="System.Xml"><Name>System.XML</Name></Reference><Reference Include="VEPROMS.CSLA.Library, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">What is this needed for?
I would suggest not adding CSLA as a dependency to the RO Editor / doing straight SQL connections as this adds a dependency that we may need to strip out later as at some point CSLA may become no longer maintainable.
Looks good now.
@@ -42,6 +42,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CmpRpt", "..\CmpRpt\CmpRpt.{3A4A3543-2D44-11D6-8452-00A0CC271352} = {3A4A3543-2D44-11D6-8452-00A0CC271352}EndProjectSectionEndProjectProject("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D9093FAB-448E-47C7-961B-92B18D85CAF7}"What project is this that is being added to this solution?
(I am asking as I do not see a new project file which leads me to wonder if this is a PROMS project file being added (which could add cross dependencies) )
I removed it.
@@ -2182,10 +2186,13 @@ namespace RODBInterfaceparent.SetAttribute("ChildLoaded", "True");}string xmlstr = GenerateXmlString(ro, false);string tmp2 = Regex.Replace(xmlstr, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // RO Editor add symbols C2022 - 003Where is tmp2 used?
I am seeing this added but doing see a usage later in the file.
Running Regex's take up resources so should only be done if necessary.
I removed the line. It might have been a left over from something I was trying.
Looks good now.
@@ -111,6 +111,9 @@<Prefer32Bit>false</Prefer32Bit></PropertyGroup><ItemGroup><Reference Include="ctlXMLEditLib">not sure I am understanding why this reference is needed. ctlXMLEdit should depend on RODBInterface instead of the other way around?
removed reference
@@ -315,0 +336,4 @@set{_TextBoxFocus = value;// C2015-017 hide the label indicating user is working with a duplicate of an exiting RONot sure this comment is correct.
Isn't this: // RO Editor add symbols C2022 - 003
This comment stays. I did not add it, and it is not a part of C2022-003
@@ -315,0 +337,4 @@{_TextBoxFocus = value;// C2015-017 hide the label indicating user is working with a duplicate of an exiting RO//lblDuplicateRO.Visible = value;Remove commented out code
Removed comment and code.
@@ -481,0 +509,4 @@{hwnd.Text = Regex.Replace(nd.InnerText, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // set the field's text from XML//hwnd.Text = nd.InnerText; // set the field's text from XMLRemove commented out code
I removed the comment.
@@ -675,0 +713,4 @@string result1 = "";string Str = "";char[] chrAry = hwnd.Text.ToCharArray();foreach (int chr in chrAry)Can simplify this to have less executions / possibly use LINQ. See recommendations that SonrLint Visual Studio Ext will give.
I will take a look at it if I have time.
At a minimum - would suggest not concatenating strings in a loop and using stringbuilder instead.
Here is an article I found detailing why shouldn't concat strings in a loop - they explain it probably a little better than I can & give some examples:
https://www.linkedin.com/pulse/string-vs-stringbuilder-performance-cnet-explained-andre-baltieri-5qeff/
resolving this item - with stringbuilder, should at least be better memory / performance wise.
@@ -675,0 +717,4 @@{if (chr > 166){//Str = @"\u" + ((int)chr).ToString("X4");Remove commented out code
Removed commented out code.
@@ -788,6 +850,125 @@ namespace ctlXMLEditLibreturn (false);}// RO Editor add symbols C2022 - 003see notes below. It looks like these sreg variables are never used.
i.e. they are only called in StaticStripRtfCommands - which is never called.
we should avoid regexs that are never used as they take up resources.
I removed them.
@@ -791,0 +861,4 @@private static Regex sreg8 = new Regex(@"(\\[^ \\?\r\n\t]+) (?=\\)"); // remove space between tokensprivate static Regex sreg9 = new Regex(@"(\\[^ \\?\r\n\t]+) (?=\r\n)"); // remove space before /r/npublic static string StaticStripRtfCommands(string rtf, bool fromTable)Maybe I am missing something but I am not seeing this function being called anywhere?
We shouldn't include code that isn't called / used.
I removed the unused functions.
@@ -791,0 +907,4 @@}// RO Editor add symbols C2022 - 003public static string RTFConvertedSymbolsToUnicode(string str)Maybe I am missing something, but it looks like the only place this is called from is StaticStripRtfCommands - which is never called --- so this code will never be called / executed?
I removed the unused functions.
@@ -791,0 +924,4 @@return rtnStr;}public static string StaticReplaceRTFClause(Match m)It looks like this function is never called?
We should remove unused functions.
I removed the unused functions
@@ -891,1 +1073,4 @@Size size = GraphicsHttextbox.Size;mytextbox.LostFocus += new System.EventHandler(this.GraphicsHt_lostfocus);//mytextbox.Remove commented out code
Removed comment.
@@ -1932,0 +2160,4 @@set { _DisplaySymBolBtn = value; }}}public static class RichTextBoxExtensions // RO Editor add symbols C2022 - 003A new class like this or extending an existing class should be in it's own cs file so it can be found easily. --- also, otherwise it may be difficult to tell when it will work or not.
still outstanding?
@@ -1932,0 +2170,4 @@richTextBox.SelectedRtf = RtfPrefixForSymbols + sym + @"}";richTextBox.SelectedRtf = @"{\rtf1\ansi\ansicpg1252\deff0\deflang1033\uc1 }";richTextBox.Select(position, 0);//richTextBox.Select(position, 1); //left here for referenceRemove commented out code
I removed the commented out code.
@@ -126,6 +126,10 @@<Reference Include="System.Xml"><Name>System.XML</Name></Reference><Reference Include="Volian.Base.Library, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">Is this reference needed?
Not seeing anything added that references the Base library? (unless I am missing something)
If nothing is added requiring this, then should not add an added dependency.
I remove the reference
@@ -2155,2 +2160,3 @@s2 = s2.Replace(@"\u160?", "<HSP>"); // convert hard spaces bug fix: B2016-206s2 = s2.Replace(@"\", @"\u9586?"); // convert backslashes to a backslash symbolif (!Regex.IsMatch(s2, pattern)) // RO Editor add symbols C2022 - 003Not if sure this makes sense --- will this ever get executed?
what if you have something that contains both special characters and a backslash in the text?
It is needed. If a special letter (Unicode) comes through this code it will mess-up one way or another. Maybe it needs to be refined to handle the special char and a separate back slash.
I would say that is the case --- if there are are matches on the backslash not followed by a "u" those need to be replaced.
Likely would have to get matches and then loop through those specific matches doing a replace on those,
Not seeing any changes here - not sure if I am missing something?
"Replace backslashes if not a \u is anywhere in the string" likely need changes to "Replace the specific backslashes the are not followed by a u". Think if you had something like:
"if A \u0026 B replace the C\D."
currently nothing would be replaced vs the \ between C\D being the only thing replaced.
I see that we want to convert a backslash when it's not part of a Unicode character, but if the text in variable "s2" has both a regular backslash and a symbol, this logic would not replace that regular backslash because Regex would find the Unicode for the symbol.
I believe a regex replace will work.
Your pattern would need to have a negative lookahead for u.
Here is an example of a regex with a lookahead:
https://stackoverflow.com/questions/49841621/c-sharp-regular-expression-look-ahead-s
lines 2157 - 2165 should be able to be replaced with something similar to:
I ran a test in a separate test project in Visual Studio but I would suggest running a few more tests. What I used for my test was basically the above code I gave:
& then I checked what was in output.
@@ -1,18 +1,19 @@using DevComponents.DotNetBar;what is this needed for?
I did not add it. I checked with the Master and it is included.
sorry missed it since the lines were changed. It was previously on line 11. - this is good. I will resolve this item.
@@ -13,3 +14,2 @@using Volian.Base.Library;using JR.Utils.GUI.Forms;using System.Linq;using XYPlots;what is this needed for?
I did not add it. I checked with the Master and XYPlots is included.
sorry missed it since the lines were changed. It was previously on line 10. - this is good. I will resolve this item.
@@ -14,2 +15,2 @@using JR.Utils.GUI.Forms;using System.Linq;using XYPlots;using static System.Net.Mime.MediaTypeNames;what is this needed for?
Not sure how the line got there. I will remove it.
@@ -724,2 +724,4 @@}}public DevComponents.DotNetBar.GalleryContainer BuildSymbolGalleryForRO()This function doesn't appear to be called from anywhere / used anywhere -- should this be in here / changed?
Also, should there be any changes to the StepTabRibbon Designer or Resx PROMS files?
It looks like Dotnetbar was used in the RO Editor not StepTabRibbon - so are theseearlier attempts that shouldn't be part of the final product (unless I am missing something - which could be possible)?
---but as is it looks like there shouldn't be any changes to any of the 3 StepTabRibbon files?
I removed the function
I resolved the comments that have had changes.
Can see outstanding open comments at:
#676
I will leave it up to John / Devin if they want to address some of the remaining items.
Remaining items:
ROEditor.cs:
ctlXMLEdit.cs
ROFSTLookup.cs
"if A \u0026 B replace the C\D."
currently nothing would be replaced vs the \ between C\D being the only thing replaced.
@@ -1972,6 +1975,7 @@ namespace RODBInterfaceelem.SetAttribute("RecID", RecID);elem.SetAttribute("ParentID", node.GetAttribute("RecID"));elem.SetAttribute("Table", node.GetAttribute("Table"));AccPageID = Regex.Replace(AccPageID, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // RO Editor add symbols C2022 - 003This should not be needed because the AccPageID should never have symbol character.
not sure if I am missing something but it looks like changes / reg-ex to AccPageID are still in here?
@@ -675,0 +709,4 @@string result1 = "";string Str = "";char[] chrAry = hwnd.Text.ToCharArray();foreach (int chr in chrAry)I agree with possibly useing LINCQ
Waiting for items to get resolved from both reviews
I resolved the comments that have had changes.
Looks like string concat was changed to a stringbuilder in the loop.
Can see outstanding open comments at:
#676
I will leave it up to John / Devin if they want to address some of the remaining items.
Remaining items:
ROEditor.cs:
I resolved the comments that have had changes.
Can see outstanding open comments at:
#676
I will leave it up to John / Devin if they want to address some of the remaining items.
Remaining items:
ROEditor.cs:
ctlXMLEdit.cs
ROFSTLookup.cs
"if A \u0026 B replace the C\D."
currently nothing would be replaced vs the \ between C\D being the only thing replaced.
@@ -1973,2 +1976,4 @@elem.SetAttribute("ParentID", node.GetAttribute("RecID"));elem.SetAttribute("Table", node.GetAttribute("Table"));//AccPageID = Regex.Replace(AccPageID, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // RO Editor add symbols C2022 - 003string pattern = @"\\u([0-9]{1,4})\?";This portion of the code should simply revert back to the original. All that needs done to resolve this item is to remove lines 1978, 1979, and 1980.
@@ -2154,1 +2156,4 @@var pattern = @"\\u([0-9]{1,4})\?"; // RO Editor add symbols C2022 - 003if (Regex.IsMatch(s2, pattern))I don't think this "if" statement is needed. we want to replace \u160? with " no matter what.
I sent an email Friday - but so it doesn't get lost / we have it here also / we remember to test this when this item goes for testing: It appears this may need some further work to get it to work with parent child.
I was working on a separate CSM item (2026-002 When parens are inside a parent / child, printing a double parens)
and didn’t realize but the RO Editor I had compiled was the C2022-003 code (I had pulled it down locally to do my code review because the number of changes in the ROEditor.cs file were too large so it was having trouble comparing in the website.)
Anyway, for one of the Setpoints with parent child – I clicked inside the Setpoint box, pressed ctrl-a then ctrl-c
I then clicked inside the child value box for one of the units (I was intending to use ctl-v to paste the text then modify it)
But I ended up getting an exception as soon as I clicked in the child values box.
@@ -2154,3 +2156,3 @@s2 = s2.Replace(@"\u160?", "<HSP>"); // convert hard spaces bug fix: B2016-206s2 = s2.Replace(@"\", @"\u9586?"); // convert backslashes to a backslash symbols2 = s2.Replace(@"\(?!u)", @"\u9586?"); // convert backslashes to a backslash symbolsee previous comment regarding:
note that a String.Replace and a Regex.Replace are different / work differently.
You can't do the same negative lookahead or pattern matching with a String.Replace that you can with a Regex
@@ -1932,0 +2028,4 @@set { _DisplaySymBolBtn = value; }}}//public static class RichTextBoxExtensions // RO Editor add symbols C2022 - 003please remove the commented out code
Commented out code has been removed.
Looks like only 2 items remain. 1 major, 1 minor.
major item:
See email I sent last Friday with screenshot & full info - "Anyway, for one of the Setpoints with parent child – I clicked inside the Setpoint box, pressed ctrl-a then ctrl-c
I then clicked inside the child value box for one of the units (I was intending to use ctl-v to paste the text then modify it)
But I ended up getting an exception as soon as I clicked in the child values box."
minor item:
ROEditor.cs: Spacing / code format changes - unnecessary changes to this makes future changes/bug fixing more difficult
I believe the major issue is related to - if you search ctlXMLEdit.cs -- you will notice a number of places where Textboxes are being used instead of your new RoRichTextBox and I believe it can't cast one object to the other.
This especially comes up in methods tied to events where there are several with
sender as TextBox
or
(TextBox) sender
see question regarding ctlxml edit --- textbox vs RoRichTextbox.
Also found an additional place where commented out code item in ROEditor.cs
As FYI - is minor, but ROEditor.cs still has the save spacing / misrecognized changes issue.
@@ -356,2 +357,3 @@private TextBox _CurrentTextBox; // currently selected TextBox fieldprivate roRichTextBox _CurrentTextBox; // currently selected TextBox fieldpublic static string[] PCChildren; //C2021-026 list of Parent/Child Children//private StepTabRibbon _MyStepTabRibbon;Commented out code?
still here
Comment removed.
@@ -1214,3 +1282,4 @@roRichTextBox tb = sender as roRichTextBox;string dfTxt = "";try{is it possible the objects at lines 1291/1299/1307 (dfTxt = (o as TextBox).Text;) could be RoRichTextboxes and not just Textboxes?
Looks like only remaining items are
the ones with ROEditor.cs
a. the ones with commented out code
b. the one with spacing / misrecognized changes
The testing word doc attached --- not seeing anything for testing the parent/child boxes the whole way through to make sure non-default / different unit value items with symbols pull correctly into PROMs / resolve properly. Alsi, not seeing any testing for the image (graphics related) boxes that had changes to their events?
looks like the only original item still outstanding is minor:
the one with ROEditor.cs with spacing / misrecognized changes
There were a couple new items found though with the latest added code:
@@ -589,0 +598,4 @@if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)){string clpBrd = Clipboard.GetText();char[] chrAry = clpBrd.ToCharArray();Looping through each character in a string is likely to be time consuming and heavy processing
could use LINQ instead: clpBrd.Any(c => c > 166);
@@ -319,0 +322,4 @@if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)){string clpBrd = Clipboard.GetText();char[] chrAry = clpBrd.ToCharArray();Looping through each character in a string is likely to be time consuming and heavy processing
could use LINQ instead: clpBrd.Any(c => c > 166);
@@ -280,0 +284,4 @@{string clpBrd = Clipboard.GetText();char[] chrAry = clpBrd.ToCharArray();foreach (int chr in chrAry)Looping through each character in a string is likely to be time consuming and heavy processing
could use LINQ instead: clpBrd.Any(c => c > 166);
@@ -424,0 +428,4 @@if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)){string clpBrd = Clipboard.GetText();char[] chrAry = clpBrd.ToCharArray();Looping through each character in a string is likely to be time consuming and heavy processing
could use LINQ instead: clpBrd.Any(c => c > 166);
@@ -1314,0 +1317,4 @@if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)){string clpBrd = Clipboard.GetText();char[] chrAry = clpBrd.ToCharArray();Looping through each character in a string is likely to be time consuming and heavy processing
could use LINQ instead: clpBrd.Any(c => c > 166);
@@ -1929,5 +2016,60 @@ namespace ctlXMLEditLibreturn curTZ.GetDaylightChanges(year);}}//private static void AddFontTable(StringBuilder selectedRtfSB, Font myFont, bool isFixed)Should not include commented out code.
@@ -0,0 +22,4 @@{get{//B2020-100 RHM Use SelectionFont rather than the font from the format file.not sure this comment should be here since this is new code and doesn't seam related to SelectionFont?
Comment still here?
@@ -0,0 +47,4 @@if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)){string clpBrd = Clipboard.GetText();char[] chrAry = clpBrd.ToCharArray();Looping through each character in a string is likely to be time consuming and heavy processing
could use LINQ instead: clpBrd.Any(c => c > 166);
@@ -0,0 +89,4 @@}selectedRtfSB.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset2 " + myFont.FontFamily.Name + @";}");if (!isFixed)selectedRtfSB.Append(@"{\f1\fnil\fcharset0 " + Volian.Base.Library.vlnFont.ProportionalSymbolFont + @";}}{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}"); // C2017-036 get best available proportional font for symbols - B2025-039 add Blue for Colored Replace Wordsbelieve these comments may need rewritten as this is technically new code and replace words should not come into play in RO Editor.
@@ -0,0 +91,4 @@if (!isFixed)selectedRtfSB.Append(@"{\f1\fnil\fcharset0 " + Volian.Base.Library.vlnFont.ProportionalSymbolFont + @";}}{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}"); // C2017-036 get best available proportional font for symbols - B2025-039 add Blue for Colored Replace WordselseselectedRtfSB.Append(@"{\f1\fnil\fcharset0 FreeMono;}}{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}"); // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printingbelieve these comments may need rewritten as this is technically new code and this seems to reference PROMS functionality instead of RO Editor functionality..
@@ -0,0 +93,4 @@elseselectedRtfSB.Append(@"{\f1\fnil\fcharset0 FreeMono;}}{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}"); // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printingselectedRtfSB.Append("\r\n");// use styles to construct rtf commands to insert into next line (where \b, etc is)same with comment
@@ -723,6 +723,7 @@ namespace Volian.Controls.Library}}}One side question --- not sure so figured I would check --- why are there changes to StepTabRibbon (StepTabRibbon.cs, StepTabRibbon.designer.cs, StepTabRibbon.resx)?
Just wanted to check since this is used by PROMS and there shouldn't have been any changes to PROMS ribbon (I believe RO Editor is using DevComponents.DotNetBar.RibbonControl)?
I think these differences are from debugging to see how the PROMS editor handled inserting a symbol character.
suggest restoring to the development version of the StepTabRibbon files
Still valid - StepTabRibbon.cs was changed back but StepTabRibbon.designer.cs & StepTabRibbon.resx were not.
Branch needs updated as it is out of date with the development branch.
Also, StepTabRibbon.cs was changed back but StepTabRibbon.designer.cs & StepTabRibbon.resx were not.
A few minor items like:
@@ -97,3 +98,3 @@private System.Windows.Forms.Label lblW3;private System.Windows.Forms.Label lblW4;private System.Windows.Forms.TextBox tbSingleTxtWid;private System.Windows.Forms.TextBox tbSingleTxtWid;this line (line 100), 104, 223, & 227 are examples of what I was referring to with changes changing spacing / format.
@@ -589,0 +600,4 @@string clpBrd = Clipboard.GetText();if (clpBrd.Any(c => c > 166)){MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'");minor thing but concatenating together string like this takes memory - would recommend using
$"Symbols are not allowed in the field. Clipbroad: {clpBrd}"
or string.format
@@ -319,0 +327,4 @@string clpBrd = Clipboard.GetText();if (clpBrd.Any(c => c > 166)){MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'");minor thing but concatenating together string like this takes memory - would recommend using
$"Symbols are not allowed in the field. Clipbroad: {clpBrd}"
or string.format
@@ -280,0 +288,4 @@string clpBrd = Clipboard.GetText();if (clpBrd.Any(c => c > 166)){MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'");minor thing but concatenating together string like this takes memory - would recommend using
$"Symbols are not allowed in the field. Clipbroad: {clpBrd}"
or string.format
@@ -424,0 +432,4 @@string clpBrd = Clipboard.GetText();if (clpBrd.Any(c => c > 166)){MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'");minor thing but concatenating together string like this takes memory - would recommend using
$"Symbols are not allowed in the field. Clipbroad: {clpBrd}"
or string.format
@@ -1314,0 +1322,4 @@string clpBrd = Clipboard.GetText();if (clpBrd.Any(c => c > 166)){MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'");minor thing but concatenating together string like this takes memory - would recommend using
$"Symbols are not allowed in the field. Clipbroad: {clpBrd}"
or string.format
@@ -0,0 +49,4 @@string clpBrd = Clipboard.GetText();if (clpBrd.Any(c => c > 166)){MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'");minor thing but concatenating together string like this takes memory - would recommend using
$"Symbols are not allowed in the field. Clipbroad: {clpBrd}"
or string.format
Will send another pull request.
Pull request closed