diff --git a/source/NVDAObjects/IAccessible/winword.py b/source/NVDAObjects/IAccessible/winword.py index acc273a6377..72da470d693 100644 --- a/source/NVDAObjects/IAccessible/winword.py +++ b/source/NVDAObjects/IAccessible/winword.py @@ -21,11 +21,14 @@ from NVDAObjects.window import DisplayModelEditableText from ..behaviors import EditableTextWithoutAutoSelectDetection from NVDAObjects.window.winword import * +from NVDAObjects.window.winword import WordDocumentTreeInterceptor + class WordDocument(IAccessible,EditableTextWithoutAutoSelectDetection,WordDocument): - treeInterceptorClass=WordDocumentTreeInterceptor - shouldCreateTreeInterceptor=False + treeInterceptorClass = WordDocumentTreeInterceptor + shouldCreateTreeInterceptor = True + TextInfo=WordDocumentTextInfo def _get_ignoreEditorRevisions(self): diff --git a/source/NVDAObjects/UIA/wordDocument.py b/source/NVDAObjects/UIA/wordDocument.py index bccd3d03783..105843d999c 100644 --- a/source/NVDAObjects/UIA/wordDocument.py +++ b/source/NVDAObjects/UIA/wordDocument.py @@ -298,6 +298,14 @@ def getTextWithFields(self,formatConfig=None): class WordBrowseModeDocument(UIABrowseModeDocument): + # This treeInterceptor starts in focus mode, thus escape should not switch back to browse mode + disableAutoPassThrough = True + + def __init__(self, rootNVDAObject): + super(WordBrowseModeDocument, self).__init__(rootNVDAObject) + self.passThrough = True + browseMode.reportPassThrough.last = True + def shouldSetFocusToObj(self,obj): # Ignore strange editable text fields surrounding most inner fields (links, table cells etc) if obj.role==controlTypes.ROLE_EDITABLETEXT and obj.UIAElement.cachedAutomationID.startswith('UIA_AutomationId_Word_Content'): @@ -341,8 +349,8 @@ def _get_role(self): return role class WordDocument(UIADocumentWithTableNavigation,WordDocumentNode,WordDocumentBase): - treeInterceptorClass=WordBrowseModeDocument - shouldCreateTreeInterceptor=False + treeInterceptorClass = WordBrowseModeDocument + shouldCreateTreeInterceptor = True announceEntireNewLine=True # Microsoft Word duplicates the full title of the document on this control, which is redundant as it appears in the title of the app itself. diff --git a/source/NVDAObjects/window/winword.py b/source/NVDAObjects/window/winword.py index 2d83596adba..cd2449b0195 100755 --- a/source/NVDAObjects/window/winword.py +++ b/source/NVDAObjects/window/winword.py @@ -1069,6 +1069,14 @@ def _get_focusableNVDAObjectAtStart(self): class WordDocumentTreeInterceptor(browseMode.BrowseModeDocumentTreeInterceptor): + # This treeInterceptor starts in focus mode, thus escape should not switch back to browse mode + disableAutoPassThrough = True + + def __init__(self, rootNVDAObject): + super(WordDocumentTreeInterceptor, self).__init__(rootNVDAObject) + self.passThrough = True + browseMode.reportPassThrough.last = True + TextInfo=BrowseModeWordDocumentTextInfo def _activateLongDesc(self,controlField):