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

Selecting all cells "freezes" LibreOffice Calc (when using LO >= 7.3, NVDA >= 2022.1) #13232

Closed
michaelweghorn opened this issue Jan 12, 2022 · 1 comment · Fixed by #13233
Closed
Labels
app/open-office bug/freeze p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Milestone

Comments

@michaelweghorn
Copy link
Contributor

Commit 32bf54e ("selection and merged cell announcements in LibreOffice Calc 7.3 and above (#12849)") improved announcement of selected cells for LibreOffice Calc (from version 7.3) on.

As a side-effect, NVDA currently causes a Calc freeze when all cells are selected.

Steps to reproduce:

  1. start NVDA from current git master
  2. start current development version of LibreOffice Calc (version 7.3 or later)
  3. press Ctrl+A to select all cells

Actual behavior:

LibreOffice Calc appears to be frozen and doesn't react any more.

Expected behavior:

Calc should remain responsive and some NVDA should make some announcement indicating that all cells have been selected.

System configuration

NVDA installed/portable/running from source:

running from source

NVDA version:

source-master-20d5a25

Windows version:

Windows 10 21H2 (OS Build 19044.1466)

Name and version of other software in use when reproducing the issue:

LibreOffice Calc, current git master as of commit 093c98dcb4be1c124871468f73be4b59ec99af1f

Other information about your system:

n/a

Other questions

Does the issue still occur after restarting your computer?

yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

n/a

If NVDA add-ons are disabled, is your problem still occurring?

n/a

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

n/a

@michaelweghorn
Copy link
Contributor Author

The reason for the freeze is that NVDA calls the selectedCells method on the IAccessibleTable2 interface of the Calc table, which means it requests to receive references to all currently selected cells. Since more than a billion cells are selected, it takes a long time for LibreOffice to generate those...

I plan to submit a PR with a potential approach to address this.

michaelweghorn added a commit to michaelweghorn/nvda that referenced this issue Jan 12, 2022
Link to issue number:
Fixes nvaccess#13232

