[orca] Work around newlines showing up incorrectly as part of textAtOffset results



commit 35cc0178b11f7cf329ce730e1597b9bf370b0399
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Jul 9 09:47:03 2019 -0400

    Work around newlines showing up incorrectly as part of textAtOffset results

 src/orca/script_utilities.py | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 6c95318a8..8d9e34d93 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -4126,6 +4126,16 @@ class Utilities:
         if not self.containsRegion(extents, (x, y, 1, 1)) and string != "\n":
             return "", 0, 0
 
+        if not string.endswith("\n") or string == "\n":
+            return string, start, end
+
+        if boundary == pyatspi.TEXT_BOUNDARY_CHAR:
+            return string, start, end
+
+        char = self.textAtPoint(obj, x, y, coordType, pyatspi.TEXT_BOUNDARY_CHAR)
+        if char[0] == "\n" and char[2] - char[1] == 1:
+            return char
+
         return string, start, end
 
     def visibleRows(self, obj, boundingbox):


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