B2019-092 – the “Step with .0” step type caused replace words that are bolded and underlined to lose the space character that was after the word being replaced.

This commit is contained in:
John Jenko 2019-07-02 19:22:45 +00:00
parent 13d3665846
commit 71bf704f60

View File

@ -2301,6 +2301,8 @@ namespace VEPROMS.CSLA.Library
with = with.Replace(@"\b0\", @"\"); with = with.Replace(@"\b0\", @"\");
if (with.EndsWith(@"\b0")) if (with.EndsWith(@"\b0"))
with = with.Replace(@"\b0",""); with = with.Replace(@"\b0","");
if (with.LastIndexOf(@"\") > with.LastIndexOf(" ")) // B2019-092 - make sure there is a space char to terminate remaining rft formatting command
with = with + " ";
} }
bool IsUnderline = (((_Font.Style & E_Style.Underline) == E_Style.Underline) && with.Contains(@"\ul ")); bool IsUnderline = (((_Font.Style & E_Style.Underline) == E_Style.Underline) && with.Contains(@"\ul "));
// handle where replace words replaces a string with 'underline on'string'underline off', for example Point Beach // handle where replace words replaces a string with 'underline on'string'underline off', for example Point Beach
@ -2326,6 +2328,8 @@ namespace VEPROMS.CSLA.Library
with = with.Replace(@"\ulnone\", @"\"); with = with.Replace(@"\ulnone\", @"\");
if (with.EndsWith(@"\ulnone")) if (with.EndsWith(@"\ulnone"))
with = with.Replace(@"\ulnone",""); with = with.Replace(@"\ulnone","");
if (with.LastIndexOf(@"\") > with.LastIndexOf(" ")) // B2019-092 - make sure there is a space char to terminate remaining rft formatting command
with = with + " ";
} }
string preceedingText = text.Substring(0, offset + foundMatch.MyMatch.Index); string preceedingText = text.Substring(0, offset + foundMatch.MyMatch.Index);
int ndxBold = preceedingText.LastIndexOf(@"\b"); int ndxBold = preceedingText.LastIndexOf(@"\b");