Summary of the issue:
Since commit 32bf54e
("Improve selection and merged cell announcements in
LibreOffice Calc 7.3 and above (nvaccess#12849)"), information
about selected cells in LibreOffice Calc is
queried using the IAccessibleTable2 interface which is
supported from LibreOffice 7.3 on.
The call to the 'selectedCells' method on that interface
requests a list of currently selected accessibles.
Since Calc can have more than 1 billion cells, generating
the accessible objects for currently selected cells can
take a long time when many cells are selected.

Description of how this pull request fixes the issue:
Before calling the 'selectedCells' method, the number
of currently selectd cells is retrieved first and the
previous mechanism of announcing exact selected cells
is only used if at most 2000 cells are selected.
Otherwise, only the number of selected cells is announced.
For the special case where all cells are selected
(i.e. the number of selected cells is the same as the
number of the table's children), "all cells"
are reported as selected.
michaelweghorn added a commit to michaelweghorn/nvda that referenced this issue Jan 12, 2022
Link to issue number:
Fixes nvaccess#13232

Summary of the issue:
Since commit 32bf54e
("Improve selection and merged cell announcements in
LibreOffice Calc 7.3 and above (nvaccess#12849)"), information
about selected cells in LibreOffice Calc is
queried using the IAccessibleTable2 interface which is
supported from LibreOffice 7.3 on.
The call to the 'selectedCells' method on that interface
requests a list of currently selected accessibles.
Since Calc can have more than 1 billion cells, generating
the accessible objects for currently selected cells can
take a long time when many cells are selected.

Description of how this pull request fixes the issue:
Before calling the 'selectedCells' method, the number
of currently selectd cells is retrieved first and the
previous mechanism of announcing exact selected cells
is only used if at most 2000 cells are selected.
Otherwise, only the number of selected cells is announced.
For the special case where all cells are selected
(i.e. the number of selected cells is the same as the
number of the table's children), "all cells"
are reported as selected.
michaelweghorn added a commit to michaelweghorn/nvda that referenced this issue Jan 21, 2022
Link to issue number:
Fixes nvaccess#13232

Summary of the issue:
Since commit 32bf54e
("Improve selection and merged cell announcements in
LibreOffice Calc 7.3 and above (nvaccess#12849)"), information
about selected cells in LibreOffice Calc is
queried using the 'IAccessibleTable2' interface which is
supported from LibreOffice 7.3 on.
The call to the 'selectedCells' method on that interface
requests a list of a11y objects for all currently selected
cells, of which only the first and the last one are
actually needed for the announcement of selected cells.
Since Calc spreadsheets have more than a billion cells,
this is inefficient when many cells are selected
and resulted in Calc becoming unresponsive.

Description of how this pull request fixes the issue:
Instead of using the 'selectedCells' method from the
'IAccessibleTable2' interface, the first and last
selected cell are now retrieved using the
'accSelection' on the 'IAccessible' object of the table,
which avoids that a11y objects for all other selected
cells have to be generated as well.
@seanbudd seanbudd added p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation. labels Jun 9, 2022
seanbudd pushed a commit that referenced this issue Jun 30, 2022
Fixes #13232

Summary of the issue:
Since PR #12849, information about selected cells in LibreOffice Calc is queried using the 'IAccessibleTable2' interface which is supported from LibreOffice 7.3 on.
The call to the 'selectedCells' method on that interface requests a list of a11y objects for all currently selected cells, of which only the first and the last one are actually needed for the announcement of selected cells.
Since Calc spreadsheets have more than a billion cells, this is inefficient when many cells are selected and resulted in Calc becoming unresponsive.

Description of how this pull request fixes the issue:
Instead of using the 'selectedCells' method from the 'IAccessibleTable2' interface, the first and last selected cell are now retrieved using the 'accSelection' on the 'IAccessible' object of the table, which avoids that a11y objects for all other selected cells have to be generated as well.

Testing strategy:
use LibreOffice Calc 7.3 or above
select all cells in LO Calc and check that NVDA announces coordinate + content of the first cell (A1) and the last cell (AMJ1048576) in the spreadsheet
test a few other selections in the spreadsheet (use shift + arrow keys to increase/decrease selection)
@nvaccessAuto nvaccessAuto added this to the 2022.3 milestone Jun 30, 2022
michaelweghorn added a commit to michaelweghorn/nvda that referenced this issue May 18, 2023
 ### Link to issue number:

Fixes nvaccess#13232

 ### Summary of the issue:

Announcement of the status bar in LibreOffice (e.g. triggered
by NVDA+End) didn't work because the default implementations
do not work for the LibreOffice case.

 ### Description of user facing changes

Announcement of the status bar (e.g. triggered
by NVDA+End) works for LibreOffice.

 ### Description of development approach

Override the default app module implementation to retrieve the status bar
and announce its text in the LibreOffice app module, since
the default implementations are not sufficient for the
LibreOffice case:

* To retrieve the status bar object, locate the descendant
  with the corresponding role, but only descend into children
  of role `ROOTPANE` and `WINDOW` for performance
  reasons.

* To generate text from the status bar object, retrieve the text
  of each status bar child using the IAccessibleText interface.
  (The default implementation in api.py only uses the object names
  and values, which are both empty.)

 ### Testing strategy:

1) start NVDA
2) start LibreOffice Writer
3) Press NVDA+End key to trigger announcement of status line
4) check that the visible content of the status bar is announced
   (e.g. something like "Page 1 of 1 5 words, 20 characters  Default
   Page Style English (United States) {en-US}       80%")
5) repeat the above steps, but use LibreOffice Calc, Draw and Impress
   instead of Writer (in step 2)

 ### Known issues with pull request:

none

 ### Change log entries:

Changes
`Announcement of the status bar (e.g. triggered
by NVDA+End) works for LibreOffice. (nvaccess#13232)`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app/open-office bug/freeze p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants