[orca] Handle more instances of bogus empty text objects from Gecko



commit 5c9893ce3790068f255fca373438383ac0264df4
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Jan 15 21:04:44 2014 -0500

    Handle more instances of bogus empty text objects from Gecko

 src/orca/scripts/toolkits/Gecko/script.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/Gecko/script.py b/src/orca/scripts/toolkits/Gecko/script.py
index 0d3874a..e705c3f 100644
--- a/src/orca/scripts/toolkits/Gecko/script.py
+++ b/src/orca/scripts/toolkits/Gecko/script.py
@@ -2700,7 +2700,7 @@ class Script(default.Script):
             characterOffset = len(words[0])
 
         character = text.getText(characterOffset, characterOffset + 1)
-        if character != self.EMBEDDED_OBJECT_CHARACTER:
+        if len(character) == 1 and character != self.EMBEDDED_OBJECT_CHARACTER:
             return [obj, characterOffset]
 
         try:
@@ -2708,7 +2708,11 @@ class Script(default.Script):
             child = obj[childIndex]
 
             # Handle bogus empty paragraphs. Bug 677615.
-            if child.getRole() == pyatspi.ROLE_PARAGRAPH \
+            # Make that bogus empty text objects.
+            textRoles = [pyatspi.ROLE_HEADING,
+                         pyatspi.ROLE_PARAGRAPH,
+                         pyatspi.ROLE_SECTION]
+            if child.getRole() in textRoles \
                and not self.utilities.queryNonEmptyText(child):
                 return self.findFirstCaretContext(obj, characterOffset + 1)
 


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