[orca/gnome-3-10] Use the default script when presenting text in WebKitGtk entries



commit 452389412f03818fd9fdef88fa1e46c474a9c9b2
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Thu Oct 17 13:05:07 2013 -0400

    Use the default script when presenting text in WebKitGtk entries

 src/orca/label_inference.py                   |    4 ++--
 src/orca/scripts/toolkits/WebKitGtk/script.py |   16 ++++++++++++++++
 2 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/label_inference.py b/src/orca/label_inference.py
index a85fab3..a457f86 100644
--- a/src/orca/label_inference.py
+++ b/src/orca/label_inference.py
@@ -398,7 +398,7 @@ class LabelInference:
         """
 
         thisLine = self._getLineContents(obj)
-        if not thisLine and thisLine[0]:
+        if not (thisLine and thisLine[0]):
             return None
 
         prevObj, start, end, string = thisLine[0]
@@ -459,7 +459,7 @@ class LabelInference:
             return None
 
         thisLine = self._getLineContents(obj)
-        if not thisLine and thisLine[0]:
+        if not (thisLine and thisLine[0]):
             return None
 
         lastObj, start, end, string = thisLine[-1]
diff --git a/src/orca/scripts/toolkits/WebKitGtk/script.py b/src/orca/scripts/toolkits/WebKitGtk/script.py
index db146b1..6fe0a22 100644
--- a/src/orca/scripts/toolkits/WebKitGtk/script.py
+++ b/src/orca/scripts/toolkits/WebKitGtk/script.py
@@ -340,6 +340,10 @@ class Script(default.Script):
         - obj: an Accessible object that implements the AccessibleText interface
         """
 
+        if obj.getRole() == pyatspi.ROLE_ENTRY:
+            default.Script.sayCharacter(self, obj)
+            return
+
         boundary = pyatspi.TEXT_BOUNDARY_CHAR
         objects = self.utilities.getObjectsFromEOCs(obj, boundary=boundary)
         for (obj, start, end, string) in objects:
@@ -355,6 +359,10 @@ class Script(default.Script):
         - obj: an Accessible object that implements the AccessibleText interface
         """
 
+        if obj.getRole() == pyatspi.ROLE_ENTRY:
+            default.Script.sayWord(self, obj)
+            return
+
         boundary = pyatspi.TEXT_BOUNDARY_WORD_START
         objects = self.utilities.getObjectsFromEOCs(obj, boundary=boundary)
         for (obj, start, end, string) in objects:
@@ -367,6 +375,10 @@ class Script(default.Script):
         - obj: an Accessible object that implements the AccessibleText interface
         """
 
+        if obj.getRole() == pyatspi.ROLE_ENTRY:
+            default.Script.sayLine(self, obj)
+            return
+
         boundary = pyatspi.TEXT_BOUNDARY_LINE_START
         objects = self.utilities.getObjectsFromEOCs(obj, boundary=boundary)
         for (obj, start, end, string) in objects:
@@ -390,6 +402,10 @@ class Script(default.Script):
         - endOffset: the end text offset.
         """
 
+        if obj.getRole() == pyatspi.ROLE_ENTRY:
+            default.Script.sayPhrase(self, obj, startOffset, endOffset)
+            return
+
         phrase = self.utilities.substring(obj, startOffset, endOffset)
         if len(phrase) and phrase != "\n":
             if phrase.isupper():


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