B2022-015: BNPP - Added an ‘NotInRO flag’ for replace words to determine whether RO text should have Replace Words applied
This commit is contained in:
parent
6808579c38
commit
1e217c71ec
@ -304,7 +304,8 @@ namespace VEPROMS.CSLA.Library
|
||||
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 ":"
|
||||
PageList = 0x200000, // F2021-053 Do replace words for PageList items that are ROs
|
||||
FirstWord = 0x400000 // C2021-056 Do only if is the first word in the text
|
||||
FirstWord = 0x400000, // C2021-056 Do only if is the first word in the text
|
||||
NotInRO = 0x800000 // B2022-015 BNPPalr: Determine whether RO text should have Replace Words applied
|
||||
}
|
||||
[Serializable]
|
||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||
|
@ -2443,7 +2443,10 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
if (foundMatch.MyWord != null)
|
||||
{
|
||||
if (VerifyNoHardSpace(text, foundMatch, offset) && VerifyNoLink(text, foundMatch, offset))
|
||||
// B2022-015 BNPPalr: Determine whether RO text should have Replace Words applied. InLinkAndNotInRoFlag checks
|
||||
// for flag on replace word item & checks that it is within and RO link
|
||||
bool InLinkAndNotInRoFlag = ((foundMatch.MyWord.Flag & FormatConfig.E_ReplaceFlagsUCF.NotInRO) != 0) ? VerifyWithinLink(text, foundMatch, offset) : false;
|
||||
if (!InLinkAndNotInRoFlag && VerifyNoHardSpace(text, foundMatch, offset) && VerifyNoLink(text, foundMatch, offset))
|
||||
{
|
||||
//if(offset != 0 || foundMatch.MyMatch.Index != 0 || !foundMatch.MyWord.ReplaceWith.StartsWith(@"{\par}"))
|
||||
//{
|
||||
@ -2534,6 +2537,20 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
return text;
|
||||
}
|
||||
// B2022-015 BNPPalr: Determine whether RO text should have Replace Words applied
|
||||
private bool VerifyWithinLink(string text, FoundMatch foundMatch, int offset)
|
||||
{
|
||||
// Is Match within a link, i.e. between a start & end and has '#Link:R' (defined referenced object link) between them too
|
||||
int sindx = text.LastIndexOf("<START]", foundMatch.MyMatch.Index);
|
||||
if (sindx > -1)
|
||||
{
|
||||
int eindx = text.IndexOf("[END>",sindx + 1);
|
||||
bool isRo = eindx > sindx && text.Substring(sindx, eindx - sindx - 1).Contains("#Link:R");
|
||||
if (isRo && foundMatch.MyMatch.Index > sindx && foundMatch.MyMatch.Index < eindx) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool VerifyNoLink(string text, FoundMatch fndMatch, int offset)
|
||||
{
|
||||
if (text.Substring(offset + fndMatch.MyMatch.Index, fndMatch.MyMatch.Length) == "START")
|
||||
|
@ -230,7 +230,8 @@ namespace VEPROMS.CSLA.Library
|
||||
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 ":"
|
||||
PageList = 0x200000, // F2021-053: Do replace words in page list
|
||||
FirstWord = 0x400000 // C2021-056 Do only if is the first word in the text
|
||||
FirstWord = 0x400000, // C2021-056 Do only if is the first word in the text
|
||||
NotInRO = 0x800000 // B2022-015 BNPPalr: Determine whether RO text should have Replace Words applied
|
||||
}
|
||||
public enum E_ArrowKeys : uint
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user