summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2022-03-28 15:24:23 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2022-03-29 06:51:02 +0200
commit5a9340bceeee0e20817ecf23dc1e12653751ca1d (patch)
treefec9f80fadac459b65806a32f353653a9e577629 /sc
parent5371eef48a34acd06307a7b2bf898586938e27ff (diff)
a11y: Use new table model change types for row/col ins/del
This ports most existing uses of the now deprecated `AccessibleTableModelChangeType::INSERT` and `AccessibleTableModelChangeType::DELETE` to emit events of the the four new table model change types added in Change-Id I30821a5acafa4f3d1dafdfc219f3b4568d9a6e89, "a11y: Add new table model change types for row/col insertion/del" instead, which among others fixes the a11y events that are sent on the platform level for gtk3 and macOS, s. commit message of the mentioned change for more details. From all I can see, `AccessibleGridControlTable::commitEvent` is just meant to handle removal of rows, not columns, so add a corresponding assert there. (See how only row-related a11y events are emitted in `svtools/source/table/tablecontrol_impl.cxx`, and the "columns aren't selectable" comment for `AccessibleGridControlTable::isAccessibleColumnSelected`. Given that the full range of rows would previously have been sent in the `AccessibleTableModelChangeType::DELETE` event for column removal, this should still have worked in practice, since this would have cleared the whole vector, and elements would have been inserted on demand as needed again later. However, if that should ever be needed in the future, it should be handled more explicitly.) The handling of sending events when rows or columns are inserted or deleted in a Calc spreadsheet is more fundamentally broken and will be handled in a separate commit. Change-Id: Icfd5e326143e8e90cc513e430bfabbba39e7bdc6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132218 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/Accessibility/AccessibleCsvControl.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
index 7db93dbe6d25..e9a4a1deef65 100644
--- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
@@ -1163,7 +1163,7 @@ void ScAccessibleCsvGrid::SendInsertColumnEvent( sal_uInt32 nFirstColumn, sal_uI
if( nFirstColumn <= nLastColumn )
{
AccessibleTableModelChange aModelChange(
- AccessibleTableModelChangeType::INSERT, 0, implGetRowCount() - 1,
+ AccessibleTableModelChangeType::COLUMNS_INSERTED, -1, -1,
lcl_GetApiColumn( nFirstColumn ), lcl_GetApiColumn( nLastColumn ) );
Any aOldAny, aNewAny;
aNewAny <<= aModelChange;
@@ -1176,7 +1176,7 @@ void ScAccessibleCsvGrid::SendRemoveColumnEvent( sal_uInt32 nFirstColumn, sal_uI
if( nFirstColumn <= nLastColumn )
{
AccessibleTableModelChange aModelChange(
- AccessibleTableModelChangeType::DELETE, 0, implGetRowCount() - 1,
+ AccessibleTableModelChangeType::COLUMNS_REMOVED, -1, -1,
lcl_GetApiColumn( nFirstColumn ), lcl_GetApiColumn( nLastColumn ) );
Any aOldAny, aNewAny;
aNewAny <<= aModelChange;