Bug 1354809 - Fix crash in nsMsgGroupView::LoadMessageByViewIndex(), take 2. r=jorgk

This commit is contained in:
alta88 2017-09-22 07:04:00 +02:00
Родитель 94eda70d97
Коммит b8f412a8e5
2 изменённых файлов: 3 добавлений и 21 удалений

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

@ -1030,6 +1030,9 @@ nsMsgGroupView::CellTextForColumn(int32_t aRow,
NS_IMETHODIMP
nsMsgGroupView::LoadMessageByViewIndex(nsMsgViewIndex aViewIndex)
{
if (!IsValidIndex(aViewIndex))
return NS_MSG_INVALID_DBVIEW_INDEX;
if (m_flags[aViewIndex] & MSG_VIEW_FLAG_DUMMY)
{
// If we used to have one item selected, and now we have more than one,
@ -1085,22 +1088,6 @@ nsMsgGroupView::FindLevelInThread(nsIMsgDBHdr *msgHdr,
return (startOfThread == viewIndex) ? 0 : 1;
}
nsMsgViewIndex
nsMsgGroupView::ThreadIndexOfMsg(nsMsgKey msgKey,
nsMsgViewIndex msgIndex /* = nsMsgViewIndex_None */,
int32_t *pThreadCount /* = NULL */,
uint32_t *pFlags /* = NULL */)
{
if (msgIndex != nsMsgViewIndex_None && GroupViewUsesDummyRow())
{
// This case is all we care about at this point.
if (m_flags[msgIndex] & MSG_VIEW_FLAG_ISTHREAD)
return msgIndex;
}
return nsMsgDBView::ThreadIndexOfMsg(msgKey, msgIndex, pThreadCount, pFlags);
}
bool
nsMsgGroupView::GroupViewUsesDummyRow()
{

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

@ -52,10 +52,6 @@ protected:
nsresult GetAgeBucketValue(nsIMsgDBHdr *aMsgHdr, uint32_t * aAgeBucket, bool rcvDate = false); // helper function to get the age bucket for a hdr, useful when grouped by date
nsresult OnNewHeader(nsIMsgDBHdr *newHdr, nsMsgKey aParentKey, bool /*ensureListed*/) override;
virtual int32_t FindLevelInThread(nsIMsgDBHdr *msgHdr, nsMsgViewIndex startOfThread, nsMsgViewIndex viewIndex) override;
nsMsgViewIndex ThreadIndexOfMsg(nsMsgKey msgKey,
nsMsgViewIndex msgIndex = nsMsgViewIndex_None,
int32_t *pThreadCount = NULL,
uint32_t *pFlags = NULL) override;
// Returns true if we are grouped by a sort attribute that uses a dummy row.
bool GroupViewUsesDummyRow();
@ -76,4 +72,3 @@ private:
};
#endif