Bug 147083 - Exception in NVDA screen reader when only a single cell is selected in Calc
Summary: Exception in NVDA screen reader when only a single cell is selected in Calc
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All Windows (All)
: medium normal
Assignee: Michael Weghorn
URL:
Whiteboard: target:7.4.0
Keywords:
Depends on:
Blocks: a11y-Windows
  Show dependency treegraph
 
Reported: 2022-01-31 08:03 UTC by Michael Weghorn
Modified: 2022-01-31 16:34 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Weghorn 2022-01-31 08:03:22 UTC
originally reported against NVDA here: https://github.com/nvaccess/nvda/issues/13276

Quoting from there:

> ### Steps to reproduce:
> 
> 1) start NVDA from current git master
> 2) start LibreOffice Calc (version 7.3 or later; issue not reproducible with older versions because the relevant code path that triggers the issue is not taken)
> 3) press Shift+Right to select cells A1 and B1
> 4) press Shift+Left to leave only cell A1 selected
> 
> ### Actual behavior:
> 
> An error occurs, NVDA "beeps".
> 
> Traceback from the NVDA log:
> 
> ```
> NVDA initialized
> ERROR - eventHandler.executeEvent (15:50:59.902) - MainThread (6012):
> error executing event: selectionRemove on <NVDAObjects.Dynamic_SymphonyIATableCellEditableTextWithAutoSelectDetectionIAccessible object at 0x0E0AB4F0> with extra args of {}
> Traceback (most recent call last):
>   File "eventHandler.py", line 284, in executeEvent
>     _EventExecuter(eventName,obj,kwargs)
>   File "eventHandler.py", line 98, in __init__
>     self.next()
>   File "eventHandler.py", line 107, in next
>     return func(*args, **self.kwargs)
>   File "appModules\soffice.py", line 196, in event_selectionRemove
>     self.event_selectionAdd()
>   File "appModules\soffice.py", line 193, in event_selectionAdd
>     curFocus.announceSelectionChange()
>   File "appModules\soffice.py", line 204, in announceSelectionChange
>     reason=controlTypes.OutputReason.CHANGE
>   File "speech\speech.py", line 402, in speakObjectProperties
>     **allowedProperties,
>   File "speech\speech.py", line 453, in getObjectPropertiesSpeech
>     newPropertyValues[name]=getattr(obj,tryName)
>   File "baseObject.py", line 42, in __get__
>     return instance._getPropertyViaCache(self.fget)
>   File "baseObject.py", line 146, in _getPropertyViaCache
>     val=getterMethod(self)
>   File "appModules\soffice.py", line 174, in _get_states
>     if self.hasSelection:
>   File "baseObject.py", line 42, in __get__
>     return instance._getPropertyViaCache(self.fget)
>   File "baseObject.py", line 146, in _getPropertyViaCache
>     val=getterMethod(self)
>   File "appModules\soffice.py", line 164, in _get_hasSelection
>     and 1 < self.selectionContainer.getSelectedItemsCount()
>   File "NVDAObjects\IAccessible\__init__.py", line 1342, in getSelectedItemsCount
>     return self._getSelectedItemsCount_accSelection(maxCount)
>   File "NVDAObjects\IAccessible\__init__.py", line 1318, in _getSelectedItemsCount_accSelection
>     enumObj=sel.QueryInterface(IEnumVARIANT)
> AttributeError: 'int' object has no attribute 'QueryInterface'
> ```
> 
> ### Expected behavior:
> 
> Corrdinates of cell A1 should be announced after step 4.
> 
> ### System configuration
> #### NVDA installed/portable/running from source:
> 
> running from source
> 
> #### NVDA version:
> 
> self-compiled from git master as of commit 7735d96259d02eb8cc8d84f13a870ecfec0635b9
> 
> #### Windows version:
> 
> Windows 10 Version 21H2 (OS Build 19044.1466)
> 
> #### Name and version of other software in use when reproducing the issue:
> 
> LibreOffice (version >= 7.3, in my case current development version self-compiled from git master as of commit 86a9c860410351125708543c1050bfc0977d3b97)
> 
> #### Other information about your system:
> 
> ### Other questions
> #### Does the issue still occur after restarting your computer?
> 
> n/a
> 
> #### Have you tried any other versions of NVDA? If so, please report their behaviors.
> 
> no
> 
> #### 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
Comment 1 Michael Weghorn 2022-01-31 08:05:51 UTC
See the discussion on initial version of my PR against NVDA at https://github.com/nvaccess/nvda/pull/13277 - turns out that changes on LO side are required as well
Comment 2 Michael Weghorn 2022-01-31 08:12:16 UTC
Note that this does not show up with older versions of NVDA or LO, because announcement of selected cells has only been implemented there (so nothing happens there at all).

Announcing a single *focused* cell is not affected (e.g. when moving between cells just using the arrow key.)
Comment 3 Commit Notification 2022-01-31 16:31:35 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/00c0ee8cf0fac0c933c5ae600e99a64b1c7d4397

tdf#147083 wina11y: Return a11y object instead of child ID

It will be available in 7.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Michael Weghorn 2022-01-31 16:34:03 UTC
LibreOffice part fixed.
There's still a pending PR for NVDA at https://github.com/nvaccess/nvda/pull/13277 - but from a user perspective, that's not even strictly needed, since announcement even works without that (it still runs into an error on NVDA side, but now reaches a working fallback...).