[at-spi/gnome-2-30] Do not ignore count for getMatchesTo



commit 1814074b201aa25462e7c835cbb917068d65ed7b
Author: Mike Gorse <mgorse novell com>
Date:   Mon Apr 12 11:59:43 2010 -0400

        Do not ignore count for getMatchesTo
    
        Bug #538680

 libspi/collection.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/libspi/collection.c b/libspi/collection.c
index 7fbacb7..5a29c3e 100644
--- a/libspi/collection.c
+++ b/libspi/collection.c
@@ -610,7 +610,8 @@ sort_order_rev_canonical (MatchRulePrivate *mrp, GList *ls,
     if (flag && match_interfaces_lookup (obj, mrp, ev) 
                && match_states_lookup (obj, mrp, ev)     
                && match_roles_lookup (obj, mrp, ev)  
-               && match_attributes_lookup (obj, mrp, ev))
+               && match_attributes_lookup (obj, mrp, ev)
+               && (max == 0 || kount < max))
     {
          ls = g_list_append (ls, obj);
          kount++;
@@ -622,7 +623,7 @@ sort_order_rev_canonical (MatchRulePrivate *mrp, GList *ls,
     indexinparent = Accessibility_Accessible_getIndexInParent (obj, ev);
     parent = Accessibility_Accessible__get_parent (obj, ev);
 
-    if(indexinparent > 0)
+    if(indexinparent > 0 && (max == 0 || kount < max))
     {
          /* there are still some siblings to visit so get the previous sibling
             and get it's last descendant.
@@ -642,7 +643,7 @@ sort_order_rev_canonical (MatchRulePrivate *mrp, GList *ls,
          kount = sort_order_rev_canonical (mrp, ls,  kount, max, 
                                        nextobj, TRUE, pobj, ev);
     } 
-    else
+    else if (max == 0 || kount < max)
     {
          /* no more siblings so next node must be the parent */
          kount = sort_order_rev_canonical (mrp, ls,  kount, max, 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]