[orca] Fix for bgo#619809 - Orca freezes when building the flat review context of the Keybindings table



commit eddf2f07d0c57d73f4e09c06d294c854c9e114f8
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Mon Jun 14 20:37:38 2010 -0400

    Fix for bgo#619809 - Orca freezes when building the flat review context of the Keybindings table

 src/orca/flat_review.py      |    5 +++--
 src/orca/script_utilities.py |    7 ++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/flat_review.py b/src/orca/flat_review.py
index 15968ba..634bc3c 100644
--- a/src/orca/flat_review.py
+++ b/src/orca/flat_review.py
@@ -45,6 +45,8 @@ from orca_i18n import C_        # to provide qualified translatable strings
 #
 whitespace_re = re.compile(r'(\s+)', re.DOTALL | re.IGNORECASE | re.M)
 
+EMBEDDED_OBJECT_CHARACTER = u'\ufffc'
+
 class Char:
     """Represents a single char of an Accessibility_Text object."""
 
@@ -777,8 +779,7 @@ class Context:
         #print "LOOKING AT '%s'" % unicodeString
         for i in range(0, len(unicodeString) + 1):
             if (i != len(unicodeString)) \
-               and (unicodeString[i] != \
-                        orca_state.activeScript.EMBEDDED_OBJECT_CHARACTER):
+               and (unicodeString[i] != EMBEDDED_OBJECT_CHARACTER):
                 substringEndOffset += 1
             elif (substringEndOffset == substringStartOffset):
                 substringStartOffset += 1
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 7c681ac..e6e1cd2 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -1286,10 +1286,12 @@ class Utilities:
         while currentY < (parentExtents.y + parentExtents.height):
             currentX = parentExtents.x
             minHeight = sys.maxint
+            index = -1
             while currentX < (parentExtents.x + parentExtents.width):
                 child = \
                     icomponent.getAccessibleAtPoint(currentX, currentY + 1, 0)
                 if child:
+                    index = child.getIndexInParent()
                     extents = child.queryComponent().getExtents(0)
                     if extents.x >= 0 and extents.y >= 0:
                         newX = extents.x + extents.width
@@ -1299,7 +1301,10 @@ class Utilities:
                     else:
                         newX = currentX + gridSize
                 else:
-                    newX = currentX + gridSize
+                    debug.println(debug.LEVEL_FINEST,
+                            "script_utilities.showingDescendants failed. " \
+                            "Last valid child at index %d" % index)
+                    break
                 if newX <= currentX:
                     currentX += gridSize
                 else:



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