Don’t turn off Bold or Underline during Replace Words if entire text is manually Bold and/or Underlined

Fix the RNO continue message so that it does not use a bullet character when building the tab for the continue message
This commit is contained in:
2014-08-22 20:20:06 +00:00
parent 310fb42c3c
commit 580ca5f63c
2 changed files with 15 additions and 0 deletions

View File

@@ -1915,6 +1915,20 @@ namespace Volian.Controls.Library
with = with.Replace(@"\ul ", "");
with = with.Replace(@"\ulnone ", "");
}
string preceedingText = text.Substring(0, offset + foundMatch.MyMatch.Index);
int ndxBold = preceedingText.LastIndexOf(@"\b");
if (ndxBold > -1 && preceedingText[ndxBold + 2] != '0' && with.Contains(@"\b "))
{
with = with.Replace(@"\b ","");
with = with.Replace(@"\b0 ","");
}
int ndxULine = preceedingText.LastIndexOf(@"\ul");
if (ndxULine > -1 && preceedingText[ndxULine + 2] != 'n' && with.Contains(@"\ul "))
{
with = with.Replace(@"\ul ", "");
with = with.Replace(@"\ulnone ", "");
}
text = text.Substring(0, offset + foundMatch.MyMatch.Index) + with + text.Substring(offset + foundMatch.MyMatch.Index + foundMatch.MyMatch.Length);
//offset += foundMatch.MyWord.ReplaceWith.Length - foundMatch.MyMatch.Length;
offset += with.Length - foundMatch.MyMatch.Length;