[orca] Fix for bgo#591860 - Orca grinds to a halt when Ctrl+End is pressed in a really long message in Thun



commit f26b7acfddfd5af3346df1179d4c436f72009fc2
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Fri Aug 14 21:55:03 2009 -0400

    Fix for bgo#591860 - Orca grinds to a halt when Ctrl+End is pressed in a really long message in Thunderbird

 src/orca/scripts/apps/Thunderbird/script.py |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/apps/Thunderbird/script.py b/src/orca/scripts/apps/Thunderbird/script.py
index 5b710d2..2364f08 100644
--- a/src/orca/scripts/apps/Thunderbird/script.py
+++ b/src/orca/scripts/apps/Thunderbird/script.py
@@ -577,6 +577,24 @@ class Script(Gecko.Script):
             self.sayAll(None)
         self._messageLoaded = False
 
+    def getBottomOfFile(self):
+        """Returns the object and last caret offset at the bottom of the
+         document frame. Overridden here because really long text messages
+         with no links near the bottom are not handled efficiently by the
+         Gecko script's method."""
+
+        obj = self.getDocumentFrame()
+        text = self.queryNonEmptyText(obj)
+        if text:
+            lastOffset = text.characterCount - 1
+            lastChar = text.getText(lastOffset - 1, lastOffset)
+            if lastChar != self.EMBEDDED_OBJECT_CHARACTER:
+                obj, lastOffset = \
+                    self.findPreviousCaretInOrder(obj, lastOffset - 1)
+                return obj, lastOffset
+
+        return Gecko.Script.getBottomOfFile(self)
+
     def getDocumentFrame(self):
         """Returns the document frame that holds the content being shown.
         Overridden here because multiple open messages are not arranged



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