Added logic to ReplaceWord logic so that if the ReplaceWord inserts a hard return the hard return will not be added at the beginning of a step. The includes RTF formatting of underline and bold and also an asterisk at the beginning of a step.
This commit is contained in:
parent
f675e6c866
commit
1a3ef465bf
@ -1836,6 +1836,12 @@ namespace Volian.Controls.Library
|
||||
while (index < Count - 1 && Values[index + 1].MyMatch.Index < (myMatch.Index + myMatch.Length))
|
||||
Remove(Values[index + 1].MyMatch.Index);
|
||||
}
|
||||
public bool StartsWith(string text, int index, params string[] examples)
|
||||
{
|
||||
foreach (string str in examples)
|
||||
if (str.Length == index && str == text.Substring(0, str.Length)) return true;
|
||||
return false;
|
||||
}
|
||||
public string ReplaceMatches()
|
||||
{
|
||||
int offset = 0;
|
||||
@ -1849,7 +1855,9 @@ namespace Volian.Controls.Library
|
||||
//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}", "");
|
||||
if (offset == 0 && with.StartsWith(@"{\par}"))
|
||||
if(StartsWith(text,foundMatch.MyMatch.Index,"",@"\ul ",@"\b ",@"* ",@"* \ul ",@"* \b ",@"*",@"*\ul ",@"*\b "))
|
||||
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 "))
|
||||
|
Loading…
x
Reference in New Issue
Block a user