171965 r=cavin sr=mscott fixing threadpane not getting invalidated after changing sort order (ascending/descending) in quick search view

This commit is contained in:
naving%netscape.com 2002-10-01 21:45:40 +00:00
parent 9702292275
commit b173983045
2 changed files with 12 additions and 5 deletions

View File

@ -146,13 +146,8 @@ nsMsgQuickSearchDBView::OnSearchDone(nsresult status)
{
if (m_sortType != nsMsgViewSortType::byThread)//we do not find levels for the results.
{
nsMsgKeyArray preservedSelection;
SaveAndClearSelection(&preservedSelection);
m_sortValid = PR_FALSE; //sort the results
Sort(m_sortType, m_sortOrder);
RestoreSelection(&preservedSelection);
if (mTree)
mTree->Invalidate();
}
return NS_OK;
}
@ -174,3 +169,14 @@ nsMsgQuickSearchDBView::OnNewSearch()
return NS_OK;
}
NS_IMETHODIMP
nsMsgQuickSearchDBView::Sort(nsMsgViewSortTypeValue sortType, nsMsgViewSortOrderValue sortOrder)
{
nsMsgKeyArray preservedSelection;
SaveAndClearSelection(&preservedSelection);
nsMsgDBView::Sort(sortType, sortOrder);
RestoreSelection(&preservedSelection);
if (mTree)
mTree->Invalidate();
return NS_OK;
}

View File

@ -57,6 +57,7 @@ public:
NS_IMETHOD GetViewType(nsMsgViewTypeValue *aViewType);
NS_IMETHOD SetSearchSession(nsIMsgSearchSession *aSearchSession);
NS_IMETHOD GetSearchSession(nsIMsgSearchSession* *aSearchSession);
NS_IMETHOD Sort(nsMsgViewSortTypeValue sortType, nsMsgViewSortOrderValue sortOrder);
protected:
nsWeakPtr m_searchSession;