[orca/gnome-3-10] Fix a possible traceback in eclipse script



commit 810a8976dd79af7f2732f3e847e835b6b195ae8a
Author: José Vilmar Estácio de Souza <vilmar informal com br>
Date:   Sat Nov 16 19:37:46 2013 -0200

    Fix a possible traceback in eclipse script
    
    Inside onTextInserted we need to check if the event.source is text area
    before try to get characterCount.

 src/orca/scripts/apps/Eclipse/script.py |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/src/orca/scripts/apps/Eclipse/script.py b/src/orca/scripts/apps/Eclipse/script.py
index b522e2e..9d5c395 100644
--- a/src/orca/scripts/apps/Eclipse/script.py
+++ b/src/orca/scripts/apps/Eclipse/script.py
@@ -108,17 +108,18 @@ class Script(default.Script):
         - event: the Event
         """
 
-        length = event.source.queryText().characterCount
-        if event.detail1 == 0 and event.detail2 == length:
-            # seems to be generated by a reformat (ctrl+shift+f)
-            # or by commenting some block (ctrl+/).
-            # if not discarded, orca will speak all the text of the file.
-            return
-
-        # Let the default script's normal behavior do its thing
-        #
-        default.Script.onTextInserted(self, event)
-        self._saveLastTextPosition(event.source)
+        if self.utilities.isTextArea(event.source):
+            length = event.source.queryText().characterCount
+            if event.detail1 == 0 and event.detail2 == length:
+                # seems to be generated by a reformat (ctrl+shift+f)
+                # or by commenting some block (ctrl+/).
+                # if not discarded, orca will speak all the text of the file.
+                return
+
+            # Let the default script's normal behavior do its thing
+            #
+            default.Script.onTextInserted(self, event)
+            self._saveLastTextPosition(event.source)
 
     def onTextDeleted(self, event):
         """Called whenever text is deleted from an object.  Overridden here


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