[orca] Prefer scrollSubstringTo over scrollTo for text objects
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Prefer scrollSubstringTo over scrollTo for text objects
- Date: Tue, 19 Nov 2019 15:18:15 +0000 (UTC)
commit d9ced9fd5e50a8d4e463059b5022959e192ed37b
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Tue Nov 19 10:17:39 2019 -0500
Prefer scrollSubstringTo over scrollTo for text objects
src/orca/eventsynthesizer.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/eventsynthesizer.py b/src/orca/eventsynthesizer.py
index a1791e8e7..418144f2a 100644
--- a/src/orca/eventsynthesizer.py
+++ b/src/orca/eventsynthesizer.py
@@ -221,11 +221,12 @@ def releaseAtPoint(x, y, button=1):
def _scrollSubstringToLocation(obj, location, startOffset, endOffset):
"""Attemps to scroll the given substring to the specified location."""
- if startOffset is None or endOffset is None:
- return False
-
try:
text = obj.queryText()
+ if startOffset is None:
+ startOffset = 0
+ if endOffset is None:
+ endOffset = text.characterCount - 1
result = text.scrollSubstringTo(startOffset, endOffset, location)
except NotImplementedError:
msg = "ERROR: Text interface not implemented for %s" % obj
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]