From 58e659e1e934e5ef91f6154ca5f6a3dd0f78d019 Mon Sep 17 00:00:00 2001 From: "naving%netscape.com" Date: Mon, 24 Jun 2002 20:29:55 +0000 Subject: [PATCH] 139485 r=cavin sr=bienvenu a=valeski fixing certain cases where returning to folder view after doing quick search won't refresh scrollbar. git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_0_BRANCH@123938 18797224-902f-48f8-a5cc-f745e15eee43 --- .../mailnews/base/src/nsMsgThreadedDBView.cpp | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/mozilla/mailnews/base/src/nsMsgThreadedDBView.cpp b/mozilla/mailnews/base/src/nsMsgThreadedDBView.cpp index 697cfc400a3..a71f81d909b 100644 --- a/mozilla/mailnews/base/src/nsMsgThreadedDBView.cpp +++ b/mozilla/mailnews/base/src/nsMsgThreadedDBView.cpp @@ -108,36 +108,36 @@ NS_IMETHODIMP nsMsgThreadedDBView::ReloadFolderAfterQuickSearch() nsMsgKeyArray preservedSelection; SaveAndClearSelection(&preservedSelection); + // restore saved id array and flags array + // first, remove all the search hits + PRInt32 oldSize = GetSize(); + m_keys.RemoveAll(); + m_flags.RemoveAll(); + m_levels.RemoveAll(); + + // this needs to happen after we remove all the keys, since RowCountChanged() will call our GetRowCount() + if (mTree) + mTree->RowCountChanged(0, -oldSize); + if (m_preSearchKeys.GetSize()) { - // restore saved id array and flags array - // first, remove all the search hits - PRInt32 oldSize = GetSize(); - m_keys.RemoveAll(); - m_flags.RemoveAll(); - m_levels.RemoveAll(); - - // this needs to happen after we remove all the keys, since RowCountChanged() will call our GetRowCount() - if (mTree) - mTree->RowCountChanged(0, -oldSize); - m_keys.InsertAt(0, &m_preSearchKeys); m_flags.InsertAt(0, &m_preSearchFlags); m_levels.InsertAt(0, &m_preSearchLevels); ClearPreSearchInfo(); ClearPrevIdArray(); // previous cached info about non threaded display is not useful Sort(m_sortType, m_sortOrder); - - // now, account for adding all the pre search items back. - // this needs to happen after we add back the keys, as RowCountChanged() will call our GetRowCount() - if (mTree) - mTree->RowCountChanged(0, GetSize()); } else { rv = InitThreadedView(nsnull); } + // now, account for adding all the pre search items back. + // this needs to happen after we add back the keys, as RowCountChanged() will call our GetRowCount() + if (mTree) + mTree->RowCountChanged(0, GetSize()); + RestoreSelection(&preservedSelection); return rv;