[orca] Fix for bgo#620097 - When a line in an OOo Writer document ends with a link, the final character is



commit d8eabedadd323809f60d0ec3e04fefdffd19aa58
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Sun May 30 10:43:09 2010 -0400

    Fix for bgo#620097 - When a line in an OOo Writer document ends with a link, the final character is spoken as if it were not part of the link

 src/orca/script_utilities.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 8c8fb8d..3310690 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -2363,7 +2363,9 @@ class Utilities:
             if startOffset < link.endIndex < endOffset:
                 index = link.endIndex - startOffset
             elif startOffset <= link.startIndex < endOffset:
-                index = len(line) - 1
+                index = len(line)
+                if link.endIndex < endOffset:
+                    index -= 1
             else:
                 continue
 
@@ -2375,7 +2377,9 @@ class Utilities:
             # If the link was not followed by a whitespace or punctuation
             # character, then add in a space to make it more presentable.
             #
-            nextChar = adjustedLine[index]
+            nextChar = ""
+            if index < len(line):
+                nextChar = adjustedLine[index]
             if not (nextChar in self._script.whitespace \
                     or punctuation_settings.getPunctuationInfo(nextChar)):
                 linkString += " "



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