Index: src/orca/scripts/apps/soffice/script.py
===================================================================
--- src/orca/scripts/apps/soffice/script.py	(revision 4130)
+++ src/orca/scripts/apps/soffice/script.py	(working copy)
@@ -516,13 +516,13 @@
         """
 
         found = False
-        rolesList = [pyatspi.ROLE_TABLE_CELL, \
-                     pyatspi.ROLE_TABLE, \
-                     pyatspi.ROLE_UNKNOWN, \
-                     pyatspi.ROLE_SCROLL_PANE, \
-                     pyatspi.ROLE_PANEL, \
-                     pyatspi.ROLE_ROOT_PANE, \
-                     pyatspi.ROLE_FRAME, \
+        rolesList = [pyatspi.ROLE_TABLE_CELL,
+                     pyatspi.ROLE_TABLE,
+                     [pyatspi.ROLE_UNKNOWN, pyatspi.ROLE_DOCUMENT_FRAME],
+                     pyatspi.ROLE_SCROLL_PANE,
+                     pyatspi.ROLE_PANEL,
+                     pyatspi.ROLE_ROOT_PANE,
+                     pyatspi.ROLE_FRAME,
                      pyatspi.ROLE_APPLICATION]
         if startFromTable:
             rolesList = rolesList[1:]
@@ -566,12 +566,15 @@
             if current is None:
                 return False
 
-            if isinstance(role, str):
+            if not isinstance(role, list):
+                role = [role]
+
+            if isinstance(role[0], str):
                 current_role = current.getRoleName()
             else:
                 current_role = current.getRole()
 
-            if current_role != role:
+            if not current_role in role:
                 return False
 
             current = self._getParent(current)
@@ -1089,11 +1092,11 @@
 
         isPanel = False
         if event.type == "object:state-changed:focused":
-            rolesList = [pyatspi.ROLE_PANEL, \
-                         pyatspi.ROLE_SCROLL_PANE, \
-                         pyatspi.ROLE_PANEL, \
-                         pyatspi.ROLE_OPTION_PANE, \
-                         pyatspi.ROLE_DIALOG, \
+            rolesList = [pyatspi.ROLE_PANEL,
+                         pyatspi.ROLE_SCROLL_PANE,
+                         pyatspi.ROLE_PANEL,
+                         pyatspi.ROLE_OPTION_PANE,
+                         pyatspi.ROLE_DIALOG,
                          pyatspi.ROLE_APPLICATION]
             if self.isDesiredFocusedItem(event.source, rolesList):
                 tmp = event.source.parent.parent
@@ -1101,19 +1104,19 @@
                     isPanel = True
 
             if not isPanel:
-                rolesList = [pyatspi.ROLE_SCROLL_PANE, \
-                             pyatspi.ROLE_PANEL, \
-                             pyatspi.ROLE_OPTION_PANE, \
-                             pyatspi.ROLE_DIALOG, \
+                rolesList = [pyatspi.ROLE_SCROLL_PANE,
+                             pyatspi.ROLE_PANEL,
+                             pyatspi.ROLE_OPTION_PANE,
+                             pyatspi.ROLE_DIALOG,
                              pyatspi.ROLE_APPLICATION]
                 if self.isDesiredFocusedItem(event.source, rolesList):
                     if event.source.parent.name.startswith(panelName):
                         isPanel = True
 
             if not isPanel:
-                rolesList = [pyatspi.ROLE_PANEL, \
-                             pyatspi.ROLE_OPTION_PANE, \
-                             pyatspi.ROLE_DIALOG, \
+                rolesList = [pyatspi.ROLE_PANEL,
+                             pyatspi.ROLE_OPTION_PANE,
+                             pyatspi.ROLE_DIALOG,
                              pyatspi.ROLE_APPLICATION]
                 if self.isDesiredFocusedItem(event.source, rolesList):
                     if event.source.name.startswith(panelName):
@@ -1220,11 +1223,11 @@
         # the Writer, then just speak/braille the current line (rather than
         # speaking a bogus initial "paragraph" utterance as well).
 
-        rolesList = [pyatspi.ROLE_PARAGRAPH, \
-                     pyatspi.ROLE_UNKNOWN, \
-                     pyatspi.ROLE_SCROLL_PANE, \
-                     pyatspi.ROLE_PANEL, \
-                     pyatspi.ROLE_ROOT_PANE, \
+        rolesList = [pyatspi.ROLE_PARAGRAPH,
+                     [pyatspi.ROLE_UNKNOWN, pyatspi.ROLE_DOCUMENT_FRAME],
+                     pyatspi.ROLE_SCROLL_PANE,
+                     pyatspi.ROLE_PANEL,
+                     pyatspi.ROLE_ROOT_PANE,
                      pyatspi.ROLE_FRAME]
         if self.isDesiredFocusedItem(event.source, rolesList):
             debug.println(self.debugLevel,
@@ -1262,9 +1265,9 @@
         # their translation of this string matches what StarOffice uses in
         # that locale.
 
-        rolesList = [pyatspi.ROLE_PUSH_BUTTON, \
-                     pyatspi.ROLE_OPTION_PANE, \
-                     pyatspi.ROLE_DIALOG, \
+        rolesList = [pyatspi.ROLE_PUSH_BUTTON,
+                     pyatspi.ROLE_OPTION_PANE,
+                     pyatspi.ROLE_DIALOG,
                      pyatspi.ROLE_APPLICATION]
         if self.isDesiredFocusedItem(event.source, rolesList):
             pane = event.source.parent
@@ -1292,10 +1295,10 @@
 
             # Check for 2. License Agreement: Scroll Down button.
             #
-            rolesList = [pyatspi.ROLE_PUSH_BUTTON, \
-                         pyatspi.ROLE_PANEL, \
-                         pyatspi.ROLE_OPTION_PANE, \
-                         pyatspi.ROLE_DIALOG, \
+            rolesList = [pyatspi.ROLE_PUSH_BUTTON,
+                         pyatspi.ROLE_PANEL,
+                         pyatspi.ROLE_OPTION_PANE,
+                         pyatspi.ROLE_DIALOG,
                          pyatspi.ROLE_APPLICATION]
             if self.isDesiredFocusedItem(event.source, rolesList):
                 debug.println(self.debugLevel,
@@ -1307,11 +1310,11 @@
 
             # Check for 2. License Agreement: Accept button.
             #
-            rolesList = [pyatspi.ROLE_UNKNOWN, \
-                         pyatspi.ROLE_SCROLL_PANE, \
-                         pyatspi.ROLE_PANEL, \
-                         pyatspi.ROLE_OPTION_PANE, \
-                         pyatspi.ROLE_DIALOG, \
+            rolesList = [pyatspi.ROLE_UNKNOWN,
+                         pyatspi.ROLE_SCROLL_PANE,
+                         pyatspi.ROLE_PANEL,
+                         pyatspi.ROLE_OPTION_PANE,
+                         pyatspi.ROLE_DIALOG,
                          pyatspi.ROLE_APPLICATION]
             if self.isDesiredFocusedItem(event.source, rolesList):
                 debug.println(self.debugLevel,
@@ -1322,10 +1325,10 @@
 
             # Check for 3. Personal Data: Transfer Personal Data check box.
             #
-            rolesList = [pyatspi.ROLE_CHECK_BOX, \
-                         pyatspi.ROLE_PANEL, \
-                         pyatspi.ROLE_OPTION_PANE, \
-                         pyatspi.ROLE_DIALOG, \
+            rolesList = [pyatspi.ROLE_CHECK_BOX,
+                         pyatspi.ROLE_PANEL,
+                         pyatspi.ROLE_OPTION_PANE,
+                         pyatspi.ROLE_DIALOG,
                          pyatspi.ROLE_APPLICATION]
             if self.isDesiredFocusedItem(event.source, rolesList):
                 debug.println(self.debugLevel,
@@ -1335,11 +1338,11 @@
 
             # Check for 4. User name: First Name text field.
             #
-            rolesList = [pyatspi.ROLE_TEXT, \
-                        pyatspi.ROLE_PANEL, \
-                        pyatspi.ROLE_OPTION_PANE, \
-                        pyatspi.ROLE_DIALOG, \
-                        pyatspi.ROLE_APPLICATION]
+            rolesList = [pyatspi.ROLE_TEXT,
+                         pyatspi.ROLE_PANEL,
+                         pyatspi.ROLE_OPTION_PANE,
+                         pyatspi.ROLE_DIALOG,
+                         pyatspi.ROLE_APPLICATION]
             # Translators: this is the name of the field in the StarOffice
             # setup dialog that is asking for the first name of the user.
             # The translated form has to match what StarOffice/OpenOffice
@@ -1369,11 +1372,11 @@
 
             # Check for 5. Registration: Register Now radio button.
             #
-            rolesList = [pyatspi.ROLE_RADIO_BUTTON, \
-                        pyatspi.ROLE_PANEL, \
-                        pyatspi.ROLE_OPTION_PANE, \
-                        pyatspi.ROLE_DIALOG, \
-                        pyatspi.ROLE_APPLICATION]
+            rolesList = [pyatspi.ROLE_RADIO_BUTTON,
+                         pyatspi.ROLE_PANEL,
+                         pyatspi.ROLE_OPTION_PANE,
+                         pyatspi.ROLE_DIALOG,
+                         pyatspi.ROLE_APPLICATION]
             if self.isDesiredFocusedItem(event.source, rolesList):
                 debug.println(self.debugLevel,
                     "StarOffice.locusOfFocusChanged - Setup dialog: " \
@@ -1385,13 +1388,13 @@
         # Check to see if we are editing a spread sheet cell. If so, just
         # return to avoid uttering something like "Paragraph 0 paragraph".
         #
-        rolesList = [pyatspi.ROLE_PARAGRAPH, \
-                     pyatspi.ROLE_PANEL, \
-                     pyatspi.ROLE_UNKNOWN, \
-                     pyatspi.ROLE_SCROLL_PANE, \
-                     pyatspi.ROLE_PANEL, \
-                     pyatspi.ROLE_ROOT_PANE, \
-                     pyatspi.ROLE_FRAME, \
+        rolesList = [pyatspi.ROLE_PARAGRAPH,
+                     [pyatspi.ROLE_PANEL, pyatspi.ROLE_EXTENDED],
+                     [pyatspi.ROLE_UNKNOWN, pyatspi.ROLE_DOCUMENT_FRAME],
+                     pyatspi.ROLE_SCROLL_PANE,
+                     pyatspi.ROLE_PANEL,
+                     pyatspi.ROLE_ROOT_PANE,
+                     pyatspi.ROLE_FRAME,
                      pyatspi.ROLE_APPLICATION]
         if self.isDesiredFocusedItem(event.source, rolesList):
             debug.println(self.debugLevel, "StarOffice.locusOfFocusChanged - " \
@@ -1406,12 +1409,12 @@
         # locusOfFocusChanged method, which in turn will result in our
         # _getSpeechForComboBox() method being called.
         #
-        rolesList = [pyatspi.ROLE_LIST, \
-                     pyatspi.ROLE_COMBO_BOX, \
-                     pyatspi.ROLE_TOOL_BAR, \
-                     pyatspi.ROLE_PANEL, \
-                     pyatspi.ROLE_ROOT_PANE, \
-                     pyatspi.ROLE_FRAME, \
+        rolesList = [pyatspi.ROLE_LIST,
+                     pyatspi.ROLE_COMBO_BOX,
+                     pyatspi.ROLE_TOOL_BAR,
+                     pyatspi.ROLE_PANEL,
+                     pyatspi.ROLE_ROOT_PANE,
+                     pyatspi.ROLE_FRAME,
                      pyatspi.ROLE_APPLICATION]
 
         if self.isDesiredFocusedItem(event.source, rolesList) \
@@ -1462,11 +1465,11 @@
         # If we are in the slide presentation scroll pane, also announce
         # the current page tab. See bug #538056 for more details.
         #
-        rolesList = [pyatspi.ROLE_SCROLL_PANE, \
-                     pyatspi.ROLE_PANEL, \
-                     pyatspi.ROLE_PANEL, \
-                     pyatspi.ROLE_ROOT_PANE, \
-                     pyatspi.ROLE_FRAME, \
+        rolesList = [pyatspi.ROLE_SCROLL_PANE,
+                     pyatspi.ROLE_PANEL,
+                     pyatspi.ROLE_PANEL,
+                     pyatspi.ROLE_ROOT_PANE,
+                     pyatspi.ROLE_FRAME,
                      pyatspi.ROLE_APPLICATION]
 
         if self.isDesiredFocusedItem(event.source, rolesList):
@@ -1490,13 +1493,13 @@
         # try to present each of its children. See bug #538064 for
         # more details.
         #
-        rolesList = [pyatspi.ROLE_UNKNOWN,
-                     pyatspi.ROLE_UNKNOWN,
-                     pyatspi.ROLE_SCROLL_PANE, \
-                     pyatspi.ROLE_PANEL, \
-                     pyatspi.ROLE_PANEL, \
-                     pyatspi.ROLE_ROOT_PANE, \
-                     pyatspi.ROLE_FRAME, \
+        rolesList = [[pyatspi.ROLE_UNKNOWN, pyatspi.ROLE_LIST_ITEM],
+                     [pyatspi.ROLE_UNKNOWN, pyatspi.ROLE_DOCUMENT_FRAME],
+                     pyatspi.ROLE_SCROLL_PANE,
+                     pyatspi.ROLE_PANEL,
+                     pyatspi.ROLE_PANEL,
+                     pyatspi.ROLE_ROOT_PANE,
+                     pyatspi.ROLE_FRAME,
                      pyatspi.ROLE_APPLICATION]
         if self.isDesiredFocusedItem(event.source, rolesList):
             default.Script.locusOfFocusChanged(self, event,
@@ -1612,12 +1615,12 @@
         # If this is a "focus:" event for the Calc Name combo box, catch
         # it here to reduce verbosity (see bug #364407).
         #
-        rolesList = [pyatspi.ROLE_LIST, \
-                     pyatspi.ROLE_COMBO_BOX, \
-                     pyatspi.ROLE_TOOL_BAR, \
-                     pyatspi.ROLE_PANEL, \
-                     pyatspi.ROLE_ROOT_PANE, \
-                     pyatspi.ROLE_FRAME, \
+        rolesList = [pyatspi.ROLE_LIST,
+                     pyatspi.ROLE_COMBO_BOX,
+                     pyatspi.ROLE_TOOL_BAR,
+                     pyatspi.ROLE_PANEL,
+                     pyatspi.ROLE_ROOT_PANE,
+                     pyatspi.ROLE_FRAME,
                      pyatspi.ROLE_APPLICATION]
         if self.isDesiredFocusedItem(event.source, rolesList):
             debug.println(self.debugLevel, "StarOffice.onFocus - " \
@@ -1769,11 +1772,11 @@
         # so we'll do an updateBraille() just in case.
         #
         if event.type.startswith("object:state-changed:focused"):
-            rolesList = [pyatspi.ROLE_PARAGRAPH, \
-                         pyatspi.ROLE_UNKNOWN, \
-                         pyatspi.ROLE_SCROLL_PANE, \
-                         pyatspi.ROLE_PANEL, \
-                         pyatspi.ROLE_ROOT_PANE, \
+            rolesList = [pyatspi.ROLE_PARAGRAPH,
+                         [pyatspi.ROLE_UNKNOWN, pyatspi.ROLE_DOCUMENT_FRAME],
+                         pyatspi.ROLE_SCROLL_PANE,
+                         pyatspi.ROLE_PANEL,
+                         pyatspi.ROLE_ROOT_PANE,
                          pyatspi.ROLE_FRAME]
             if self.isDesiredFocusedItem(event.source, rolesList) \
                and event.source != self.currentParagraph \
@@ -1826,13 +1829,13 @@
         # different from what is displayed in that cell, then speak "has
         # formula" and append it to the braille line.
         #
-        rolesList = [pyatspi.ROLE_LIST, \
-                     pyatspi.ROLE_COMBO_BOX, \
-                     pyatspi.ROLE_PANEL, \
-                     pyatspi.ROLE_TOOL_BAR, \
-                     pyatspi.ROLE_PANEL, \
-                     pyatspi.ROLE_ROOT_PANE, \
-                     pyatspi.ROLE_FRAME, \
+        rolesList = [pyatspi.ROLE_LIST,
+                     pyatspi.ROLE_COMBO_BOX,
+                     pyatspi.ROLE_PANEL,
+                     pyatspi.ROLE_TOOL_BAR,
+                     pyatspi.ROLE_PANEL,
+                     pyatspi.ROLE_ROOT_PANE,
+                     pyatspi.ROLE_FRAME,
                      pyatspi.ROLE_APPLICATION]
         if self.isDesiredFocusedItem(event.source, rolesList):
             if orca_state.locusOfFocus.getRole() == pyatspi.ROLE_TABLE_CELL:
@@ -1936,22 +1939,22 @@
         if event.detail1 == -1:
             # ooimpress paragraph in a slide presentation.
             rolesList = [pyatspi.ROLE_PARAGRAPH,
-                         pyatspi.ROLE_UNKNOWN,
-                         pyatspi.ROLE_UNKNOWN,
-                         pyatspi.ROLE_SCROLL_PANE, \
-                         pyatspi.ROLE_PANEL, \
-                         pyatspi.ROLE_PANEL, \
-                         pyatspi.ROLE_ROOT_PANE, \
-                         pyatspi.ROLE_FRAME, \
+                         [pyatspi.ROLE_UNKNOWN, pyatspi.ROLE_LIST_ITEM],
+                         [pyatspi.ROLE_UNKNOWN, pyatspi.ROLE_DOCUMENT_FRAME],
+                         pyatspi.ROLE_SCROLL_PANE,
+                         pyatspi.ROLE_PANEL,
+                         pyatspi.ROLE_PANEL,
+                         pyatspi.ROLE_ROOT_PANE,
+                         pyatspi.ROLE_FRAME,
                          pyatspi.ROLE_APPLICATION]
 
             # oowriter paragraph in a text document.
             rolesList1 = [pyatspi.ROLE_PARAGRAPH,
-                          pyatspi.ROLE_UNKNOWN,
-                          pyatspi.ROLE_SCROLL_PANE, \
-                          pyatspi.ROLE_PANEL, \
-                          pyatspi.ROLE_ROOT_PANE, \
-                          pyatspi.ROLE_FRAME, \
+                          [pyatspi.ROLE_UNKNOWN, pyatspi.ROLE_DOCUMENT_FRAME],
+                          pyatspi.ROLE_SCROLL_PANE,
+                          pyatspi.ROLE_PANEL,
+                          pyatspi.ROLE_ROOT_PANE,
+                          pyatspi.ROLE_FRAME,
                           pyatspi.ROLE_APPLICATION]
             if settings.enableEchoByWord and \
                (self.isDesiredFocusedItem(event.source, rolesList) or
Index: src/orca/default.py
===================================================================
--- src/orca/default.py	(revision 4130)
+++ src/orca/default.py	(working copy)
@@ -6103,12 +6103,15 @@
             if current is None:
                 return False
 
-            if isinstance(role, str):
+            if not isinstance(role, list):
+                role = [role]
+
+            if isinstance(role[0], str):
                 current_role = current.getRoleName()
             else:
                 current_role = current.getRole()
 
-            if current_role != role:
+            if not current_role in role:
                 return False
             current = current.parent
 
