Skip to content

App module for Winword to gather the code specific to MSWord#11824

Merged
feerrenrut merged 4 commits into
nvaccess:masterfrom
CyrilleB79:winwordAppModule
Nov 27, 2020
Merged

App module for Winword to gather the code specific to MSWord#11824
feerrenrut merged 4 commits into
nvaccess:masterfrom
CyrilleB79:winwordAppModule

Conversation

@CyrilleB79

@CyrilleB79 CyrilleB79 commented Nov 9, 2020

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #11196 (with adapted translation for the gestures.ini file)

Summary of the issue:

The NVDAObjects\window\winword.WordDocument class gathers some scripts that apply to word documents either in MS Word than in MS Outlook.
For Outlook, there is a specific app module defining among others a WordDocument subclass embedding the code specific to Outlook that does not apply to word.
However a subclass of NVDAObjects\window\winword.WordDocument applying to MS Word document only (i.e. not to Outlook one) is missing to embed code that applies to Word but not to Outlook. I have found two cases where it is missing.

Case 1: script toggleChangeTracking

Since change tracking is a Word only feature, the toggleChangeTracking script should not be called in Outlook. When using French MS Office and NVDA, we have control+shift+R being the shortcut for change tracking toggle in MS Word, but control+shift+R is the shortcut for "Reply all" in Outlook. This may cause unexpected errors (see #11196 for details).

Sometimes also one can hear a part of change tracking state reporting when pressing control+shift+R (reply all); this is however interrupted by new focused message window.

Case 2: script toggleAlignment

Toggle paragraph alignment commands exist both in Word and Outlook. However in French version they do not have exactly the same shortcuts (Office 2016):

Command Word Outlook
Align left control+shift+G control+L
Align right control+shift+D control+R or control+shift+G

In present version however, NVDA does not allow to assign separate shortcuts for Word or Outlook.

Description of how this pull request fixes the issue:

  • Created a specific app module for MS Word.
  • The code common to MS Word and other applications (such as MS Outlook) should not be stored in this module but in shared files such as NVDAObjects/window/winword.py and similar.
  • For now this appModule contains only the toggleChangeTracking script since this feature is available in Word only.

When gestures.ini is translated accordingly, this will solve the case 1.

Regarding case 2, NVDA's French gestures.ini file may modified to associate scripts only where applicable (Word, Outlook or Word+Outlook), provided that all versions of Office have the same shortcuts. If this is not the case, the modifications may still be done at user level in the personal gestures.inifile. I will investigate this point with other French translators and users.

Testing performed:

Just for test purpose, I have modified the French gesture.ini as follows:

diff --git a/source/locale/fr/gestures.ini b/source/locale/fr/gestures.ini
index 200ad026e..d8c78a736 100644
--- a/source/locale/fr/gestures.ini
+++ b/source/locale/fr/gestures.ini
@@ -9,11 +9,14 @@
 	toggleRightMouseButton = kb(laptop):nvda+control+*
 
 [NVDAObjects.window.winword.WordDocument]
-	None = kb:control+b, kb:control+[, kb:control+], "kb:control+shift+,", kb:control+shift+., kb:control+l, kb:control+r, kb:control+shift+e, kb:control+1, kb:control+alt+2
+	None = kb:control+b, kb:control+[, kb:control+], "kb:control+shift+,", kb:control+shift+., kb:control+shift+e, kb:control+1, kb:control+alt+2
 	increaseDecreaseFontSize = kb:control+shift+<, kb:control+<, kb:control+alt+<, kb:control+alt+shift+<
 	toggleBold = kb:control+g, kb:control+shift+b
-	toggleAlignment = kb:control+shift+g, kb:control+shift+d
+	toggleAlignment = kb:control+shift+d
+[appModules.winword.WinwordWordDocument]
+	None = kb:control+l, kb:control+r
 	toggleChangeTracking = kb:control+shift+r
+	toggleAlignment = kb:control+shift+g, 
 [NVDAObjects.window.excel.ExcelWorksheet]
 	changeSelection= kb:control+*

Or download the modified French gestures.ini file
gestures.ini.txt.

The changes in the modified gestures.inifile are the following:

  • Created a new section [appModules.winword.WinwordWordDocument].
  • Moved the changeTracking script remapping in this section
  • Unmapped kb:control+l and kb:control+r in this section rather than in [NVDAObjects.window.winword.WordDocument]
  • Moved toggleAlignment mapping to kb:control+shift+g in this section rather than in [NVDAObjects.window.winword.WordDocument]

With this file, I have checked that:

  • control+shift+R calls toggleChangeTracking script only in MS Word and not in Outlook: the change tracking status is not reported anymore in Outlook.
  • All the scripts in the table of Case 2 description are now reporting paragraph alignment.

Known issues with pull request:

  • French gesture.ini need to be modified accordingly; I will take care of it
  • Maybe some other language translators will need to make some equivalent changes. I will send a message to translation mailing list when alpha is merged to beta for new translation.
  • There may be some NVDA add-on for Word, at least in French community there is Word Access Enhancement from @paulber19. Author(s) of these add-ons will need to take into account that word has noww a built-in app module.

Change log entry:

Bug fixes:
In Outlook French version, the shortcut for 'Reply all' (control+shift+R) should be working again. (#11196)

Changes for developers:
It is now possible to define separate gestures for Outlook and Word document. (#11196)

The code common to MS Word and other applications (such as MS Outlook) should not be stored in this module but in common object files such as NVDAObjects/window/winword.py.
For now this appModule contains only toggleChangeTracking script since this feature is available in Word only.
Comment thread source/appModules/winword.py Outdated
Comment thread source/appModules/winword.py Outdated
Co-authored-by: Leonard de Ruijter <leonardder@users.noreply.github.com>
LeonarddeR
LeonarddeR previously approved these changes Nov 20, 2020
@CyrilleB79

Copy link
Copy Markdown
Contributor Author

I have just edited the initial description, Change log entry section, to add a line in the Change for developers section.

@feerrenrut this PR has been reviewed.
If you plan to integrate it in 2020.4, may I ask you to merge it before the next merge of alpha to beta if possible? This PR may require or allow local gesture.ini modification by translators. Merging it early would allow me to send a message about this change on the translator mailing list.
Thanks.

Regarding French gesture.ini file, I will take care of it.

@feerrenrut feerrenrut self-requested a review November 26, 2020 09:48
@feerrenrut feerrenrut self-assigned this Nov 27, 2020

@feerrenrut feerrenrut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @CyrilleB79

@feerrenrut feerrenrut merged commit f0e82c7 into nvaccess:master Nov 27, 2020
@nvaccessAuto nvaccessAuto added this to the 2020.4 milestone Nov 27, 2020
@CyrilleB79 CyrilleB79 deleted the winwordAppModule branch November 27, 2020 08:10
@CyrilleB79

Copy link
Copy Markdown
Contributor Author

For reference the fr gesture.ini file has been updated in SVN screenreadertranslation repo, revision 59653.
For now, only the toggleChangeTracking script mapping has been modified, i.e. mapped to Word only rather than also to outlook.
No mapping change regarding alignment scripts has been done yet ; I still need to check if the difference seen between Word and Outlook can also be seen on other versions of Office.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MS Outlook: reply all shortcut not always working

4 participants