|
|
@@ -11,8 +11,8 @@
|
|
|
|
|
|
#define RANGE_START 3000
|
|
|
#define CLEAR_LIST 3050
|
|
|
-#define LIST_MAX_COUNT 50
|
|
|
-#define MAX_SAVED_SEARCH_LENGTH 1000
|
|
|
+#define LIST_MAX_COUNT 10
|
|
|
+#define MAX_SAVED_SEARCH_LENGTH 50
|
|
|
|
|
|
IMPLEMENT_DYNAMIC(CSymbolEdit, CEdit)
|
|
|
|
|
|
@@ -229,17 +229,28 @@ void CSymbolEdit::LoadPastSearches(CString values)
|
|
|
{
|
|
|
TiXmlElement *ItemElement = ItemHeader->FirstChildElement();
|
|
|
|
|
|
+ int count = 0;
|
|
|
+
|
|
|
while (ItemElement)
|
|
|
{
|
|
|
- CString item = ItemElement->Attribute("text");
|
|
|
+ if (count < LIST_MAX_COUNT)
|
|
|
+ {
|
|
|
+ CString item = ItemElement->Attribute("text");
|
|
|
|
|
|
- CString toAdd = item.Left(MAX_SAVED_SEARCH_LENGTH);
|
|
|
- if (toAdd != _T(""))
|
|
|
+ CString toAdd = item.Left(MAX_SAVED_SEARCH_LENGTH);
|
|
|
+ if (toAdd != _T(""))
|
|
|
+ {
|
|
|
+ m_searches.Add(toAdd);
|
|
|
+ }
|
|
|
+
|
|
|
+ ItemElement = ItemElement->NextSiblingElement();
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- m_searches.Add(toAdd);
|
|
|
+ break;
|
|
|
}
|
|
|
|
|
|
- ItemElement = ItemElement->NextSiblingElement();
|
|
|
+ count++;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -250,7 +261,7 @@ void CSymbolEdit::AddToSearchHistory()
|
|
|
this->GetWindowText(cs);
|
|
|
if (cs != _T(""))
|
|
|
{
|
|
|
- //only save up to 1000, had reports of somehow getting extremely large amounts of junk text
|
|
|
+ //only save up to 50, had reports of somehow getting extremely large amounts of junk text
|
|
|
//save and causing memory issues.
|
|
|
cs = cs.Left(MAX_SAVED_SEARCH_LENGTH);
|
|
|
|