From 31a5978a90292e7aef618e6d5a3e61687c0bfaec Mon Sep 17 00:00:00 2001 From: Kathy Date: Fri, 12 Jun 2020 15:17:16 +0000 Subject: [PATCH] F2019-065: Allow uppercase of high level steps to be defined in the format --- PROMS/Formats/fmtall/CWEall.xml | Bin 59906 -> 59940 bytes .../Extension/DisplayText.cs | 25 +++++++++++++++++- .../Format/PlantFormat.cs | 9 +++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/PROMS/Formats/fmtall/CWEall.xml b/PROMS/Formats/fmtall/CWEall.xml index 283fa476a4bb9ddecf82691185bded454be6151a..15b519a89ff32a75c2e8b082e2c580f2ef99cdc0 100644 GIT binary patch delta 32 mcmZp=!o1`P^9ChdK?R0Th5{f=Whi2BW=Lcx-Yls5aSs5Y&I!f< delta 34 qcmZ2-g}Lbp^9Ci|$pL->lLgwXCM$UGOg69)n%o!3vw4SZ&K>~b1`O8# diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs index 1ac5c516..09f6eace 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs @@ -270,6 +270,9 @@ namespace VEPROMS.CSLA.Library private string CreateRtf(bool colorLinks, string text, bool tableShouldBeOutlined, bool wordsShouldBeReplaced, bool numbersShouldBeFormated, bool tableHasBorder, bool ROsShouldBeAdjusted, bool underlineAfterDashSpace, E_EditPrintMode epMode) { int profileDepth = ProfileTimer.Push(">>>> CreateRtf"); + // F2019-065: Upper case if step format has flag + if (_MyItemInfo != null && wordsShouldBeReplaced && _MyItemInfo.IsStep && _MyItemInfo.FormatStepData.UpperCase) + text = UpCaseStep(text); // Adjust RO display if (ROsShouldBeAdjusted) { @@ -426,7 +429,27 @@ namespace VEPROMS.CSLA.Library ProfileTimer.Pop(profileDepth); return text; } - + // F2019-065: Upper case if step format has flag + private string UpCaseStep(string text) + { + // upper case all text except in links/symbols + RtfToDisplayTextElements(text); + StringBuilder sret = new StringBuilder(); + foreach (displayTextElement vte in DisplayTextElementList) + { + if (vte.Type == E_TextElementType.Text) + sret.Append(vte.Text.ToUpper()); + else if (vte.Type == E_TextElementType.Symbol) + sret.Append(vte.Text); + else + { + displayLinkElement dle = vte as displayLinkElement; + sret.Append(dle.TextAndLink); + } + } + string mdtxt = sret.ToString(); + return mdtxt; + } private string FixDiffUnitROReplaceWords(string text) { if (_MyFormat == null) return text; diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs index 3913e11d..c56881f1 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs @@ -5034,6 +5034,15 @@ namespace VEPROMS.CSLA.Library return LazyLoad(ref _UnderlineAfterDashSpace, "@UnderlineAfterDashSpace"); } } + // F2019-065: Allow uppercase of high level steps to be defined in the format + private LazyLoad _UpperCase; + public bool UpperCase + { + get + { + return LazyLoad(ref _UpperCase, "@UpperCase"); + } + } private LazyLoad _SpaceIn; public bool SpaceIn {