From 7530ca00f3ec9b0a5ca952354779e2f3589066e2 Mon Sep 17 00:00:00 2001 From: Kathy Date: Mon, 10 Mar 2014 12:44:48 +0000 Subject: [PATCH] =?UTF-8?q?For=20range=20transitions,=20don=E2=80=99t=20pu?= =?UTF-8?q?t=20=E2=80=98,=20Step=E2=80=99=20in=20text=20twice=20if=20there?= =?UTF-8?q?=20is=20an=20optional=20section=20number=20Added=20underline=20?= =?UTF-8?q?flag=20for=20transition=20text=20Added=20support=20for=20underl?= =?UTF-8?q?ine=20flag=20for=20transition=20text=20and=20fixed=20bug=20wher?= =?UTF-8?q?e=20replace=20words=20that=20had=20underline=20on/off=20for=20?= =?UTF-8?q?=E2=80=98OR=E2=80=99=20turned=20off=20underlining=20in=20transi?= =?UTF-8?q?tion=20text=20If=20selectedindex=20for=20section=20list=20was?= =?UTF-8?q?=20-1,=20set=20to=200=20and=20refresh=20the=20section=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Extension/TransitionExt.cs | 5 +++++ PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs | 8 ++++++++ PROMS/Volian.Controls.Library/DisplayText.cs | 16 +++++++++++++--- .../Volian.Controls.Library/DisplayTransition.cs | 3 ++- 4 files changed, 28 insertions(+), 4 deletions(-) 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) {