Bugzilla – Attachment 174894 Details for
Bug 100086
Accessible events for selection of multiple cells on sheet are not correctly exposed to screen reader
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
NVDA demo patch to use IAccessibleTable2 and IAccessibleTableCell interfaces in LO
0001-DEMO-soffice-Log-selected-cells-using-IAccessibleTab.patch (text/plain), 4.17 KB, created by
Michael Weghorn
on 2021-09-08 14:38:05 UTC
(
hide
)
Description:
NVDA demo patch to use IAccessibleTable2 and IAccessibleTableCell interfaces in LO
Filename:
MIME Type:
Creator:
Michael Weghorn
Created:
2021-09-08 14:38:05 UTC
Size:
4.17 KB
patch
obsolete
>From 6d883a6a6cfa2481d567119f9fee55f22489c3fa Mon Sep 17 00:00:00 2001 >From: Michael Weghorn <m.weghorn@posteo.de> >Date: Mon, 15 Mar 2021 16:44:17 +0100 >Subject: [PATCH] DEMO: soffice: Log selected cells using > IAccessibleTable{2,Cell} > >This is just a demo use of the IAccessibleTable2 and >IAccessibleTableCell interfaces in LibreOffice. > >Support for those interfaces has recently been added to LibreOffice. > >Sample demo use: > >* start LO Calc (current development version including the > newly added support for the 2 interfaces) >* press Shift + right arrow key a few times to add more > cells to the selection >* check NVDA log > >-> contains e.g. > >> WARNING - stdout (14:50:22.874) - MainThread (9692): >> 2 cells selected >> WARNING - stdout (14:50:22.882) - MainThread (9692): >> selected cell - name: A1, value: None, column: 0, row: 0 >> WARNING - stdout (14:50:22.883) - MainThread (9692): >> selected cell - name: B1, value: None, column: 1, row: 0 >> WARNING - stdout (14:50:22.884) - MainThread (9692): >> 2 cells selected >> WARNING - stdout (14:50:22.892) - MainThread (9692): >> selected cell - name: A1, value: None, column: 0, row: 0 >> WARNING - stdout (14:50:22.893) - MainThread (9692): >> selected cell - name: B1, value: None, column: 1, row: 0 >> WARNING - stdout (14:50:23.150) - MainThread (9692): >> 3 cells selected >> WARNING - stdout (14:50:23.150) - MainThread (9692): >> selected cell - name: A1, value: None, column: 0, row: 0 >> WARNING - stdout (14:50:23.150) - MainThread (9692): >> selected cell - name: B1, value: None, column: 1, row: 0 >> WARNING - stdout (14:50:23.150) - MainThread (9692): >> selected cell - name: C1, value: None, column: 2, row: 0 >> WARNING - stdout (14:50:23.368) - MainThread (9692): >> 4 cells selected >> WARNING - stdout (14:50:23.368) - MainThread (9692): >> selected cell - name: A1, value: None, column: 0, row: 0 >> WARNING - stdout (14:50:23.384) - MainThread (9692): >> selected cell - name: B1, value: None, column: 1, row: 0 >> WARNING - stdout (14:50:23.384) - MainThread (9692): >> selected cell - name: C1, value: None, column: 2, row: 0 >> WARNING - stdout (14:50:23.384) - MainThread (9692): >> selected cell - name: D1, value: None, column: 3, row: 0 >--- > source/appModules/soffice.py | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > >diff --git a/source/appModules/soffice.py b/source/appModules/soffice.py >index 88d06a089..3a3880746 100755 >--- a/source/appModules/soffice.py >+++ b/source/appModules/soffice.py >@@ -11,6 +11,7 @@ import appModuleHandler > import controlTypes > import textInfos > import colors >+import winUser > from compoundDocuments import CompoundDocument > from NVDAObjects.JAB import JAB, JABTextInfo > from NVDAObjects.IAccessible import IAccessible, IA2TextTextInfo >@@ -211,6 +212,33 @@ class SymphonyTableCell(IAccessible): > def _get_cellCoordsText(self): > return super(SymphonyTableCell,self).name > >+ def event_selectionAdd(self): >+ # DEMO: use IAccessibleTable2 and IAccessibleTableCell information to print info what cells are currently selected >+ if hasattr(self, 'table') and hasattr(self.table, 'IAccessibleTable2Object'): >+ selection = self.table.IAccessibleTable2Object.selectedCells >+ >+ # s. doc for IAccessibleTable2::selectedCells; out params are returned in tuple >+ cells = selection[0] >+ nSelectedCellCount = selection[1] >+ >+ ## NOTE: just to double-check this actually returns the same >+ assert(nSelectedCellCount == self.table.IAccessibleTable2Object.nSelectedCells) >+ >+ >+ print('{} cells selected'.format(nSelectedCellCount)) >+ >+ for i in range(0, nSelectedCellCount): >+ cell = cells[i] >+ # query for IAccessibleTableCell interface >+ iaTableCellObject = cell.QueryInterface(IA2.IAccessibleTableCell) >+ row = iaTableCellObject.rowIndex >+ column = iaTableCellObject.columnIndex >+ name = iaTableCellObject.QueryInterface(IA2.IAccessible2).accName(winUser.CHILDID_SELF) >+ value = iaTableCellObject.QueryInterface(IA2.IAccessible2).accValue(winUser.CHILDID_SELF) >+ print('selected cell - name: {}, value: {}, column: {}, row: {}'.format(name, value, column, row)) >+ >+ return super(SymphonyTableCell, self).event_selectionAdd() >+ > name=None > > def _get_states(self): >-- >2.33.0.windows.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 100086
: 174894