diff --git a/PROMS/VEPROMS.CSLA.Library/Config/FormatConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/FormatConfig.cs index 01552730..17aa07dd 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/FormatConfig.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/FormatConfig.cs @@ -301,7 +301,8 @@ namespace VEPROMS.CSLA.Library Partials = 0x10000, // Do replace even on partial matches Plackeep = 0x20000, // Do replace in PlaceKeepers InSecTitle = 0x40000, - BeforeTrans = 0x80000 // Only do replace if the string occurs immediately before a transition. + BeforeTrans = 0x80000, // Only do replace if the string occurs immediately before a transition. + BeforeList = 0x100000 // C2021-045 Only if the text ends with a colon ":" } [Serializable] [TypeConverter(typeof(ExpandableObjectConverter))] diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs index 5ce84633..67bd87cf 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs @@ -2051,6 +2051,8 @@ namespace VEPROMS.CSLA.Library foreach (FormatConfig.ReplaceStr rs in rsl) { bool dopartial = (E_ReplaceFlags)(rs.Flag & FormatConfig.E_ReplaceFlagsUCF.Partials) == E_ReplaceFlags.Partials; + bool onlyDoList = (E_ReplaceFlags)(rs.Flag & FormatConfig.E_ReplaceFlagsUCF.BeforeList) == E_ReplaceFlags.BeforeList; // C2021-045 + // note that the order of this check is important. Check in this order... // background here if (!shouldReplace.ContainsKey((E_ReplaceFlags)rs.Flag)) @@ -2060,7 +2062,11 @@ namespace VEPROMS.CSLA.Library //ProfileTimer.Pop(profileDepth2); } bool replaceit = shouldReplace[(E_ReplaceFlags)rs.Flag]; - + + // C2021-045 if the BeforeList ReplaceWords flag is set, only do the replace word if the text ends with a colon + if (replaceit && onlyDoList && !Text.EndsWith(":")) + replaceit = false; // text does not end with a colon so don't replace this word + if (replaceit) { if (!dicReplaceRegex.ContainsKey(rs)) diff --git a/PROMS/VEPROMS.CSLA.Library/Format/ENums.cs b/PROMS/VEPROMS.CSLA.Library/Format/ENums.cs index 0cc16b76..a919e03c 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/ENums.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/ENums.cs @@ -227,7 +227,8 @@ namespace VEPROMS.CSLA.Library Partials = 0x10000, // Do replace even on partial matches Plackeep = 0x20000, // Do replace in PlaceKeepers InSecTitle = 0x40000, - BeforeTrans = 0x80000 // Only do replace if the string occurs immediately before a transition. + BeforeTrans = 0x80000, // Only do replace if the string occurs immediately before a transition. + BeforeList = 0x100000 // C2021-045 Only if the text ends with a colon ":" } public enum E_ArrowKeys : uint {