[orca] Fix for bgo#364772 - Orca cannot detect misspelled words on the fly in Openoffice



commit 3bb20170c43eb7deb55d52e5508bd43271dcc2e4
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Sun Apr 4 18:39:49 2010 -0400

    Fix for bgo#364772 - Orca cannot detect misspelled words on the fly in Openoffice

 src/orca/scripts/apps/soffice/script.py |   17 +++++++++++++++++
 src/orca/settings.py                    |    9 +++++----
 2 files changed, 22 insertions(+), 4 deletions(-)
---
diff --git a/src/orca/scripts/apps/soffice/script.py b/src/orca/scripts/apps/soffice/script.py
index 96fd86d..6b621db 100644
--- a/src/orca/scripts/apps/soffice/script.py
+++ b/src/orca/scripts/apps/soffice/script.py
@@ -2345,6 +2345,23 @@ class Script(default.Script):
         else:
             default.Script.onTextInserted(self, event)
 
+    def isWordMisspelled(self, obj, offset):
+        """Identifies if the current word is flagged as misspelled by the
+        application.
+
+        Arguments:
+        - obj: An accessible which implements the accessible text interface.
+        - offset: Offset in the accessible's text for which to retrieve the
+          attributes.
+
+        Returns True if the word is flagged as misspelled.
+        """
+
+        attributes, start, end  = self.getTextAttributes(obj, offset, True)
+        error = attributes.get("text-spelling")
+
+        return error == "misspelled"
+
     def getTextAttributes(self, acc, offset, get_defaults=False):
         """Get the text attributes run for a given offset in a given accessible
 
diff --git a/src/orca/settings.py b/src/orca/settings.py
index 84ef253..ae70a9f 100644
--- a/src/orca/settings.py
+++ b/src/orca/settings.py
@@ -714,8 +714,8 @@ allTextAttributes = \
     "pixels-below-lines:; pixels-inside-wrap:; right-margin:; rise:; " \
     "scale:; size:; stretch:; strikethrough:false; style:normal; " \
     "text-decoration:none; text-rotation:0; text-shadow:none; " \
-    "underline:none; variant:; vertical-align:baseline; weight:400; " \
-    "wrap-mode:; writing-mode:lr-tb;"
+    "text-spelling:none; underline:none; variant:; " \
+    "vertical-align:baseline; weight:400; wrap-mode:; writing-mode:lr-tb;"
 
 # The default set of text attributes to speak to the user. Specific
 # application scripts (or individual users can override these values if
@@ -728,7 +728,7 @@ allTextAttributes = \
 enabledSpokenTextAttributes = \
     "size:; family-name:; weight:400; indent:0; underline:none; " \
     "strikethrough:false; justification:left; style:normal; " \
-    "paragraph-style:;"
+    "paragraph-style:; text-spelling:none;"
 
 # The default set of text attributes to be brailled for the user. Specific
 # application scripts (or individual users can override these values if
@@ -740,7 +740,8 @@ enabledSpokenTextAttributes = \
 
 enabledBrailledTextAttributes = \
     "size:; family-name:; weight:400; indent:0; underline:none; " \
-    "strikethrough:false; justification:left; style:normal;"
+    "strikethrough:false; justification:left; style:normal; " \
+    "text-spelling:none;"
 
 # Text Attributes Braille Indicator (see textAttributesBrailleIndicator).
 # The values represent the character to be used in the attrOr



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