Bug 394117. Warnings when accessible relations queryied. r=surkov, a=dsicore

This commit is contained in:
aaronleventhal@moonset.net 2007-08-30 11:51:47 -07:00
parent 1feece21b5
commit e300f42d83
2 changed files with 10 additions and 4 deletions

View File

@ -57,6 +57,9 @@ interface nsIAccessibleRelation : nsISupports
*/
const unsigned long RELATION_CONTROLLED_BY = 0x01;
// First relation
const unsigned long RELATION_FIRST = RELATION_CONTROLLED_BY;
/**
* This object is interactive and controls some attribute of a target object.
*/
@ -135,6 +138,9 @@ interface nsIAccessibleRelation : nsISupports
*/
const unsigned long RELATION_DESCRIPTION_FOR = 0x0f;
// Last relation that is standard to desktop accessibility APIs
const unsigned long RELATION_LAST = RELATION_DESCRIPTION_FOR;
/**
* Part of a form/dialog with a related default button. It is used for
* MSAA only, no for IA2 nor ATK.

View File

@ -2786,11 +2786,11 @@ nsAccessible::GetRelations(nsIArray **aRelations)
nsCOMPtr<nsIMutableArray> relations = do_CreateInstance(NS_ARRAY_CONTRACTID);
NS_ENSURE_TRUE(relations, NS_ERROR_OUT_OF_MEMORY);
// Latest nsIAccessibleRelation is RELATION_DESCRIPTION_FOR (0xof)
for (PRUint32 relType = 0; relType < 0x0f; ++relType) {
for (PRUint32 relType = nsIAccessibleRelation::RELATION_FIRST;
relType < nsIAccessibleRelation::RELATION_LAST;
++relType) {
nsCOMPtr<nsIAccessible> accessible;
nsresult rv = GetAccessibleRelated(relType, getter_AddRefs(accessible));
NS_ENSURE_SUCCESS(rv, rv);
GetAccessibleRelated(relType, getter_AddRefs(accessible));
if (accessible) {
nsCOMPtr<nsIAccessibleRelation> relation =