Logic to find when words are bolded or underlined also fixed logic in looking at the next item
This commit is contained in:
parent
017d11debb
commit
f96212221d
@ -175,6 +175,7 @@ namespace Volian.Controls.Library
|
||||
doingfind = false;
|
||||
this.Visible = false;
|
||||
}
|
||||
|
||||
private string FixSymbol(string str)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@ -187,6 +188,22 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
// B2015-131 Break up the find string on the spaces
|
||||
// look for each word in the text string
|
||||
// this is used only to see if the next item should be looked at, the real Find function (i.e MyEditItem.FindText())
|
||||
// will do the actual evaluation
|
||||
private bool ContainsFndStr(string text, string fndStr)
|
||||
{
|
||||
char [] sep ={' '}; // break string up on spaces
|
||||
string [] fndStrAry = fndStr.Split(sep, StringSplitOptions.None);
|
||||
int pos = 0;
|
||||
foreach (string fStr in fndStrAry)
|
||||
{
|
||||
pos = text.IndexOf(fStr, pos);
|
||||
if (pos == -1) break;
|
||||
}
|
||||
return pos != -1;
|
||||
}
|
||||
private void btnFindNext_Click(object sender, EventArgs e)
|
||||
{
|
||||
AddToComboLists();
|
||||
@ -196,7 +213,8 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
ItemInfo next = (cbxReverse.Checked) ? MyEditItem.MyItemInfo.SearchPrev : MyEditItem.MyItemInfo.SearchNext;
|
||||
|
||||
while ((next != null) && !next.IsSection && !RtfTools.RTFConvertedSymbolsToUnicode(next.MyContent.Text).Contains(fndStr))
|
||||
// B2015-131 Find was not finding series of words when one or more of the words were bolded or underlined (ex finding "Any SG" where Any was bolded)
|
||||
while ((next != null) && !next.IsSection && !ContainsFndStr(RtfTools.RTFConvertedSymbolsToUnicode(next.MyContent.Text).ToUpper(), fndStr.ToUpper()))
|
||||
{
|
||||
next = (cbxReverse.Checked) ? next.SearchPrev : next.SearchNext;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user