Skip to content

soffice: Don't announce previous cell coordinates (as selection)#15099

Merged
seanbudd merged 4 commits into
nvaccess:masterfrom
michaelweghorn:michaelweghorn/issue15098
Jul 6, 2023
Merged

soffice: Don't announce previous cell coordinates (as selection)#15099
seanbudd merged 4 commits into
nvaccess:masterfrom
michaelweghorn:michaelweghorn/issue15098

Conversation

@michaelweghorn

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #15098

Summary of the issue:

When announcement of cell coordinates is disabled in NVDA settings, moving focus in a Calc spreadsheet resulted in the coordinates of the previously focused cell to be announced.
This is caused by Libreoffice sending an EVENT_OBJECT_SELECTIONREMOVE event on the previously focused cell before sending an EVENT_OBJECT_FOCUS event for the newly focused cell
(s. https://git.libreoffice.org/core/+/refs/heads/master/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx#588 ). This triggered announcement of the previously focused cell in the LibreOffice app module handling for cell selection changes.

Description of user facing changes

No more announcement of the previosly focused cell when switching focus to another one in LibreOffice Calc and announcement of cell coordinates is disabled in NVDA settings.

Description of development approach

In the LibreOffice app module specific code that handles EVENT_OBJECT_SELECTIONREMOVE and EVENT_OBJECT_SELECTIONADD for table cells, only trigger announcement of the selection (or currently focused cell) if a selection actually exists, i.e. the number of selected cells is positive. (Announcement of a focused cell when no selection exists still happens in response to the corresponding event indicating focus change.)

Testing strategy:

  1. Disable announcement of cell coordinates in NVDA's settings: under "Document Formatting" -> group "Table information", uncheck the "Cell coordinates" checkbox
  2. start LibreOffice Calc with a fresh document
  3. press the arrow right key a few times and check that NVDA does not announce coordinates
  4. move arond a bit further using the arrow keys and check that NVDA does not announce coordinates
  5. select a few cells by pressing Shift + arrow keys and check that coordinates are still announced for the selection
  6. enable announcement of cell coordinates again in NVDA settings and repeat steps 2-5, now checking that cell coordinates are always announced

Known issues with pull request:

none

Change log entries:

Bug fixes
When moving to a different cell in LibreOffice Calc, NVDA no longer incorrectly announces the coordinates of the previously focused cell when cell coordinate announcement is diabled in NVDA's settings. (#15098)
New features

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 413585e537

 ### Link to issue number:

Fixes nvaccess#15098

 ### Summary of the issue:

When announcement of cell coordinates is disabled in NVDA settings,
moving focus in a Calc spreadsheet resulted in the coordinates of
the previously focused cell to be announced.
This is caused by Libreoffice sending an EVENT_OBJECT_SELECTIONREMOVE
event on the previously focused cell before sending an EVENT_OBJECT_FOCUS
event for the newly focused cell
(s.  https://git.libreoffice.org/core/+/refs/heads/master/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx#588 ).
This triggered announcement of the previously focused cell in the
LibreOffice app module handling for cell selection changes.

 ### Description of user facing changes

No more announcement of the previosly focused cell when switching focus
to another one in LibreOffice Calc and announcement of cell coordinates
is disabled in NVDA settings.

 ### Description of development approach

In the LibreOffice app module specific code that handles
EVENT_OBJECT_SELECTIONREMOVE and EVENT_OBJECT_SELECTIONADD for table cells,
only trigger announcement of the selection (or currently focused cell)
if a selection actually exists, i.e. the number of selected cells is positive.
(Announcement of a focused cell when no selection exists still happens
in response to the corresponding event indicating focus change.)

 ### Testing strategy:

1) Disable announcement of cell coordinates in NVDA's settings: under "Document Formatting" -> group "Table information", uncheck the "Cell coordinates" checkbox
2) start LibreOffice Calc with a fresh document
3) press the arrow right key a few times and check that NVDA does not announce coordinates
4) move arond a bit further using the arrow keys and check that NVDA does not announce coordinates
5) select a few cells by pressing Shift + arrow keys and check that coordinates are still announced for the selection
6) enable announcement of cell coordinates again in NVDA settings and repeat steps 2-5, now checking that cell coordinates are always announced

 ### Known issues with pull request:

none

 ### Change log entries:

Bug fixes
`When moving to a different cell in LibreOffice Calc, NVDA no longer incorrectly announces the coordinates of the previously focused cell when cell coordinate announcement is diabled in NVDA's settings. (nvaccess#15098)
@michaelweghorn michaelweghorn force-pushed the michaelweghorn/issue15098 branch from 21d4ffe to e8b00da Compare July 4, 2023 08:55
@michaelweghorn michaelweghorn marked this pull request as ready for review July 4, 2023 12:13
@michaelweghorn michaelweghorn requested a review from a team as a code owner July 4, 2023 12:13
Comment thread source/appModules/soffice.py Outdated

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@seanbudd seanbudd merged commit 1466654 into nvaccess:master Jul 6, 2023
@nvaccessAuto nvaccessAuto added this to the 2023.2 milestone Jul 6, 2023
@michaelweghorn michaelweghorn deleted the michaelweghorn/issue15098 branch July 6, 2023 04:30
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.

LibreOffice Calc: Incorrect cell coordinates announced when cell coordinate announcement is disabled

4 participants