B2025-011-Global-search-is-not-finding-question-marks #514

Merged
jjenko merged 2 commits from B2025-011-Global-search-is-not-finding-question-marks into Development 2025-02-11 09:07:13 -05:00

View File

@ -1699,6 +1699,8 @@ namespace Volian.Controls.Library
else lbSrchResultsIncTrans.DisplayMember = _DisplayMember; else lbSrchResultsIncTrans.DisplayMember = _DisplayMember;
if (_SearchResults != null) if (_SearchResults != null)
{ {
// record count flag
bool reccnt = true;
// B2021-076: Proms search results are not presented in order when printed to PDF // B2021-076: Proms search results are not presented in order when printed to PDF
// B2023-041 - backed out previous change as it was not needed and was preventing the sorting of search results text // B2023-041 - backed out previous change as it was not needed and was preventing the sorting of search results text
if (cbSorted.Checked) if (cbSorted.Checked)
@ -1713,11 +1715,37 @@ namespace Volian.Controls.Library
// B2021-076: Proms search results are not presented in order when printed to PDF // B2021-076: Proms search results are not presented in order when printed to PDF
var sortedResults = _SearchResults.OrderBy(x => x.SearchDefaultSort).ToList(); var sortedResults = _SearchResults.OrderBy(x => x.SearchDefaultSort).ToList();
// if searching for just a "?" remove all the special code matches and leaving only the true matches.
if (SearchString == "\\?")
{
string pat = @"\?";
Regex r = new Regex(pat, RegexOptions.IgnoreCase);
for (int i = 0; i < sortedResults.Count; i++)
{
Match m = r.Match(sortedResults[i].DisplayText);
if (m.Success)
{
continue;
}
else
{
sortedResults.Remove(sortedResults[i]);
i--;
}
}
grpPanSearchResults.Text = string.Format("Search Results Found: {0}", sortedResults.Count);
reccnt = false;
}
if (tabSearchTypes.SelectedTab != tabSearchTypes.Tabs[4]) lbSrchResults.DataSource = sortedResults; if (tabSearchTypes.SelectedTab != tabSearchTypes.Tabs[4]) lbSrchResults.DataSource = sortedResults;
else lbSrchResultsIncTrans.DataSource = sortedResults; else lbSrchResultsIncTrans.DataSource = sortedResults;
} }
if (reccnt)
grpPanSearchResults.Text = string.Format("Search Results Found: {0}", _SearchResults.Count); {
grpPanSearchResults.Text = string.Format("Search Results Found: {0}", _SearchResults.Count);
}
grpPanSearchResults.Style.BackColor = Color.LightGreen;// Color.YellowGreen; Color.DarkSeaGreen; grpPanSearchResults.Style.BackColor = Color.LightGreen;// Color.YellowGreen; Color.DarkSeaGreen;
} }
else else
@ -2076,6 +2104,7 @@ namespace Volian.Controls.Library
//TypesSelected = (typstr != null) ? "Searched Step Types: " + typstr : "Searched All Step Types"; //TypesSelected = (typstr != null) ? "Searched Step Types: " + typstr : "Searched All Step Types";
//TypesSelected = "Searched Step Types: " + ((typstr != null) ? typstr : "All Step Types"); //TypesSelected = "Searched Step Types: " + ((typstr != null) ? typstr : "All Step Types");
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, TextSearchString /*.Replace(@"\",@"\u9586?")*/, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxIncROTextSrch.Checked ? ItemSearchIncludeLinks.Value : ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix, byWordPrefix, byWordSuffix); SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, TextSearchString /*.Replace(@"\",@"\u9586?")*/, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxIncROTextSrch.Checked ? ItemSearchIncludeLinks.Value : ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix, byWordPrefix, byWordSuffix);
cmbResultsStyleIndex = 3; // display step text in results cmbResultsStyleIndex = 3; // display step text in results
//} //}
} }