[orca] Handle text implementations which report a caret offset of -1 when at the end



commit 4076e6b310346cc370f316bbe6d8c0c6fdd1cc81
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Jun 5 10:41:33 2012 -0400

    Handle text implementations which report a caret offset of -1 when at the end

 src/orca/scripts/default.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index a3e019b..50b6b61 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -5168,6 +5168,8 @@ class Script(script.Script):
                 lineString = text.getText(caretOffset, caretOffset + 1)
                 startOffset = caretOffset
             else:
+                if caretOffset == -1:
+                    caretOffset = text.characterCount
                 try:
                     [lineString, startOffset, endOffset] = text.getTextAtOffset(
                         caretOffset, pyatspi.TEXT_BOUNDARY_LINE_START)



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