[orca] Fix for bug 584263



commit 236f75f25e455ff0bcc06a2aa7ec317dcdda9f89
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Thu Jul 9 19:25:09 2009 -0400

    Fix for bug 584263
    
    Fix for bug 584263 - When I compose or reply to a message with Thunderbird,
    the Ctrl+End key combination does not work. The problem is that in some
    messages, the document frame has no children. We were not handling this
    condition.

 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 37a4878..eb0e171 100644
--- a/src/orca/scripts/toolkits/Gecko/script.py
+++ b/src/orca/scripts/toolkits/Gecko/script.py
@@ -3657,7 +3657,10 @@ class Script(default.Script):
     def getLastObject(self, documentFrame):
         """Returns the last object in the document frame"""
 
-        lastChild = documentFrame[documentFrame.childCount - 1]
+        try:
+            lastChild = documentFrame[documentFrame.childCount - 1]
+        except:
+            lastChild = documentFrame
         while lastChild:
             lastObj = self.findNextObject(lastChild, documentFrame)
             if lastObj:
@@ -5628,7 +5631,8 @@ class Script(default.Script):
         # it and trap the user in the list. The same is true for combo
         # boxes.
         #
-        if obj.getRole() in [pyatspi.ROLE_LIST, pyatspi.ROLE_COMBO_BOX] \
+        if obj \
+           and obj.getRole() in [pyatspi.ROLE_LIST, pyatspi.ROLE_COMBO_BOX] \
            and obj.getState().contains(pyatspi.STATE_FOCUSABLE):
             characterOffset = self.getCharacterOffsetInParent(obj)
             obj = obj.parent



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