From 7c08e4152c4863d030572ddd250439bbb86c83e4 Mon Sep 17 00:00:00 2001 From: "bienvenu%nventure.com" Date: Tue, 22 Aug 2006 22:20:59 +0000 Subject: [PATCH] fix 349569, crash closing stand-alone msg window opened from cross-folder saved search, sr=sspitzer, and fix history navigation in standalone message window, sr=mscott, 74959 git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@208116 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/base/src/nsMsgDBView.cpp | 9 +++++++-- mozilla/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp | 2 +- mozilla/mailnews/base/src/nsMsgXFVirtualFolderDBView.h | 1 - 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mozilla/mailnews/base/src/nsMsgDBView.cpp b/mozilla/mailnews/base/src/nsMsgDBView.cpp index 492bc630a3f..eaf9d2acf19 100644 --- a/mozilla/mailnews/base/src/nsMsgDBView.cpp +++ b/mozilla/mailnews/base/src/nsMsgDBView.cpp @@ -5061,9 +5061,12 @@ NS_IMETHODIMP nsMsgDBView::NavigateStatus(nsMsgNavigationTypeValue motion, PRBoo PRBool enable = PR_FALSE; nsresult rv = NS_ERROR_FAILURE; nsMsgKey resultKey = nsMsgKey_None; - PRInt32 index; + PRInt32 index = nsMsgKey_None; nsMsgViewIndex resultIndex = nsMsgViewIndex_None; - rv = mTreeSelection->GetCurrentIndex(&index); + if (mTreeSelection) + (void) mTreeSelection->GetCurrentIndex(&index); + else + index = FindViewIndex(m_currentlyDisplayedMsgKey); // warning - we no longer validate index up front because fe passes in -1 for no // selection, so if you use index, be sure to validate it before using it @@ -5786,6 +5789,8 @@ nsresult nsMsgDBView::CopyDBView(nsMsgDBView *aNewMsgDBView, nsIMessenger *aMess NS_ENSURE_ARG_POINTER(aNewMsgDBView); aNewMsgDBView->mMsgWindow = aMsgWindow; + if (aMsgWindow) + aMsgWindow->SetOpenFolder(m_viewFolder? m_viewFolder : m_folder); aNewMsgDBView->mMessengerInstance = aMessengerInstance; aNewMsgDBView->mCommandUpdater = aCmdUpdater; aNewMsgDBView->m_folder = m_folder; diff --git a/mozilla/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp b/mozilla/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp index 61535b2effa..92b1994a679 100755 --- a/mozilla/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp +++ b/mozilla/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp @@ -118,7 +118,7 @@ nsMsgXFVirtualFolderDBView::CopyDBView(nsMsgDBView *aNewMsgDBView, nsIMessenger newMsgDBView->m_viewFolder = m_viewFolder; newMsgDBView->m_numUnread = m_numUnread; newMsgDBView->m_numTotal = m_numTotal; - + newMsgDBView->m_searchSession = m_searchSession; return NS_OK; } diff --git a/mozilla/mailnews/base/src/nsMsgXFVirtualFolderDBView.h b/mozilla/mailnews/base/src/nsMsgXFVirtualFolderDBView.h index 250c2861dde..f9daee2f127 100755 --- a/mozilla/mailnews/base/src/nsMsgXFVirtualFolderDBView.h +++ b/mozilla/mailnews/base/src/nsMsgXFVirtualFolderDBView.h @@ -73,7 +73,6 @@ public: protected: - nsCOMPtr m_viewFolder; PRUint32 m_cachedFolderArrayIndex; // array index of next folder with cached hits to deal with. nsCOMArray m_foldersWithNonVerifiedCachedHits; nsCOMArray m_hdrHits;