B2019-171: Use format flag to handle differences between formats for uppercasing of ROs

B2019-171: Add flag to handle differences between formats for uppercasing of ROs
This commit is contained in:
Kathy Ruffing 2019-11-13 14:36:01 +00:00
parent 4034ca8c18
commit 443162a944
2 changed files with 31 additions and 4 deletions

View File

@ -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);
}

View File

@ -6830,6 +6830,14 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _CapFirstLetterInHighRO, "@CapFirstLetterInHighRO");
}
}
private LazyLoad<bool> _DoSpaceDashBeforeROResolve;
public bool DoSpaceDashBeforeROResolve
{
get
{
return LazyLoad(ref _DoSpaceDashBeforeROResolve, "@DoSpaceDashBeforeROResolve");
}
}
}
#endregion
#endregion