C2021-061 don’t process replace words if they are delimited with “()” or “,’ (quotes from 11/3/21)

This commit is contained in:
Kathy Ruffing 2021-11-16 13:50:28 +00:00
parent d8983d41d6
commit b92bdb3466
4 changed files with 14 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View File

@ -2123,8 +2123,8 @@ namespace VEPROMS.CSLA.Library
string wordMatchEnd = Regex.IsMatch(replaceWord.Substring(replaceWord.Length - 1, 1), @"\W") ? "" : @"(?=\W|$)"; string wordMatchEnd = Regex.IsMatch(replaceWord.Substring(replaceWord.Length - 1, 1), @"\W") ? "" : @"(?=\W|$)";
string pat = wordMatchBeg + @"(?<!\\u160\?|\\u8209\?|\\b|\-)" + replaceWord + @"(?!\\u160\?|\\u8209\?|\-)" + wordMatchEnd; string pat = wordMatchBeg + @"(?<!\\u160\?|\\u8209\?|\\b|\-)" + replaceWord + @"(?!\\u160\?|\\u8209\?|\-)" + wordMatchEnd;
// C2021-061: For Barakah don't do replace if word is surrounded by " or ', i.e. they are no longer delimiters // C2021-061: For Barakah don't do replace if word is surrounded by " or ', i.e. they are no longer delimiters
if (_MyItemInfo != null && _MyItemInfo.ActiveFormat != null && _MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.NoReplaceQuoteWords) if (_MyItemInfo != null && _MyItemInfo.ActiveFormat != null && _MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.NoReplaceQuoteParenWords)
pat = wordMatchBeg + @"(?<!\\u160\?|\\u8209\?|\\b|\-|""|')" + replaceWord + @"(?!\\u160\?|\\u8209\?|\-|""|')" + wordMatchEnd; pat = wordMatchBeg + @"(?<!\\u160\?|\\u8209\?|\\b|\-|""|'|\()" + replaceWord + @"(?!\\u160\?|\\u8209\?|\-|""|'|\))" + wordMatchEnd;
dicReplaceRegex.Add(rs, new Regex(pat, myOptions)); dicReplaceRegex.Add(rs, new Regex(pat, myOptions));
//ProfileTimer.Pop(profileDepth3); //ProfileTimer.Pop(profileDepth3);
} }

View File

@ -1683,6 +1683,14 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _height, "@height"); return LazyLoad(ref _height, "@height");
} }
} }
private LazyLoad<string> _hasAppl;
public string hasAppl
{
get
{
return LazyLoad(ref _hasAppl, "@hasAppl");
}
}
} }
#endregion #endregion
#region SIAll #region SIAll
@ -2443,12 +2451,13 @@ namespace VEPROMS.CSLA.Library
} }
} }
// C2021-061: For Barakah don't do replace if word is surrounded by " or ' // C2021-061: For Barakah don't do replace if word is surrounded by " or '
private LazyLoad<bool> _NoReplaceQuoteWords; // Initial fix was 11/3/21. Added parens do the quotes on 11/16/21
public bool NoReplaceQuoteWords private LazyLoad<bool> _NoReplaceQuoteParenWords;
public bool NoReplaceQuoteParenWords
{ {
get get
{ {
return LazyLoad(ref _NoReplaceQuoteWords, "@NoReplaceQuoteWords"); return LazyLoad(ref _NoReplaceQuoteParenWords, "@NoReplaceQuoteParenWords");
} }
} }
private LazyLoad<bool> _UseMetaSections; private LazyLoad<bool> _UseMetaSections;