diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs index 56506369..f52c7df1 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs @@ -216,11 +216,18 @@ namespace VEPROMS.CSLA.Library // return null; //} - public string GetTranslatedRoValue(string ROID16, bool DoCaret) + public string GetTranslatedRoValue(string ROID16, bool DoCaret, bool DoDOSSuperSubScript) { string retval = GetRoValue(ROID16); retval = ReplaceUnicode(retval, DoCaret); retval = ConvertFortranFormatToScienctificNotation(retval); + // B2019-037 handle the super an sub scripts after getting the RO value from the FST + // the corrected RO text is added to the display text in the link info + if (DoDOSSuperSubScript) + { + retval = Regex.Replace(retval, "[#](.*?)[#]", "\\up2 $1\\up0 ");// Superscript + retval = Regex.Replace(retval, "[~](.*?)[~]", "\\dn2 $1\\up0 ");// Subscript + } return retval.Replace("\r\n", @"\par "); } private string ReplaceUnicode(string s2, bool DoCaret) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs index b0d75ba1..f1b7d3be 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs @@ -1616,7 +1616,7 @@ namespace VEPROMS.CSLA.Library foreach (ContentRoUsage ro in cont.ContentRoUsages) { RoUsageInfo rou = RoUsageInfo.Get(ro.ROUsageID); - string myvalue = mylookup.GetTranslatedRoValue(rou.ROID, tmp.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta); + string myvalue = mylookup.GetTranslatedRoValue(rou.ROID, tmp.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, tmp.ActiveFormat.PlantFormat.FormatData.SectData.UseTildaPoundCharsForSuperSubScriptInROValues); ROFSTLookup.rochild rocc = mylookup.GetRoChild(rou.ROID); int mytype = rocc.type; cont.FixContentText(rou, myvalue, mytype, myRoFst); @@ -1840,7 +1840,7 @@ namespace VEPROMS.CSLA.Library ROFSTLookup mylookup = myRoFst.GetROFSTLookup(tmp.ContentItems[0].MyProcedure.MyDocVersion); foreach (RoUsageInfo rou in tmp.ContentRoUsages) { - string myvalue = mylookup.GetTranslatedRoValue(rou.ROID, tmp.ContentItems[0].ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta); + string myvalue = mylookup.GetTranslatedRoValue(rou.ROID, tmp.ContentItems[0].ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, tmp.ContentItems[0].ActiveFormat.PlantFormat.FormatData.SectData.UseTildaPoundCharsForSuperSubScriptInROValues); ROFSTLookup.rochild rocc = mylookup.GetRoChild(rou.ROID); int mytype = rocc.type; ctmp.FixContentText(rou, myvalue, mytype, myRoFst); diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 140344e4..f260dd99 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -843,7 +843,7 @@ namespace VEPROMS.CSLA.Library if (this.ActiveSection != null) { string oldText = this.MyContent.Text; - string roval = lookup.GetTranslatedRoValue(rousage.ROID, this.ActiveSection.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta); + string roval = lookup.GetTranslatedRoValue(rousage.ROID, this.ActiveSection.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, this.ActiveSection.ActiveFormat.PlantFormat.FormatData.SectData.UseTildaPoundCharsForSuperSubScriptInROValues); ROFSTLookup.rochild roch = lookup.GetRoChild(rousage.ROID); this.MyContent.FixContentText(rousage, roval, roch.type, rofstinfo, this); string newText = this.MyContent.Text; @@ -890,7 +890,7 @@ namespace VEPROMS.CSLA.Library { ROCheckCount++; string oldText = itemInfo.MyContent.Text; - string roval = lookup.GetTranslatedRoValue(rousage.ROID, sectionInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta); + string roval = lookup.GetTranslatedRoValue(rousage.ROID, sectionInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, sectionInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseTildaPoundCharsForSuperSubScriptInROValues); ROFSTLookup.rochild roch = lookup.GetRoChild(rousage.ROID); itemInfo.MyContent.FixContentText(rousage, roval, roch.type, rofstinfo, itemInfo); string newText = itemInfo.MyContent.Text; @@ -1039,7 +1039,7 @@ namespace VEPROMS.CSLA.Library { if (sectionInfo != null) { - string roval = lookup.GetTranslatedRoValue(rousage.ROID, sectionInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta); + string roval = lookup.GetTranslatedRoValue(rousage.ROID, sectionInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, sectionInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseTildaPoundCharsForSuperSubScriptInROValues); ROFSTLookup.rochild roch = lookup.GetRoChild(rousage.ROID); itemInfo.MyContent.FixContentText(rousage, roval, roch.type, rofstinfo, itemInfo); } diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs index 22d31d67..d48a2367 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs @@ -607,7 +607,7 @@ namespace VEPROMS.CSLA.Library { foreach (ItemInfo ii in roUsg.MyContent.ContentItems) { - string val = newLU.GetTranslatedRoValue(padroid, ii.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta); + string val = newLU.GetTranslatedRoValue(padroid, ii.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, ii.ActiveFormat.PlantFormat.FormatData.SectData.UseTildaPoundCharsForSuperSubScriptInROValues); content.FixContentText(roUsg, val, roch.type, origROFstInfo, true); if (content.IsDirty) {