[orca] Fix several LibreOffice UI-related issues



commit e1730f2ffffa0094fd3e0cfae639123710a0a92e
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Thu May 8 13:43:35 2014 -0400

    Fix several LibreOffice UI-related issues

 src/orca/formatting.py                      |    4 +---
 src/orca/scripts/apps/soffice/formatting.py |    4 ----
 src/orca/scripts/apps/soffice/script.py     |   21 ++++++++++++++++-----
 3 files changed, 17 insertions(+), 12 deletions(-)
---
diff --git a/src/orca/formatting.py b/src/orca/formatting.py
index db41b29..03a747c 100644
--- a/src/orca/formatting.py
+++ b/src/orca/formatting.py
@@ -435,9 +435,7 @@ formatting = {
                                      asString(labelAndName + value + roleName + required))]',
             },
         pyatspi.ROLE_LABEL: {
-            'unfocused': '[Text(obj,\
-                                asString(label),\
-                                asString(eol))]'
+            'unfocused': '[Text(obj, asString(label))]'
             },
         pyatspi.ROLE_LINK: {
             'unfocused': '[Link(obj, asString(currentLineText)\
diff --git a/src/orca/scripts/apps/soffice/formatting.py b/src/orca/scripts/apps/soffice/formatting.py
index 4a97b99..d69cd26 100644
--- a/src/orca/scripts/apps/soffice/formatting.py
+++ b/src/orca/scripts/apps/soffice/formatting.py
@@ -68,10 +68,6 @@ formatting = {
             },
     },
     'braille': {
-        pyatspi.ROLE_LABEL: {
-            'unfocused': '[Text(obj,asString((label or name)))]',
-            'focused': '[Text(obj,asString((label or name)))]'
-            },
         pyatspi.ROLE_LIST: {
             'unfocused': '[Component(obj,\
                                      asString(labelOrName + roleName + required))]'
diff --git a/src/orca/scripts/apps/soffice/script.py b/src/orca/scripts/apps/soffice/script.py
index f5bf5e1..05e45d9 100644
--- a/src/orca/scripts/apps/soffice/script.py
+++ b/src/orca/scripts/apps/soffice/script.py
@@ -896,12 +896,21 @@ class Script(default.Script):
         if event.source.getRoleName() == 'text frame':
             return
 
+        parent = event.source.parent
+        if parent and parent.getRoleName() == 'text frame':
+            return
+
+        if parent and parent.getRole() == pyatspi.ROLE_TOOL_BAR:
+            default.Script.onFocusedChanged(self, event)
+            return
+
+        role = event.source.getRole()
         ignoreRoles = [pyatspi.ROLE_FILLER, pyatspi.ROLE_PANEL]
-        if event.source.getRole() in ignoreRoles:
+        if role in ignoreRoles:
             return
 
-        parent = event.source.parent
-        if parent and parent.getRoleName() == 'text frame':
+        # We will present this when the selection changes.
+        if role == pyatspi.ROLE_MENU:
             return
 
         obj, offset = self.pointOfReference.get("lastCursorPosition", (None, -1))
@@ -913,7 +922,7 @@ class Script(default.Script):
         if self.utilities._flowsFromOrToSelection(event.source):
             return
 
-        if event.source.getRole() == pyatspi.ROLE_PARAGRAPH:
+        if role == pyatspi.ROLE_PARAGRAPH:
             keyString, mods = self.utilities.lastKeyAndModifiers()
             if keyString in ["Left", "Right"]:
                 orca.setLocusOfFocus(event, event.source, False)
@@ -987,10 +996,12 @@ class Script(default.Script):
             x = orca_state.lastInputEvent.x
             y = orca_state.lastInputEvent.y
             weToggledIt = obj.queryComponent().contains(x, y, 0)
+        elif obj.getState().contains(pyatspi.STATE_FOCUSED):
+            weToggledIt = True
         else:
             keyString, mods = self.utilities.lastKeyAndModifiers()
             navKeys = ["Up", "Down", "Left", "Right", "Page_Up", "Page_Down",
-                       "Home", "End"]
+                       "Home", "End", "N"]
             wasCommand = mods & settings.COMMAND_MODIFIER_MASK
             weToggledIt = wasCommand and keyString not in navKeys
         if weToggledIt:


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