bug 382318 crash [@ nsXULTreeAccessibleWrap::GetColumnAtIndex]r=aaronleventhal

This commit is contained in:
ginn.chen@sun.com 2007-06-06 19:43:45 -07:00
parent 722f5b8433
commit d77d40ed3b
2 changed files with 5 additions and 2 deletions

View File

@ -109,7 +109,8 @@ NS_IMETHODIMP nsXULTreeAccessibleWrap::GetColumns(PRInt32 *aColumns)
rv = nsAccessible::GetFirstChild(getter_AddRefs(acc));
NS_ENSURE_TRUE(acc, NS_ERROR_FAILURE);
return acc->GetChildCount(aColumns);
rv = acc->GetChildCount(aColumns);
return *aColumns > 0 ? rv : NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsXULTreeAccessibleWrap::GetColumnHeader(nsIAccessibleTable **aColumnHeader)
@ -456,7 +457,8 @@ NS_IMETHODIMP nsXULTreeColumnsAccessibleWrap::SetSummary(const nsAString &aSumma
NS_IMETHODIMP nsXULTreeColumnsAccessibleWrap::GetColumns(PRInt32 *aColumns)
{
return GetChildCount(aColumns);
nsresult rv = GetChildCount(aColumns);
return *aColumns > 0 ? rv : NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsXULTreeColumnsAccessibleWrap::GetColumnHeader(nsIAccessibleTable * *aColumnHeader)

View File

@ -963,6 +963,7 @@ NS_IMETHODIMP nsXULTreeitemAccessible::GetAccessibleRelated(PRUint32 aRelationTy
//that's why ATK specific code shows here
*aRelated = nsnull;
#ifdef MOZ_ACCESSIBILITY_ATK
NS_ENSURE_TRUE(mColumn && mTree && mTreeView, NS_ERROR_FAILURE);
if (aRelationType == nsIAccessibleRelation::RELATION_NODE_CHILD_OF) {
PRInt32 columnIndex;
if (NS_SUCCEEDED(mColumn->GetIndex(&columnIndex)) && columnIndex == 0) {