Skip to content

Report the state of cell formatting when using formatting shortcuts in Excel#14923

Merged
michaelDCurran merged 3 commits into
nvaccess:masterfrom
CyrilleB79:excelReportFormattingShortcuts
May 15, 2023
Merged

Report the state of cell formatting when using formatting shortcuts in Excel#14923
michaelDCurran merged 3 commits into
nvaccess:masterfrom
CyrilleB79:excelReportFormattingShortcuts

Conversation

@CyrilleB79

@CyrilleB79 CyrilleB79 commented May 12, 2023

Copy link
Copy Markdown
Contributor

Context: Modifications that I have done time ago for myself when working with Excel sheets.

Link to issue number:

None

Summary of the issue:

In Excel, when applying formatting to cells, nothing is reported. Instead, in Word, toggling bold, italic or underline is reported.

Description of user facing changes

When using Excel shortcuts to toggle the format of a full cell in Excel, the result is now reported. The following toggle are supported:

  • bold: control+b or control+shift+2
  • italic: control+I or control+shift+3
  • underline: control+U or control+shift+4
  • strikethrough: control+shift+5 (Note: did not find any other shortcut for it)

Description of development approach

  • As done for Word text, use object model to look at the properties of the cell after the shortcut is executed.
  • Copied the polling function of Word's code to check for value changes polling the object model. (I had initially thought that it was not required, but testing on another system, I have found that it was required)
  • Implement the scripts on the whole worksheet so that the scripts work either on single cell or on multi-cell selections. Taking advantage that both excelCellObject and excelRangeObject have a font attribute.

Testing strategy:

Tested all listed shortcuts on single cell and on multi-cell selection.

Tested on the following versions:

  • Microsoft® Excel® 2016 (16.0.5387.1000) MSO (16.0.5366.1000) 32 bits
  • Microsoft® Excel® 2016 MSO (Version 2304 Build 16.0.16327.20200) 32 bits

Known issues with pull request:

  • This PR does not handle the case of formatting shortcuts when editing a cell.
  • On the contrary to Word's code, I have not implemented a check that Excel Object Model was available, since it does not seem to be implemented elsewhere in Excel's code. I do not know if there is a use case for it but I think that it would not be supported by existing code of NVDA anyway.

Change log entries:

New features
The result of usual formatting shortcuts on Excel cells will now be reported.

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • Security precautions taken.

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 36d2ad3a68

@CyrilleB79 CyrilleB79 force-pushed the excelReportFormattingShortcuts branch from 5e35658 to 1ac1c5a Compare May 12, 2023 13:38
@CyrilleB79 CyrilleB79 marked this pull request as ready for review May 12, 2023 22:38
@CyrilleB79 CyrilleB79 requested a review from a team as a code owner May 12, 2023 22:38
@CyrilleB79 CyrilleB79 requested a review from seanbudd May 12, 2023 22:38
@michaelDCurran michaelDCurran merged commit 648a5d3 into nvaccess:master May 15, 2023
@nvaccessAuto nvaccessAuto added this to the 2023.2 milestone May 15, 2023
@CyrilleB79 CyrilleB79 deleted the excelReportFormattingShortcuts branch May 15, 2023 11:42
josephsl pushed a commit to josephsl/nvda that referenced this pull request May 16, 2023
…n Excel (nvaccess#14923)

In Excel, when applying formatting to cells, nothing is reported. Instead, in Word, toggling bold, italic or underline is reported.

Description of user facing changes
When using Excel shortcuts to toggle the format of a full cell in Excel, the result is now reported. The following toggle are supported:
• bold: control+b or control+shift+2
• italic: control+I or control+shift+3
• underline: control+U or control+shift+4
• strikethrough: control+shift+5 (Note: did not find any other shortcut for it)

Description of development approach
• As done for Word text, use object model to look at the properties of the cell after the shortcut is executed.
• Copied the polling function of Word's code to check for value changes polling the object model. (I had initially thought that it was not required, but testing on another system, I have found that it was required)
• Implement the scripts on the whole worksheet so that the scripts work either on single cell or on multi-cell selections. Taking advantage that both excelCellObject and excelRangeObject have a font attribute.
seanbudd pushed a commit that referenced this pull request Sep 26, 2023
Fixes #15506
Fix-up of #14923

Summary of the issue:
When peforming tests for #14923, I have wrongly assumed that Excel cell formatting shortcuts were control+shift+2/3/4/5. This assumption was based on my tests with Excel's interface changed to English on my system. However, it seems that the keyboard layout when Excel is started has also an impact on the shortcuts containing digits (see discussion in #14923).
The actual shortcuts are control+2/3/4/5, as described in Microsoft documentation and as confirmed starting Excel with English GUI and English keyboard layout.

Description of user facing changes
On English systems (and probably many others), Excel cell formatting shortcuts control+2/3/4/5 will have their effect reported correctly. shift+control+2/3/4/5 will not report inappropriately formatting information on English systems.

Description of development approach
Modified the gesture definition.
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.

4 participants