bug 466925 M shortcut for mark as unread doesn't work in stand alone message window, r=bienvenu
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Fri, 19 Dec 2008 11:30:13 -0800
changeset 1461 b145e4360b313bc96ac602e803168c45a82dce8b
parent 1460 439529319157aa57a99aada5e6296b2023f2666a
child 1462 e10a3baac8d7d6c7ce987e315134a9047d0de4f1
push idunknown
push userunknown
push dateunknown
reviewersbienvenu
bugs466925
bug 466925 M shortcut for mark as unread doesn't work in stand alone message window, r=bienvenu
mailnews/base/src/nsMsgDBView.cpp
--- a/mailnews/base/src/nsMsgDBView.cpp
+++ b/mailnews/base/src/nsMsgDBView.cpp
@@ -4379,17 +4379,16 @@ nsresult nsMsgDBView::ExpandByIndex(nsMs
   PRUint32      numExpanded = 0;
 
   NS_ASSERTION(flags & MSG_FLAG_ELIDED, "can't expand an already expanded thread");
   flags &= ~MSG_FLAG_ELIDED;
 
   if ((PRUint32) index > m_keys.Length())
     return NS_MSG_MESSAGE_NOT_FOUND;
 
-  nsMsgKey firstIdInThread = m_keys[index];
   nsCOMPtr <nsIMsgDBHdr> msgHdr;
   nsCOMPtr <nsIMsgThread> pThread;
   nsresult rv = GetThreadContainingIndex(index, getter_AddRefs(pThread));
   NS_ENSURE_SUCCESS(rv, rv);
   m_flags[index] = flags;
   NoteChange(index, 1, nsMsgViewNotificationCode::changed);
   if (m_viewFlags & nsMsgViewFlagsType::kUnreadOnly)
   {
@@ -6300,17 +6299,18 @@ NS_IMETHODIMP nsMsgDBView::GetViewFolder
 
 NS_IMETHODIMP
 nsMsgDBView::GetNumSelected(PRUint32 *numSelected)
 {
   NS_ENSURE_ARG_POINTER(numSelected);
 
   if (!mTreeSelection)
   {
-    *numSelected = 0;
+    // No tree selection can mean we're in the stand alone mode.
+    *numSelected = (m_currentlyDisplayedMsgKey != nsMsgKey_None) ? 1 : 0;
     return NS_OK;
   }
 
   // We call this a lot from the front end JS, so make it fast.
   return mTreeSelection->GetCount((PRInt32*)numSelected);
 }
 
 NS_IMETHODIMP