[orca/gnome-3-2] Fix for a couple of bugs which impact Gecko support:



commit a7b1c77217e46ef6771dc1eca997d2b11facf884
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Thu Oct 13 15:33:56 2011 -0400

    Fix for a couple of bugs which impact Gecko support:
    
    * Bug 661706 - Sanity check needed in Gecko script's
      getBottomOfFile() to ensure we have a "last object"
    * Bug 659122 - UnicodeDecodeError and UnicodeEncodeError
      keep cropping up since introspection

 src/orca/scripts/toolkits/Gecko/script.py |    2 +-
 src/orca/speechdispatcherfactory.py       |    4 ++++
 2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/Gecko/script.py b/src/orca/scripts/toolkits/Gecko/script.py
index 304f7ef..bfb1b97 100644
--- a/src/orca/scripts/toolkits/Gecko/script.py
+++ b/src/orca/scripts/toolkits/Gecko/script.py
@@ -3368,7 +3368,7 @@ class Script(default.Script):
         # If the last object is a link, it may be more efficient to check
         # for text that follows.
         #
-        if obj.getRole() == pyatspi.ROLE_LINK:
+        if obj and obj.getRole() == pyatspi.ROLE_LINK:
             text = self.utilities.queryNonEmptyText(obj.parent)
             if text:
                 char = text.getText(text.characterCount - 1,
diff --git a/src/orca/speechdispatcherfactory.py b/src/orca/speechdispatcherfactory.py
index 3fef20c..17a4a2d 100644
--- a/src/orca/speechdispatcherfactory.py
+++ b/src/orca/speechdispatcherfactory.py
@@ -311,6 +311,10 @@ class SpeechServer(speechserver.SpeechServer):
             charName = " %s " % chnames.getCharacterName(symbol)
             if action == punctuation_settings.PUNCTUATION_INSERT:
                 charName += symbol
+            try:
+                charName = charName.decode("UTF-8")
+            except UnicodeEncodeError:
+                pass
             newText = re.sub(symbol, charName, newText)
 
         if orca_state.activeScript:



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