[orca] Don't present number of list children if the children cannot be found.



commit 28fb8d9f0d01ce2985aefbb679399f67b89bffcb
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Jun 3 17:33:42 2015 -0400

    Don't present number of list children if the children cannot be found.

 .../scripts/toolkits/Gecko/speech_generator.py     |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/Gecko/speech_generator.py 
b/src/orca/scripts/toolkits/Gecko/speech_generator.py
index eceb84d..abe5bb1 100644
--- a/src/orca/scripts/toolkits/Gecko/speech_generator.py
+++ b/src/orca/scripts/toolkits/Gecko/speech_generator.py
@@ -171,6 +171,9 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
             return super()._generateNumberOfChildren(obj, **args)
 
         children = [x for x in obj if x.getRole() == pyatspi.ROLE_LIST_ITEM]
+        if not children:
+            return []
+
         result = [messages.listItemCount(len(children))]
         result.extend(self.voice(speech_generator.SYSTEM))
         return result


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