Index: src/orca/Gecko.py
===================================================================
--- src/orca/Gecko.py	(revision 3535)
+++ src/orca/Gecko.py	(working copy)
@@ -1438,7 +1438,7 @@
                                    "", col.MATCH_NONE,
                                    False)
 
-        matches = col.getMatches (rule, col.SORT_ORDER_CANONICAL, 0)
+        matches = col.getMatches (rule, col.SORT_ORDER_CANONICAL, 0, True)
         col.freeMatchRule(rule)
         for obj in matches:
             role = obj.getRole()
@@ -7165,6 +7165,15 @@
         return nextObj
 
     def findPreviousRole(self, roles, wrap, currentObj=None):
+
+        try:
+            #TODO: why can't I pass *args, **kwargs ??
+            return \
+                self.collectionFindPrevRole(roles, wrap, currentObj=currentObj)
+        except NotImplementedError:
+            return self.iterfindPreviousRole(roles, wrap, currentObj=currentObj)
+
+    def iterfindPreviousRole(self, roles, wrap, currentObj=None):
         """Finds the caret offset at the beginning of the next object
         using the given roles list as a pattern to match.
 
@@ -7207,8 +7216,51 @@
                     wrapped = True
 
         return [None, wrapped]
+                
+    def collectionFindPrevRole(self, roles, wrap, currentObj=None):
+        # The docframe is our collection
+        docframe = self.getDocumentFrame()
+        col = docframe.queryCollection()
 
+        # get our current object
+        if not currentObj:
+            [currentObj, characterOffset] = self.getCaretContext()
+
+        # define our matchrule
+        stateset = pyatspi.StateSet()
+        rule = col.createMatchRule(stateset.raw(), col.MATCH_NONE,
+                       "", col.MATCH_NONE,
+                       roles, col.MATCH_ANY,
+                       "", col.MATCH_NONE,
+                       False)
+
+        # go find the next match
+        rs = col.getMatchesInBackOrder(currentObj, rule, 
+                                       col.SORT_ORDER_FLOW, 1)
+
+        if len(rs) > 0:
+  #          col.freeMatchRule(rule)
+            return [rs[0], False]
+        else:
+            # We didn't find anything so start at the last object and try again
+            rs = col.getMatchesInBackOrder(self.getLastObject(), rule,
+                                           col.SORT_ORDER_FLOW, 1)
+  #          col.freeMatchRule(rule)
+            if len(rs) > 0:
+                return [rs[0], True]
+            else:
+                return [None, True] 
+
     def findNextRole(self, roles, wrap, currentObj=None):
+
+        try:
+            #TODO: why can't I pass *args, **kwargs ??
+            return \
+                self.collectionFindNextRole(roles, wrap, currentObj=currentObj)
+        except NotImplementedError:
+            return self.iterFindNextRole(roles, wrap, currentObj=currentObj)
+
+    def iterFindNextRole(self, roles, wrap, currentObj=None):
         """Finds the caret offset at the beginning of the next object
         using the given roles list as a pattern to match or not match.
 
@@ -7221,10 +7273,8 @@
         Returns: [obj, wrapped] where wrapped is a boolean reflecting
         whether wrapping took place.
         """
-
         if not currentObj:
             [currentObj, characterOffset] = self.getCaretContext()
-
         ancestors = []
         obj = currentObj.parent
         while obj:
@@ -7252,6 +7302,48 @@
 
         return [None, wrapped]
                 
+    def collectionFindNextRole(self, roles, wrap, currentObj=None):
+        # The docframe is our collection
+        docframe = self.getDocumentFrame()
+        col = docframe.queryCollection()
+
+        # get our current object
+        if not currentObj:
+            [currentObj, characterOffset] = self.getCaretContext()
+
+        # define our matchrule
+        stateset = pyatspi.StateSet()
+        rule = col.createMatchRule(stateset.raw(), col.MATCH_NONE,
+                       "", col.MATCH_NONE,
+                       roles, col.MATCH_ANY,
+                       "", col.MATCH_NONE,
+                       False)
+
+        # go find the next match
+        rs = col.getMatchesInOrder (currentObj, 
+                                    rule,
+                                    col.SORT_ORDER_FLOW,
+                                    True,
+                                    1, 
+                                    True)
+
+        if len(rs) > 0:
+  #          col.freeMatchRule(rule)
+            return [rs[0], False]
+        else:
+            # We didn't find anything so start at the doc frame and try again
+            rs = col.getMatchesInOrder (docframe, 
+                                    rule,
+                                    col.SORT_ORDER_FLOW,
+                                    True,
+                                    1, 
+                                    True)
+  #          col.freeMatchRule(rule)
+            if len(rs) > 0:
+                return [rs[0], True]
+            else:
+                return [None, True]                      
+
     def findPrevByPredicate(self, pred, wrap, currentObj=None):
         """Finds the caret offset at the beginning of the previous object
         using the given predicate as a pattern to match.
