[orca] Don't spit up when LibreOffice becomes non-responsive



commit 0c5c90f09b5373e586784c5c1807055ed2f0bd80
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Thu Feb 18 17:30:40 2016 -0500

    Don't spit up when LibreOffice becomes non-responsive

 src/orca/script_utilities.py                      |    7 ++++++-
 src/orca/scripts/apps/soffice/script_utilities.py |    7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 8be4892..b3b17ad 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -3569,7 +3569,12 @@ class Utilities:
         # selections in a single accessible object.
         start, end, string = 0, 0, ''
         if text:
-            start, end = text.getSelection(0)
+            try:
+                start, end = text.getSelection(0)
+            except:
+                msg = "ERROR: Exception getting selected text for %s" % obj
+                debug.println(debug.LEVEL_INFO, msg, True)
+                start = end = 0
             if start != end:
                 string = text.getText(start, end)
                 while string.endswith(self.EMBEDDED_OBJECT_CHARACTER):
diff --git a/src/orca/scripts/apps/soffice/script_utilities.py 
b/src/orca/scripts/apps/soffice/script_utilities.py
index 510483c..7b96a90 100644
--- a/src/orca/scripts/apps/soffice/script_utilities.py
+++ b/src/orca/scripts/apps/soffice/script_utilities.py
@@ -479,7 +479,12 @@ class Utilities(script_utilities.Utilities):
         # that the Frame name will end with "Impress", unlocalized.
         #
         if obj:
-            topLevel = self.topLevelObject(obj)
+            try:
+                topLevel = self.topLevelObject(obj)
+            except:
+                msg = "ERROR: Exception getting top-level object for %s" % obj
+                debug.println(debug.LEVEL_INFO, msg, True)
+                return False
             if not topLevel:
                 return False
             if self.isDead(topLevel):


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