Index: src/orca/scripts/apps/soffice/script.py
===================================================================
--- src/orca/scripts/apps/soffice/script.py	(revision 4662)
+++ src/orca/scripts/apps/soffice/script.py	(working copy)
@@ -2137,8 +2137,24 @@
         """
         rv, start, end = \
             default.Script.getTextAttributes(self, acc, offset, get_defaults)
-        return rv, start, end - 1
 
+        # If there are no text attributes associated with the text at a
+        # given offset, we might get some seriously bogus offsets, in
+        # particular, an extremely large start offset and an extremely
+        # large, but negative end offset. As a result, any text attributes
+        # which are present on the line after the specified offset will
+        # not be indicated by braille.py's getAttributeMask. Therefore,
+        # we'll set the start offset to the character being examined,
+        # and the end offset to the next character.
+        #
+        start = min(start, offset)
+        if end < 0:
+            end = offset + 1
+        else:
+            end -= 1
+
+        return rv, start, end
+
     def getDisplayedText(self, obj):
         """Returns the text being displayed for an object. Overridden here
         because OpenOffice uses symbols (e.g. ">>" for buttons but exposes
