[orca] Fix for bug #583811
- From: Joanmarie Diggs <joanied src gnome org>
- To: svn-commits-list gnome org
- Subject: [orca] Fix for bug #583811
- Date: Sat, 20 Jun 2009 15:18:39 -0400 (EDT)
commit 18f05d503c002858ac8623b59fe38c88759dadfb
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date: Sat Jun 20 15:14:57 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.
src/orca/default.py | 20 ++++++++++++++++++++
test/keystrokes/gtk-demo/role_label.py | 6 +++---
2 files changed, 23 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/default.py b/src/orca/default.py
index 938db0b..a0c622c 100644
--- a/src/orca/default.py
+++ b/src/orca/default.py
@@ -3999,6 +3999,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 fcf13f4..7dba3fb 100644
--- a/test/keystrokes/gtk-demo/role_label.py
+++ b/test/keystrokes/gtk-demo/role_label.py
@@ -45,13 +45,13 @@ 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: '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]