[orca/gnome-2-26] Fix for bug #583811



commit 5e67d0b20cd2fbffccd06aeef8331cba597ec6c7
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Fri Jun 19 18:48:39 2009 -0400

    Fix for bug #583811
    
    Fix for bug #583811 - Doing a select all in OOo Writer causes Orca to say
    "selected" for each paragraph.

 ChangeLog                              |    6 ++++++
 src/orca/default.py                    |   20 ++++++++++++++++++++
 test/keystrokes/gtk-demo/role_label.py |    6 +++---
 3 files changed, 29 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5115b4d..581f8dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -115,6 +115,12 @@
 
 2009-04-10  Willie Walker <william walker sun com>
 
+        * src/orca/default.py:
+          Fix for bug #583811 - Doing a select all in OOo Writer causes Orca
+          to say "selected" for each paragraph.
+
+2009-05-25  Joanmarie Diggs <joanmarie diggs gmail com>
+
         * src/orca/scripts/apps/soffice/script.py:
           src/orca/settings.py:
           src/orca/where_am_I.py:
diff --git a/src/orca/default.py b/src/orca/default.py
index f376d14..6bc3a3a 100644
--- a/src/orca/default.py
+++ b/src/orca/default.py
@@ -4044,6 +4044,26 @@ class Script(script.Script):
                 # dealing with this situation.
                 #
                 return
+            else:
+                # If we do a select all in a document in which each
+                # paragraph is a separate accessible object, we'll
+                # get an event for each of those objects. We don't
+                # want to repeat "(un)selected". See bug #583811.
+                #
+                diff = lastPos[0].getIndexInParent() - obj.getIndexInParent()
+                if abs(diff) > 1:
+                    # We can skip this one because we'll do the
+                    # announcement based on another one.
+                    #
+                    return
+                elif startOffset > 0 and startOffset == endOffset:
+                    try:
+                        text = lastPos[0].queryText()
+                    except:
+                        pass
+                    else:
+                        if startOffset == text.characterCount:
+                            return
 
             # We must be approaching from the top, left, or right. Or
             # from below but we've found a blank line. Our stored point
diff --git a/test/keystrokes/gtk-demo/role_label.py b/test/keystrokes/gtk-demo/role_label.py
index cb20b29..ee8f465 100644
--- a/test/keystrokes/gtk-demo/role_label.py
+++ b/test/keystrokes/gtk-demo/role_label.py
@@ -45,14 +45,14 @@ sequence.append(WaitAction("object:state-changed:focused",
                            5000))
 sequence.append(utils.AssertPresentationAction(
     "This message box label",
-    ["BRAILLE LINE:  'gtk-demo Application Information Alert This message box has been popped up the following $l'",
+    ["KNOWN ISSUE: We normally speak 'selected' for the selected text. In this test, however, we do not because the label gets STATE_FOCUSED immediately after the selection-changed event.",
+     "BRAILLE LINE:  'gtk-demo Application Information Alert This message box has been popped up the following $l'",
      "     VISIBLE:  'This message box has been popped', cursor=1",
      "BRAILLE LINE:  'gtk-demo Application Information Alert number of times: $l'",
      "     VISIBLE:  'number of times: $l', cursor=17",
      "SPEECH OUTPUT: ''",
      "SPEECH OUTPUT: 'This message box has been popped up the following",
-     "number of times: label'",
-     "SPEECH OUTPUT: 'selected'"]))
+     "number of times: label'"]))
 
 ########################################################################
 # Do a basic "Where Am I" via KP_Enter.



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