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



commit 225f2e1d656d7853f4223afb6ff3ea4bfff40f0e
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Mon Jun 14 21:05:41 2010 -0400

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

 src/orca/default.py     |    7 ++++++-
 src/orca/flat_review.py |    5 +++--
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/default.py b/src/orca/default.py
index 90d0328..68d1562 100644
--- a/src/orca/default.py
+++ b/src/orca/default.py
@@ -4902,10 +4902,12 @@ class Script(script.Script):
         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
@@ -4915,7 +4917,10 @@ class Script(script.Script):
                     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:
diff --git a/src/orca/flat_review.py b/src/orca/flat_review.py
index ba173d7..c9bf02b 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."""
 
@@ -776,8 +778,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



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