diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs index 86ae1fff..78059558 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs @@ -180,6 +180,19 @@ namespace VEPROMS.CSLA.Library @"\par\par\par "); } } + // B2018-041 this logic was moved to fix this bug, but it is needed to keep Braidwood print of Procedure ROs to remain consistent with how it was + // before the fix. Replace Hard Hyphens with normal hyphen so the PDF search for hyphens will work properly + // B2019-171: added a format flag, DoSpaceDashBeforeROResolve, so that this fix for B2018-041 would not affect Braidwood/Byron, RO's that were defined + // as Procedures should not have the text uppercased. + if (itemInfo.ActiveFormat.PlantFormat.FormatData.ROData.DoSpaceDashBeforeROResolve) + { + if (text.Contains(@"\u8209?") && epMode == E_EditPrintMode.Print) + { + // Handle RTF Tokens followed immediately by a hard hyphen + text = Regex.Replace(text, @"(?<=\\[^\\?' \r\n\t]+)\\u8209\?", " -"); + text = text.Replace(@"\u8209?", "-"); + } + } // Replace backslash symbol with normal backslash so the PDF search for backslashes will work properly if (text.Contains(@"\u9586?") && epMode == E_EditPrintMode.Print) { @@ -278,11 +291,16 @@ namespace VEPROMS.CSLA.Library } // B2018-041 moved this logic here from DisplayText() so the it does not defeat the Upcase RO's after Dash logic // Replace Hard Hyphens with normal hyphen so the PDF search for hyphens will work properly - if (text.Contains(@"\u8209?") && epMode == E_EditPrintMode.Print) + // B2019-171: added a format flag, DoSpaceDashBeforeROResolve, so that this fix for B2018-041 would not affect Braidwood/Byron, RO's that were defined + // as Procedures should not have the text uppercased. + if (_MyItemInfo == null || !_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.DoSpaceDashBeforeROResolve) { - // Handle RTF Tokens followed immediately by a hard hyphen - text = Regex.Replace(text, @"(?<=\\[^\\?' \r\n\t]+)\\u8209\?", " -"); - text = text.Replace(@"\u8209?", "-"); + if (text.Contains(@"\u8209?") && epMode == E_EditPrintMode.Print) + { + // Handle RTF Tokens followed immediately by a hard hyphen + text = Regex.Replace(text, @"(?<=\\[^\\?' \r\n\t]+)\\u8209\?", " -"); + text = text.Replace(@"\u8209?", "-"); + } } // if in print mode, view mode, or non-active richtextbox do replace words. Only if in // actual edit mode are replace words left as is. @@ -290,6 +308,7 @@ namespace VEPROMS.CSLA.Library if (wordsShouldBeReplaced && !_MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.TurnOffReplaceWords) { int profileDepth1 = ProfileTimer.Push(">>>> DoReplaceWords2"); + text = DoReplaceWords2(text); ProfileTimer.Pop(profileDepth1); } diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs index 0b2b9262..6ad8849e 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs @@ -6830,6 +6830,14 @@ namespace VEPROMS.CSLA.Library return LazyLoad(ref _CapFirstLetterInHighRO, "@CapFirstLetterInHighRO"); } } + private LazyLoad _DoSpaceDashBeforeROResolve; + public bool DoSpaceDashBeforeROResolve + { + get + { + return LazyLoad(ref _DoSpaceDashBeforeROResolve, "@DoSpaceDashBeforeROResolve"); + } + } } #endregion #endregion