From 86331b3d1102aacd6ee9281c2a24b123f919e0f3 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Wed, 2 Aug 2017 13:29:52 +1000 Subject: [PATCH] textInfos.TextInfo.getPresentationCategory: applications and dialogs should not be reported as a marker if they themselves are the root of the content. --- source/textInfos/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/textInfos/__init__.py b/source/textInfos/__init__.py index ae0b392aa44..188e5e21f4a 100755 --- a/source/textInfos/__init__.py +++ b/source/textInfos/__init__.py @@ -78,8 +78,11 @@ def getPresentationCategory(self, ancestors, formatConfig, reason=controlTypes.R or (role == controlTypes.ROLE_LIST and controlTypes.STATE_READONLY not in states) ): return self.PRESCAT_SINGLELINE - elif role in (controlTypes.ROLE_SEPARATOR, controlTypes.ROLE_FOOTNOTE, controlTypes.ROLE_ENDNOTE, controlTypes.ROLE_EMBEDDEDOBJECT, controlTypes.ROLE_APPLICATION, controlTypes.ROLE_DIALOG, controlTypes.ROLE_MATH): + elif role in (controlTypes.ROLE_SEPARATOR, controlTypes.ROLE_FOOTNOTE, controlTypes.ROLE_ENDNOTE, controlTypes.ROLE_EMBEDDEDOBJECT, controlTypes.ROLE_MATH): return self.PRESCAT_MARKER + elif role in (controlTypes.ROLE_APPLICATION, controlTypes.ROLE_DIALOG): + # Applications and dialogs should be reported as markers when embedded within content, but not when they themselves are the root + return self.PRESCAT_MARKER if ancestors else self.PRESCAT_LAYOUT elif role in (controlTypes.ROLE_TABLECELL, controlTypes.ROLE_TABLECOLUMNHEADER, controlTypes.ROLE_TABLEROWHEADER): return self.PRESCAT_CELL elif (