Changed the logic to remove the return if it occurs at the beginning of the text, rather not not replacing the word.

This commit is contained in:
Rich 2014-02-12 19:07:39 +00:00
parent b904c19005
commit cdc4dcd66d

View File

@ -1815,9 +1815,10 @@ namespace Volian.Controls.Library
{
if (VerifyNoHardSpace(text, foundMatch, offset))
{
if(offset != 0 || foundMatch.MyMatch.Index != 0 || !foundMatch.MyWord.ReplaceWith.StartsWith("{\\par}"))
{
//if(offset != 0 || foundMatch.MyMatch.Index != 0 || !foundMatch.MyWord.ReplaceWith.StartsWith(@"{\par}"))
//{
string with = foundMatch.MyWord.ReplaceWith;
if (offset == 0 && foundMatch.MyMatch.Index == 0 && with.StartsWith(@"{\par}")) with = with.Replace(@"{\par}", "");
bool IsBold = ((_Font.Style & E_Style.Bold) == E_Style.Bold) ||
(_MyItemInfo.FormatStepData != null && _MyItemInfo.FormatStepData.BoldHighLevel && _MyItemInfo.IsRNOPart && _MyItemInfo.MyParent.IsHigh );
if (IsBold && with.Contains(@"\b "))
@ -1833,7 +1834,7 @@ namespace Volian.Controls.Library
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;
}
//}
}
}
}