orca r3531 - in trunk: . src/orca



Author: joanied
Date: Thu Jan 31 18:31:48 2008
New Revision: 3531
URL: http://svn.gnome.org/viewvc/orca?rev=3531&view=rev

Log:
* src/orca/Gecko.py: 
  Fix for bug #513217 - (ff3) object navigation sticking on
  same line comboboxes.


Modified:
   trunk/ChangeLog
   trunk/src/orca/Gecko.py

Modified: trunk/src/orca/Gecko.py
==============================================================================
--- trunk/src/orca/Gecko.py	(original)
+++ trunk/src/orca/Gecko.py	Thu Jan 31 18:31:48 2008
@@ -4415,12 +4415,14 @@
             [candidate, start, end] = content
 
             # When we get the line contents, we include a focusable list
-            # as a list because that is what we want to present.  However,
-            # when we set the caret context, we set it to the position
-            # (and object) that immediately precedes it.  Therefore, that's
-            # what we need to look at when trying to determine our position.
+            # as a list and combo box as a combo box because that is what
+            # we want to present.  However, when we set the caret context,
+            # we set it to the position (and object) that immediately
+            # precedes it.  Therefore, that's what we need to look at when
+            # trying to determine our position.
             #
-            if candidate.getRole() == pyatspi.ROLE_LIST \
+            if candidate.getRole() in [pyatspi.ROLE_LIST,
+                                       pyatspi.ROLE_COMBO_BOX] \
                and candidate.getState().contains(pyatspi.STATE_FOCUSABLE):
                 start = self.getCharacterOffsetInParent(candidate)
                 end = start + 1
@@ -5780,6 +5782,18 @@
 
         return False
 
+    def isLineBreakChar(self, obj, offset):
+        """Returns True of the character at the given offset within
+        obj is a line break character (i.e. <br />)
+        """
+
+        text = self.queryNonEmptyText(obj)
+        if text:
+            [attributeSet, start, end] = text.getAttributeRun(offset, True)
+            return 'tag:BR' in attributeSet
+
+        return False
+
     def isUselessObject(self, obj):
         """Returns true if the given object is an obj that doesn't
         have any meaning associated with it and it is not inside a
@@ -8480,6 +8494,8 @@
                and nextObj.getRole() != pyatspi.ROLE_ENTRY:
                 [nextObj, nextOffset] = \
                           self.findNextCaretInOrder(nextObj, nextOffset)
+                if self.isLineBreakChar(nextObj, nextOffset):
+                    nextOffset += 1
             else:
                 nextOffset = line[1]
 
@@ -8506,6 +8522,9 @@
                 nextObj = self.findNextObject(nextObj)
                 nextLine = self.getLineContentsAtOffset(nextObj, nextOffset)
 
+        [nextObj, nextOffset] = \
+                  self.findNextCaretInOrder(nextObj, max(0, nextOffset) - 1)
+
         if not arrowToLineBeginning:
             extents = self.getExtents(obj,
                                       characterOffset, 
@@ -9026,6 +9045,10 @@
                 prevOffset = useful[index - 1][1]
                 found = True
 
+            elif self.isSameObject(obj, prevObj) \
+                 and 0 == prevOffset < characterOffset:
+                found = True
+
             if not found:
                 self._nextLineContents = line
                 [prevObj, prevOffset] = self.findPreviousLine(line[0][0], 



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