Bug 161618 - Accessible text-changed events not fired for Calc table cells
Summary: Accessible text-changed events not fired for Calc table cells
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.2.4.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: a11y-Linux
  Show dependency treegraph
 
Reported: 2024-06-17 14:35 UTC by Joanmarie Diggs
Modified: 2024-06-18 07:32 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
pyatspi accessible-event listener (318 bytes, text/x-python)
2024-06-17 14:36 UTC, Joanmarie Diggs
Details
pyatspi accessible-event listener (that works for both, gtk3 and qt6) (331 bytes, text/x-python)
2024-06-18 07:20 UTC, Michael Weghorn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joanmarie Diggs 2024-06-17 14:35:16 UTC
Description:
Text-changed events are not fired from the table cell when text is inserted or deleted. As a result, Orca is displaying the cell's correct content in braille.

Steps to Reproduce:
1. Launch Calc
2. Launch the attached accessible event listener in a terminal
3. Type "abc" in one cell
4. Arrow to a neighboring cell and type "def"
5. Return to the cell with "abc" and press Delete

Actual Results:
In step 3, an accessible paragraph fires text-insertion events for "b" and "c" BUT not for a. Also, the focused table cell does not emit any event.

In step 4, an accessible paragraph fires text-insertion events for "e" and "f" BUT not for "d". Also, the focused table cell does not emit any event.

In step 5, neither the paragraph nor the focused table cell fires any text-changed event.



Expected Results:
In steps 3 and 4, the event would be fired for all inserted letters. While firing the event from a paragraph is fine if it's needed, the event should also be fired from the table cell whose accessible text contains the displayed contents.

In step 5, at least the focused table cell would fire a text-deletion event.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 24.2.4.2 (X86_64)
Build ID: 420(Build:2)
CPU threads: 48; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Joanmarie Diggs 2024-06-17 14:36:24 UTC
Created attachment 194781 [details]
pyatspi accessible-event listener
Comment 2 Joanmarie Diggs 2024-06-17 14:37:03 UTC
Michael, please take a look. Thanks!
Comment 3 Michael Weghorn 2024-06-18 07:20:40 UTC
Created attachment 194792 [details]
pyatspi accessible-event listener (that works for both, gtk3 and qt6)
Comment 4 Michael Weghorn 2024-06-18 07:32:38 UTC
(In reply to Joanmarie Diggs from comment #0)
> Actual Results:
> In step 3, an accessible paragraph fires text-insertion events for "b" and
> "c" BUT not for a. Also, the focused table cell does not emit any event.
> 
> In step 4, an accessible paragraph fires text-insertion events for "e" and
> "f" BUT not for "d".

Confirmed with both, gtk3 and qt6.
(For qt6, the application name is "soffice.bin", not "soffice", so I've added attachment 194792 [details] as an updated pyatspi script that accepts both.)

> Also, the focused table cell does not emit any event.
> 
> In step 5, neither the paragraph nor the focused table cell fires any
> text-changed event.

Confirmed with gtk3.

As far as I know, a different a11y object is used for the cell in edit mode. The paragraph object likely doesn't exist in step 5, as it's likely for the EditEngine used while editing text (i.e. in edit mode only), but by just pressing Del, edit mode is never entered.

For qt6, events for the focused cell are fired after steps 3, 4 and 5 once the cell loses focus. That was recently implemented in these 2 commits (not yet contained in your LO version):

    commit 5f9a955042822d05af5c04b2c852738c7e1e21a2
    Author: Michael Weghorn
    Date:   Fri Jun 7 13:03:19 2024 +0200

        tdf#158914 sc a11y: Send TEXT_CHANGED event when text changes


    commit ab5ad0c8b5056da8f699cea233dd31eceb3d80a4
    Author: Patrick Luby
    Date:   Wed May 22 10:25:10 2024 -0400

        tdf#158914 add back reusing weakly cached ScAccessibleCells

The discussion in https://gerrit.libreoffice.org/c/core/+/167961 has some more details.

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 4df2a30c57c150d30d34e4cd1641a076cf3010f6
CPU threads: 32; OS: Linux 6.7; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: CL threaded

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 4df2a30c57c150d30d34e4cd1641a076cf3010f6
CPU threads: 32; OS: Linux 6.7; UI render: default; VCL: qt6 (cairo+wayland)
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: CL threaded