B2019-164: Fix extra space at end of some replaced words

This commit is contained in:
Kathy Ruffing 2019-11-07 13:45:42 +00:00
parent cfb847de9c
commit 7face42b01

View File

@ -2301,8 +2301,10 @@ 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 // Removed the following two lines of code to fix B2019-164. This change was not needed for
with = with + " "; // B2019-092, a format file changed fixed that problem:
//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
@ -2328,8 +2330,10 @@ 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 // Removed the following two lines of code to fix B2019-164. This change was not needed for
with = with + " "; // B2019-092, a format file changed fixed that problem:
//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");