[commit] r2753 - trunk/GME/Search

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Mon Jul 9 13:55:32 CDT 2018


Author: ksmyth
Date: Mon Jul  9 13:55:32 2018
New Revision: 2753

Log:
Search: fix crash on searching for referred object after its project was closed

Modified:
   trunk/GME/Search/SearchCtl.cpp
   trunk/GME/Search/SearchDlg.cpp
   trunk/GME/Search/SearchDlg.h

Modified: trunk/GME/Search/SearchCtl.cpp
==============================================================================
--- trunk/GME/Search/SearchCtl.cpp	Mon Jul  9 13:55:29 2018	(r2752)
+++ trunk/GME/Search/SearchCtl.cpp	Mon Jul  9 13:55:32 2018	(r2753)
@@ -306,7 +306,7 @@
 {
 	if(m_project != NULL)
 	{
-		m_searchDlg.RemoveAll();
+		m_searchDlg.MgaProjectSet();
 		if(m_territory != NULL)
 		{
 			COMTHROW(m_territory->Destroy() );

Modified: trunk/GME/Search/SearchDlg.cpp
==============================================================================
--- trunk/GME/Search/SearchDlg.cpp	Mon Jul  9 13:55:29 2018	(r2752)
+++ trunk/GME/Search/SearchDlg.cpp	Mon Jul  9 13:55:32 2018	(r2753)
@@ -772,7 +772,7 @@
     CString strFirstElement=m_treeSearchHistory.GetItemText(m_treeSearchHistory.GetRootItem());
     //insert an dummy item to the tree once the processing of search text is complete
     //it will be renamed to appropriate one
-    HTREEITEM hItem=m_treeSearchHistory.InsertItem(_T("Dummy"),NULL,TVI_FIRST);
+    HTREEITEM hItem=m_treeSearchHistory.InsertItem(_T("Dummy"),TVI_ROOT,TVI_FIRST);
 
     CString strSearch;
 
@@ -870,7 +870,7 @@
 
     strSearch.Append(strNameValue);
 
-    m_treeSearchHistory.InsertItem(strNameValue,hParent,NULL);
+    m_treeSearchHistory.InsertItem(strNameValue,hParent,TVI_LAST);
 }
 
 void CSearchDlg::PrepareHistoryString(const CString &strCriteriaName,int & strSearchValue,HTREEITEM hParent,CString &strSearch)
@@ -895,7 +895,7 @@
 
     CString readValue;
 
-    HTREEITEM hItem=m_treeSearchHistory.InsertItem(_T("Dummy"),NULL,TVI_LAST);
+    HTREEITEM hItem=m_treeSearchHistory.InsertItem(_T("Dummy"),TVI_ROOT,TVI_LAST);
     HTREEITEM hFirstCriteria=m_treeSearchHistory.InsertItem(_T("First Search Criteria"),hItem,TVI_FIRST);
     HTREEITEM hSecondCriteria=m_treeSearchHistory.InsertItem(_T("Second Search Criteria"),hItem,TVI_LAST);
     HTREEITEM hOtherCriteria=m_treeSearchHistory.InsertItem(_T("Other"),hItem,TVI_LAST);

Modified: trunk/GME/Search/SearchDlg.h
==============================================================================
--- trunk/GME/Search/SearchDlg.h	Mon Jul  9 13:55:29 2018	(r2752)
+++ trunk/GME/Search/SearchDlg.h	Mon Jul  9 13:55:32 2018	(r2753)
@@ -114,6 +114,13 @@
 
 //  These functions should be implemented to work with CSearchCtl
 	void RemoveAll();						// must remove all search result
+	void MgaProjectSet() {
+		RemoveAll();
+		specialSearchFCO = NULL;
+		m_chkRefCtrl.SetCheck(BST_UNCHECKED);
+		m_chkRef = false;
+		m_stcRefCtrl.SetWindowText(_T("NULL References"));
+	}
 	void RemoveZombies();					// must remove results belong to zombie objects
 	void EnableSearch();					// enable search functions
 	void DisableSearch();					// must disable search functions


More information about the gme-commit mailing list