From b02818304f52630c230130ec7e61f6cfa0fa5e68 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Thu, 8 Feb 2001 22:43:29 +0000 Subject: [PATCH] more hacking with the anipals. NOT PART OF THE BUILD. --- mailnews/base/src/nsMsgDBView.cpp | 22 ++++++++++++++++++---- mailnews/base/src/nsMsgDBView.h | 2 ++ mailnews/base/src/nsMsgThreadedDBView.cpp | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/mailnews/base/src/nsMsgDBView.cpp b/mailnews/base/src/nsMsgDBView.cpp index 15ae0123918a..133f89db7071 100644 --- a/mailnews/base/src/nsMsgDBView.cpp +++ b/mailnews/base/src/nsMsgDBView.cpp @@ -64,8 +64,22 @@ NS_IMETHODIMP nsMsgDBView::AddKeys(nsMsgKey *pKeys, PRInt32 *pFlags, const char return NS_ERROR_NOT_IMPLEMENTED; } +nsresult nsMsgDBView::ReverseThreads() +{ + printf("XXX same sort type, just different sort order. just reverse threads\n"); + return NS_OK; +} + +nsresult nsMsgDBView::ReverseSort() +{ + printf("XXX same sort type (but not threaded), just different sort order. just reverse it\n"); + return NS_OK; +} + NS_IMETHODIMP nsMsgDBView::Sort(nsMsgViewSortTypeValue sortType, nsMsgViewSortOrderValue sortOrder) { + nsresult rv; + printf("XXX nsMsgDBView::Sort(%d,%d)\n",(int)sortType,(int)sortOrder); if (m_sortType == sortType && m_sortValid) { if (m_sortOrder == sortOrder) { @@ -74,12 +88,12 @@ NS_IMETHODIMP nsMsgDBView::Sort(nsMsgViewSortTypeValue sortType, nsMsgViewSortOr } else { if (m_sortType != nsMsgViewSortType::byThread) { - printf("XXX same sort type (but not threaded), just different sort order. just reverse it\n"); - //ReverseSort(); + rv = ReverseSort(); + NS_ENSURE_SUCCESS(rv,rv); } else { - printf("XXX same sort type, just different sort order. just reverse threads\n"); - //ReverseThreads(); + rv = ReverseThreads(); + NS_ENSURE_SUCCESS(rv,rv); } m_sortType = sortType; diff --git a/mailnews/base/src/nsMsgDBView.h b/mailnews/base/src/nsMsgDBView.h index 9a3696313baf..fead06fd9ab4 100644 --- a/mailnews/base/src/nsMsgDBView.h +++ b/mailnews/base/src/nsMsgDBView.h @@ -43,6 +43,8 @@ public: protected: nsresult ExpandByIndex(nsMsgViewIndex index, PRUint32 *pNumExpanded); nsresult ExpandAll(); + nsresult ReverseSort(); + nsresult ReverseThreads(); PRInt32 GetSize(void) {return(m_keys.GetSize());} diff --git a/mailnews/base/src/nsMsgThreadedDBView.cpp b/mailnews/base/src/nsMsgThreadedDBView.cpp index d76d5836ac12..cd02eb274950 100644 --- a/mailnews/base/src/nsMsgThreadedDBView.cpp +++ b/mailnews/base/src/nsMsgThreadedDBView.cpp @@ -232,9 +232,9 @@ nsresult nsMsgThreadedDBView::ExpandAll() // go through expanding in place for (PRUint32 i = 0; i < m_keys.GetSize(); i++) { +#ifdef HAVE_BRANCH_YET PRUint32 numExpanded; PRUint32 flags = m_flags[i]; -#ifdef HAVE_BRANCH_YET if (flags & kHasChildren && (flags & MSG_FLAG_ELIDED)) { rv = ExpandByIndex(i, &numExpanded);