diff --git a/source/NVDAObjects/window/winword.py b/source/NVDAObjects/window/winword.py index b85c2e9db1a..bcdcecaff6c 100755 --- a/source/NVDAObjects/window/winword.py +++ b/source/NVDAObjects/window/winword.py @@ -1372,24 +1372,6 @@ def script_increaseDecreaseFontSize(self,gesture): # Translators: a message when increasing or decreasing font size in Microsoft Word ui.message(_("{size:g} point font").format(size=val)) - def script_toggleChangeTracking(self, gesture): - if not self.WinwordDocumentObject: - # We cannot fetch the Word object model, so we therefore cannot report the status change. - # The object model may be unavailable because this is a pure UIA implementation such as Windows 10 Mail, - # or it's within Windows Defender Application Guard. - # In this case, just let the gesture through and don't report anything. - return gesture.send() - val = self._WaitForValueChangeForAction( - lambda: gesture.send(), - lambda: self.WinwordDocumentObject.TrackRevisions - ) - if val: - # Translators: a message when toggling change tracking in Microsoft word - ui.message(_("Change tracking on")) - else: - # Translators: a message when toggling change tracking in Microsoft word - ui.message(_("Change tracking off")) - @script(gesture="kb:control+shift+8") def script_toggleDisplayNonprintingCharacters(self, gesture): if not self.WinwordWindowObject: @@ -1514,7 +1496,6 @@ def initOverlayClass(self): "kb:control+1":"changeLineSpacing", "kb:control+2":"changeLineSpacing", "kb:control+5":"changeLineSpacing", - "kb:control+shift+e": "toggleChangeTracking", "kb:control+pageUp": "caret_moveByLine", "kb:control+pageDown": "caret_moveByLine", } diff --git a/source/appModules/winword.py b/source/appModules/winword.py new file mode 100644 index 00000000000..088d35c48a4 --- /dev/null +++ b/source/appModules/winword.py @@ -0,0 +1,42 @@ +# A part of NonVisual Desktop Access (NVDA) +# This file is covered by the GNU General Public License. +# See the file COPYING for more details. +# Copyright (C) 2019-2020 NV Access Limited, Cyrille Bougot + +""" App module for Microsoft Word. +Word and Outlook share a lot of code and components. This app module gathers the code that is relevant for +Microsoft Word only. +""" + +import appModuleHandler +from scriptHandler import script +import ui +from NVDAObjects.IAccessible.winword import WordDocument + + +class AppModule(appModuleHandler.AppModule): + + def chooseNVDAObjectOverlayClasses(self, obj, clsList): + if WordDocument in clsList: + clsList.insert(0, WinwordWordDocument) + + +class WinwordWordDocument(WordDocument): + + @script(gesture="kb:control+shift+e") + def script_toggleChangeTracking(self, gesture): + if not self.WinwordDocumentObject: + # We cannot fetch the Word object model, so we therefore cannot report the status change. + # The object model may be unavailable because it's within Windows Defender Application Guard. + # In this case, just let the gesture through and don't report anything. + return gesture.send() + val = self._WaitForValueChangeForAction( + lambda: gesture.send(), + lambda: self.WinwordDocumentObject.TrackRevisions + ) + if val: + # Translators: a message when toggling change tracking in Microsoft word + ui.message(_("Change tracking on")) + else: + # Translators: a message when toggling change tracking in Microsoft word + ui.message(_("Change tracking off")) diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index a50d89556fa..7ce7551e2b5 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -56,12 +56,14 @@ What's New in NVDA - A freeze of several seconds experienced by a small amount of users when arrowing between cells in Excel should no longer occur. (#11818) - In Microsoft Teams builds with version numbers like 1.3.00.28xxx, NVDA no longer fails reading messages in chats or Teams channels due to an incorrectly focused menu. (#11821) - Text marked both as being a spelling and grammar error at the same time in Google Chrome will be appropriately announced as both a spelling and grammar error by NVDA. (#11787) +- When using Outlook (French locale), the shortcut for 'Reply all' (control+shift+R) works again. (#11196) == Changes for Developers == - System tests can now send keys using spy.emulateKeyPress, which takes a key identifier that conforms to NVDA's own key names, and by default also blocks until the action is executed. (#11581) - NVDA no longer requires the current directory to be the NVDA application directory in order to function. (#6491) - The aria live politeness setting for live regions can now be found on NVDA Objects using the liveRegionPoliteness property. (#11596) +- It is now possible to define separate gestures for Outlook and Word document. (#11196) = 2020.3 =