[orca] Fix for bgo#480883 - User can pan right in braille indefinitely at the end of a web page
- From: William Walker <wwalker src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [orca] Fix for bgo#480883 - User can pan right in braille indefinitely at the end of a web page
- Date: Mon, 3 Aug 2009 18:33:05 +0000 (UTC)
commit 3c69850232f02d356cf18af9b551b9d442449711
Author: Willie Walker <william walker sun com>
Date: Mon Aug 3 14:29:46 2009 -0400
Fix for bgo#480883 - User can pan right in braille indefinitely at the end of a web page
This adds a boolean return value to go{Next,Previous}Line and uses it to determine if
we need to refresh the braille display.
src/orca/scripts/toolkits/Gecko/script.py | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/Gecko/script.py b/src/orca/scripts/toolkits/Gecko/script.py
index 9574d65..67367eb 100644
--- a/src/orca/scripts/toolkits/Gecko/script.py
+++ b/src/orca/scripts/toolkits/Gecko/script.py
@@ -2620,8 +2620,7 @@ class Script(default.Script):
or not self.inDocumentContent() \
or not braille.endIsShowing:
default.Script.panBrailleRight(self, inputEvent, panAmount)
- else:
- self.goNextLine(inputEvent)
+ elif self.goNextLine(inputEvent):
while braille.panLeft():
pass
braille.refresh(False)
@@ -6314,12 +6313,14 @@ class Script(default.Script):
def goPreviousLine(self, inputEvent):
"""Positions the caret offset at the previous line in the document
window, attempting to preserve horizontal caret position.
+
+ Returns True if we actually moved.
"""
[obj, characterOffset] = self.getCaretContext()
[previousObj, previousCharOffset] = \
self.findPreviousLine(obj, characterOffset)
if not previousObj:
- return
+ return False
self.setCaretPosition(previousObj, previousCharOffset)
self.presentLine(previousObj, previousCharOffset)
@@ -6330,16 +6331,20 @@ class Script(default.Script):
# previousCharOffset)
#self.dumpContents(inputEvent, contents)
+ return True
+
def goNextLine(self, inputEvent):
"""Positions the caret offset at the next line in the document
window, attempting to preserve horizontal caret position.
+
+ Returns True if we actually moved.
"""
[obj, characterOffset] = self.getCaretContext()
[nextObj, nextCharOffset] = self.findNextLine(obj, characterOffset)
if not nextObj:
- return
+ return False
self.setCaretPosition(nextObj, nextCharOffset)
self.presentLine(nextObj, nextCharOffset)
@@ -6349,6 +6354,8 @@ class Script(default.Script):
#contents = self.getLineContentsAtOffset(nextObj, nextCharOffset)
#self.dumpContents(inputEvent, contents)
+ return True
+
def goBeginningOfLine(self, inputEvent):
"""Positions the caret offset at the beginning of the line."""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]