Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions source/NVDAObjects/IAccessible/winword.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
12 changes: 10 additions & 2 deletions source/NVDAObjects/UIA/wordDocument.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions source/NVDAObjects/window/winword.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down