[orca] Fall back on sayCharacter() when there is no word for sayWord() to present.



commit 9915f10fada8923bb62d9f790bc7fcfef261d722
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Thu May 8 12:36:10 2014 -0400

    Fall back on sayCharacter() when there is no word for sayWord() to present.

 src/orca/scripts/default.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index 55cdb08..3d042bd 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -3501,8 +3501,7 @@ class Script(script.Script):
             self.sayCharacter(obj)
 
     def sayWord(self, obj):
-        """Speaks the word at the caret.  [[[TODO: WDW - what if there is no
-        word at the caret?]]]
+        """Speaks the word at the caret.
 
         Arguments:
         - obj: an Accessible object that implements the AccessibleText
@@ -3518,6 +3517,10 @@ class Script(script.Script):
             text.getTextAtOffset(offset,
                                  pyatspi.TEXT_BOUNDARY_WORD_START)
 
+        if not word:
+            self.sayCharacter(obj)
+            return
+
         # Speak a newline if a control-right-arrow or control-left-arrow
         # was used to cross a line boundary. Handling is different for
         # the two keys since control-right-arrow places the cursor after


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