Bug 367154 ��� Thunderbird crashed [@ nsXULTreeAccessibleWrap::GetChildCount] when I mouse clicked on the trash folder in the folders tree table

patch by Evan.Yan at sun.com r=aaronleventhal
This commit is contained in:
ginn.chen%sun.com 2007-01-23 08:27:16 +00:00
parent 4ac08e1223
commit 500c27efc8
2 changed files with 13 additions and 11 deletions

View File

@ -64,14 +64,15 @@ NS_IMETHODIMP nsXULTreeAccessibleWrap::GetChildCount(PRInt32 *aAccChildCount)
// by going through DOM structure of XUL tree
nsAccessible::GetChildCount(aAccChildCount);
// add the count of table cell (or tree item) accessibles, which are
// created and appended by XUL tree accessible implementation
PRInt32 rowCount, colCount = 1;
mTreeView->GetRowCount(&rowCount);
mFirstChild->GetChildCount(&colCount);
*aAccChildCount += rowCount * colCount;
if (*aAccChildCount != eChildCountUninitialized) {
// add the count of table cell (or tree item) accessibles, which are
// created and appended by XUL tree accessible implementation
PRInt32 rowCount, colCount = 1;
mTreeView->GetRowCount(&rowCount);
mFirstChild->GetChildCount(&colCount);
*aAccChildCount += rowCount * colCount;
}
return NS_OK;
}

View File

@ -286,10 +286,11 @@ NS_IMETHODIMP nsXULTreeAccessible::GetChildCount(PRInt32 *aAccChildCount)
nsAccessible::GetChildCount(aAccChildCount);
PRInt32 rowCount;
mTreeView->GetRowCount(&rowCount);
*aAccChildCount += rowCount;
if (*aAccChildCount != eChildCountUninitialized) {
PRInt32 rowCount;
mTreeView->GetRowCount(&rowCount);
*aAccChildCount += rowCount;
}
return NS_OK;
}