Bug 394117. Warnings when accessible relations queryied. r=surkov, a=dsicore
authoraaronleventhal@moonset.net
Thu, 30 Aug 2007 11:51:47 -0700
changeset 5475 c4cfe2114906802ca90a546c3686273066dfc45b
parent 5474 069fd7e8cce396d4b1ec6ea7e855edf13127f58e
child 5476 a26e9c2a2df366e8f8fc40aefaf642f80966d819
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov, dsicore
bugs394117
milestone1.9a8pre
Bug 394117. Warnings when accessible relations queryied. r=surkov, a=dsicore
accessible/public/nsIAccessibleRelation.idl
accessible/src/base/nsAccessible.cpp
--- a/accessible/public/nsIAccessibleRelation.idl
+++ b/accessible/public/nsIAccessibleRelation.idl
@@ -52,16 +52,19 @@ interface nsIAccessibleRelation : nsISup
 
   const unsigned long RELATION_NUL = 0x00;
 
   /**
    * Some attribute of this object is affected by a target object.
    */
   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.
    */
   const unsigned long RELATION_CONTROLLER_FOR = 0x02;
 
   /**
    * This object is label for a target object.
    */
@@ -130,16 +133,19 @@ interface nsIAccessibleRelation : nsISup
    */
   const unsigned long RELATION_DESCRIBED_BY = 0x0e;
 
   /**
    * This object is describes the target object.
    */
   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.
    */
   const unsigned long RELATION_DEFAULT_BUTTON = 0x4000;
 
   /**
    * Returns the type of the relation.
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -2781,21 +2781,21 @@ nsAccessible::GetRelation(PRUint32 aInde
 NS_IMETHODIMP
 nsAccessible::GetRelations(nsIArray **aRelations)
 {
   NS_ENSURE_ARG_POINTER(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 =
         new nsAccessibleRelationWrap(relType, accessible);
       NS_ENSURE_TRUE(relation, NS_ERROR_OUT_OF_MEMORY);
 
       relations->AppendElement(relation, PR_FALSE);
     }