diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs index ead3b745..b194aefd 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs @@ -461,6 +461,11 @@ namespace VEPROMS.CSLA.Library } else if (_TranType == 4 && _ToItem.MoreThanOneStepSection()) { + if (!HasText && Prefix != null && Prefix.ToUpper().StartsWith(", STEP")) + { + _Prefix = null; + return; + } _Results.Append(Prefix); _Prefix = null; } diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs index 97491e38..73f45136 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs @@ -5212,6 +5212,14 @@ namespace VEPROMS.CSLA.Library return LazyLoad(ref _CapTranStep, "@CapTranStep"); } } + private LazyLoad _Underline; + public bool Underline + { + get + { + return LazyLoad(ref _Underline, "@Underline"); + } + } private LazyLoad _TStepNoFlag; public bool TStepNoFlag { diff --git a/PROMS/Volian.Controls.Library/DisplayText.cs b/PROMS/Volian.Controls.Library/DisplayText.cs index 2a1e14bf..d2593a24 100644 --- a/PROMS/Volian.Controls.Library/DisplayText.cs +++ b/PROMS/Volian.Controls.Library/DisplayText.cs @@ -482,6 +482,7 @@ namespace Volian.Controls.Library } private string DoTransitionAdjustments(string text, bool boldTran) { + bool undtran = _MyItemInfo.ActiveFormat.PlantFormat.FormatData.TransData.Underline; string strippedText = StaticStripRtfCommands(text); string lookFor = string.Format(@""); MatchCollection matches = Regex.Matches(text, lookFor); @@ -516,10 +517,10 @@ namespace Volian.Controls.Library // Use a "\x1" as a token to replace later. Insert the unicode char, whose length is // more than 1 character was throwing of the regexp Matches index, so that the resulting // string may have been incorrect. - retstr = beforeTran + (boldTran ? @"\b " : null) + newvalue.Substring(0, indexLastSpace) + "\x1" + newvalue.Substring(indexLastSpace + 1) + (boldTran ? @"\b0" : null) + afterTran; + retstr = beforeTran + (boldTran ? @"\b " : null) + (undtran ? @"\ul " : null) + newvalue.Substring(0, indexLastSpace) + "\x1" + newvalue.Substring(indexLastSpace + 1) + (undtran ? @"\ulnone " : null) + (boldTran ? @"\b0" : null) + afterTran; else if (beforeTran.EndsWith(" ")) - retstr = ReplaceLastSpaceWithHardSpace(beforeTran) + (boldTran ? @"\b " : null) + newvalue + (boldTran ? @"\b0" : null) + afterTran; + retstr = ReplaceLastSpaceWithHardSpace(beforeTran) + (boldTran ? @"\b " : null) + (undtran ? @"\ul " : null) + newvalue + (undtran? @"\ulnone ":null) + (boldTran ? @"\b0" : null) + afterTran; else Console.Write("");// Don't know where to put the Hard Space } @@ -1829,7 +1830,16 @@ namespace Volian.Controls.Library with = with.Replace(@"\b ",""); with = with.Replace(@"\b0 ",""); } - if (((_Font.Style & E_Style.Underline) == E_Style.Underline) && with.Contains(@"\ul ")) + bool IsUnderline = (((_Font.Style & E_Style.Underline) == E_Style.Underline) && with.Contains(@"\ul ")); + // handle where replace words replaces a string with 'underline on'string'underline off', for example Point Beach + // had replaced OR's turning underline off in the middle of a transition, "EOP-0 UNIT 1, RACTORE TRIP OR SAFETY INJECTION". + if (!IsUnderline) + { + int repidxst = text.LastIndexOf(@"\ul ", foundMatch.MyMatch.Index); + int repidxend = text.IndexOf(@"\ulnone", foundMatch.MyMatch.Index + foundMatch.MyMatch.Length); + if (repidxst > -1 && repidxend > -1 && repidxst < foundMatch.MyMatch.Index && repidxend > (foundMatch.MyMatch.Index + foundMatch.MyMatch.Length)) IsUnderline = true; + } + if (IsUnderline) { with = with.Replace(@"\ul ", ""); with = with.Replace(@"\ulnone ", ""); diff --git a/PROMS/Volian.Controls.Library/DisplayTransition.cs b/PROMS/Volian.Controls.Library/DisplayTransition.cs index 3b42a1ac..8f35419f 100644 --- a/PROMS/Volian.Controls.Library/DisplayTransition.cs +++ b/PROMS/Volian.Controls.Library/DisplayTransition.cs @@ -483,7 +483,8 @@ namespace Volian.Controls.Library if (secitm.Sections != null && secitm.Sections.Count > 0) cbTranSectsFillIn(secitm.Sections[0], secstart, false); secitm = (secitm.NextItem != null && secitm.NextItems.Count > 0 ? secitm.NextItems[0] : null); } - + if (cbTranSects.SelectedIndex == -1) cbTranSects.SelectedIndex = 0; + cbTranSects.Refresh(); } private void cbTranProcsFillIn(ItemInfo prcitm) {