fix undo of delete of top level msg in thread r=cavin, antonio.xu@sun, sr=sspitzer, a=asa 157503

This commit is contained in:
bienvenu%netscape.com 2002-07-18 14:48:38 +00:00
Родитель 630f2faae4
Коммит 7ce37799cd
1 изменённых файлов: 9 добавлений и 5 удалений

Просмотреть файл

@ -613,10 +613,8 @@ nsresult nsMsgThreadedDBView::OnNewHeader(nsMsgKey newKey, nsMsgKey aParentKey,
// removing it, installing this header as king, and expanding it.
if (level == 0)
{
CollapseByIndex(threadIndex, nsnull);
// call base class, so child won't get promoted.
nsMsgDBView::RemoveByIndex(threadIndex);
newFlags |= MSG_VIEW_FLAG_ISTHREAD | MSG_VIEW_FLAG_HASCHILDREN | MSG_FLAG_ELIDED;
newFlags |= MSG_VIEW_FLAG_ISTHREAD | MSG_VIEW_FLAG_HASCHILDREN;
insertIndex = threadIndex;
}
m_keys.InsertAt(insertIndex, newKey);
m_flags.InsertAt(insertIndex, newFlags, 1);
@ -625,10 +623,16 @@ nsresult nsMsgThreadedDBView::OnNewHeader(nsMsgKey newKey, nsMsgKey aParentKey,
// the call to NoteChange() has to happen after we add the key
// as NoteChange() will call RowCountChanged() which will call our GetRowCount()
NoteChange(insertIndex, 1, nsMsgViewNotificationCode::insertOrDelete);
if (level != 0)
NoteChange(insertIndex, 1, nsMsgViewNotificationCode::insertOrDelete);
if (level == 0)
{
CollapseByIndex(threadIndex, nsnull);
// call base class, so child won't get promoted.
// nsMsgDBView::RemoveByIndex(threadIndex);
ExpandByIndex(threadIndex, nsnull);
}
}
}
else // adding msg to thread that's not in view.