зеркало из https://github.com/mozilla/gecko-dev.git
part of fix for 122693 display problems when deleting messages in threaded view r/sr=sspitzer, a=sspitzer
This commit is contained in:
Родитель
0e038caab6
Коммит
a03b928bbe
|
@ -571,6 +571,35 @@ nsresult nsMsgThreadedDBView::OnNewHeader(nsMsgKey newKey, nsMsgKey aParentKey,
|
|||
return rv;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsMsgThreadedDBView::OnParentChanged (nsMsgKey aKeyChanged, nsMsgKey oldParent, nsMsgKey newParent, nsIDBChangeListener *aInstigator)
|
||||
{
|
||||
// we need to adjust the level of the hdr whose parent changed, and invalidate that row,
|
||||
// iff we're in threaded mode.
|
||||
if (m_viewFlags & nsMsgViewFlagsType::kThreadedDisplay)
|
||||
{
|
||||
nsMsgViewIndex parentIndex = FindViewIndex(newParent);
|
||||
if (parentIndex != nsMsgViewIndex_None)
|
||||
{
|
||||
nsMsgViewIndex childIndex = FindViewIndex(aKeyChanged);
|
||||
if (childIndex != nsMsgViewIndex_None)
|
||||
{
|
||||
PRInt32 levelChanged = m_levels[childIndex];
|
||||
m_levels[childIndex] = m_levels[parentIndex] + 1;
|
||||
for (nsMsgViewIndex viewIndex = childIndex + 1; viewIndex < GetSize() && m_levels[viewIndex] > levelChanged; viewIndex++)
|
||||
{
|
||||
m_levels[viewIndex] = m_levels[viewIndex] - 1;
|
||||
NoteChange(viewIndex, 1, nsMsgViewNotificationCode::changed);
|
||||
}
|
||||
NoteChange(childIndex, 1, nsMsgViewNotificationCode::changed);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
nsMsgViewIndex nsMsgThreadedDBView::GetInsertInfoForNewHdr(nsIMsgDBHdr *newHdr, nsMsgViewIndex parentIndex, PRInt32 targetLevel)
|
||||
{
|
||||
PRInt32 viewSize = GetSize();
|
||||
|
|
|
@ -57,6 +57,8 @@ public:
|
|||
NS_IMETHOD GetViewType(nsMsgViewTypeValue *aViewType);
|
||||
NS_IMETHOD GetSupportsThreading(PRBool *aResult);
|
||||
|
||||
NS_IMETHOD OnParentChanged (nsMsgKey aKeyChanged, nsMsgKey oldParent, nsMsgKey newParent, nsIDBChangeListener *aInstigator);
|
||||
|
||||
protected:
|
||||
virtual const char * GetViewName(void) {return "ThreadedDBView"; }
|
||||
nsresult InitThreadedView(PRInt32 *pCount);
|
||||
|
|
|
@ -578,10 +578,8 @@ nsresult nsMsgThread::ReparentChildrenOf(nsMsgKey oldParent, nsMsgKey newParent,
|
|||
|
||||
curHdr->SetThreadParent(newParent);
|
||||
curHdr->GetMessageKey(&curKey);
|
||||
#ifdef NEEDED // I don't think we care anymore
|
||||
if (announcer)
|
||||
announcer->NotifyParentChangedAll(curKey, oldParent, newParent, nsnull);
|
||||
#endif
|
||||
// if the old parent was the root of the thread, then only the first child gets
|
||||
// promoted to root, and other children become children of the new root.
|
||||
if (newParent == nsMsgKey_None)
|
||||
|
|
Загрузка…
Ссылка в новой задаче