B2023-037: Handle <=, >=, +-, -> and <- symbols in ROs.

This commit is contained in:
2023-03-30 12:59:06 +00:00
parent 3e8556bac9
commit da05241df7
8 changed files with 81 additions and 30 deletions

View File

@@ -972,29 +972,31 @@ namespace Volian.Controls.Library
// SelectionLength = 0;
// //OnModeChange(this, new StepRTBModeChangeEventArgs(ViewRTB?E_ViewMode.View:E_ViewMode.Edit));
//}
public string InsertSymbolInRO(string val)
{
string retval = val;
//public string InsertSymbolInRO(string val)
//{
// string retval = val;
// C2019-043 convert a "->" to the Right Arrow symbol and a "<-" to the Left Arrow Symbol
// note that at the dash character gets convert to a non-breaking hyphen "\u8209?"
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseDashGreaterLessThenForArrowsInROValue)
{
retval = retval.Replace("\\u8209?>", GetAddSymbolTextForROs(@"\u8594?")); // Right Arrow
retval = retval.Replace("<\\u8209?", GetAddSymbolTextForROs(@"\u8592?")); // Left Arrow
}
// C2022-021 convert a "<=" to a less than or equal symbol, a ">=" to a greather than or equal symbol and +- to a
// plus/minus symbol in ROs
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertGTELTEPMinROValue)
{
retval = retval.Replace("<=", GetAddSymbolTextForROs(@"\u8804?")); // Less than or Equal
retval = retval.Replace(">=", GetAddSymbolTextForROs(@"\u8805?")); // Greater than or Equal
retval = retval.Replace("+\\u8209?", @"\'b1"); // plus/minus - note - is stored as \u8209 and plus/minus is < 256, i.e. handled differently
}
return retval;
}
//if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseDashGreaterLessThenForArrowsInROValue)
//{
// retval = retval.Replace("\\u8209?>", GetAddSymbolTextForROs(@"\u8594?")); // Right Arrow
// retval = retval.Replace("<\\u8209?", GetAddSymbolTextForROs(@"\u8592?")); // Left Arrow
//}
//// C2022-021 convert a "<=" to a less than or equal symbol, a ">=" to a greather than or equal symbol and +- to a
//// plus/minus symbol in ROs
//if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertGTELTEPMinROValue)
//{
// retval = retval.Replace("<=", GetAddSymbolTextForROs(@"\u8804?")); // Less than or Equal
// retval = retval.Replace(">=", GetAddSymbolTextForROs(@"\u8805?")); // Greater than or Equal
// retval = retval.Replace("+\\u8209?", @"\'b1"); // plus/minus - note - is stored as \u8209 and plus/minus is < 256, i.e. handled differently
//}
// return retval;
//}
public void InsertRO(string value, string link)
{
AddRtfLink(InsertSymbolInRO(value), link);
// B2023-037: Remove code that saves the unicode characters for <=, >=, +-, <- and -> into the link text. The characters
// now get resolved when used. InsertSymbolInRo was commented out also
AddRtfLink(value, link);
}
public void InsertTran(string value, string link)
{