Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for inappropriate distance announcement when pressing shift+tab from Outlook message #11925

Merged
merged 4 commits into from
Jan 20, 2021
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
3 changes: 3 additions & 0 deletions source/NVDAObjects/window/winword.py
Original file line number Diff line number Diff line change
Expand Up @@ -1402,6 +1402,9 @@ def script_tab(self,gesture):
* If not in a table, announces the distance of the caret from the left edge of the document, and any remaining text on that line.
"""
gesture.send()
self.reportTab()

def reportTab(self):
selectionObj=self.WinwordSelectionObject
inTable=selectionObj.tables.count>0 if selectionObj else False
info=self.makeTextInfo(textInfos.POSITION_SELECTION)
Expand Down
20 changes: 18 additions & 2 deletions source/appModules/outlook.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import ctypes
from hwPortUtils import SYSTEMTIME
import scriptHandler
from scriptHandler import script
import winKernel
import comHelper
import NVDAHelper
Expand All @@ -29,6 +30,7 @@
import ui
from NVDAObjects.IAccessible import IAccessible
from NVDAObjects.window import Window
from NVDAObjects.window.winword import WordDocument as BaseWordDocument
from NVDAObjects.IAccessible.winword import WordDocument, WordDocumentTreeInterceptor, BrowseModeWordDocumentTextInfo, WordDocumentTextInfo
from NVDAObjects.IAccessible.MSHTML import MSHTML
from NVDAObjects.behaviors import RowWithFakeNavigation, Dialog
Expand Down Expand Up @@ -552,7 +554,20 @@ def script_tab(self,gesture):
"kb:shift+tab":"tab",
}

class OutlookWordDocument(WordDocument):

class BaseOutlookWordDocument(BaseWordDocument):

@script(gestures=["kb:tab", "kb:shift+tab"])
def script_tab(self, gesture):
bookmark = self.makeTextInfo(textInfos.POSITION_SELECTION).bookmark
gesture.send()
info, caretMoved = self._hasCaretMoved(bookmark)
if not caretMoved:
return
self.reportTab()


class OutlookWordDocument(WordDocument, BaseOutlookWordDocument):

def _get_isReadonlyViewer(self):
# #2975: The only way we know an email is read-only is if the underlying email has been sent.
Expand All @@ -575,7 +590,8 @@ def _get_role(self):
ignoreEditorRevisions=True
ignorePageNumbers=True # This includes page sections, and page columns. None of which are appropriate for outlook.

class OutlookUIAWordDocument(UIAWordDocument):

class OutlookUIAWordDocument(UIAWordDocument, BaseOutlookWordDocument):
""" Forces browse mode to be used on the UI Automation Outlook message viewer if the message is being read)."""

def _get_isReadonlyViewer(self):
Expand Down
1 change: 1 addition & 0 deletions user_docs/en/changes.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ What's New in NVDA
- In terminal programs on Windows 10 version 1607 and later, when inserting or deleting characters in the middle of a line, the characters to the right of the caret are no longer read out. (#3200)
- This experimental fix must be manually enabled in NVDA's advanced settings panel by changing the diff algorithm to Diff Match Patch.
- Fixed access to edit fields in MCS Electronics IDE's. (#11966)
- In MS Outlook, inappropriate distance reporting when shift+tabbing from the message body to the subject field should not occur anymore. (#10254)


== Changes for Developers ==
Expand Down