summaryrefslogtreecommitdiff
path: root/svtools/source/brwbox
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 /svtools/source/brwbox
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 'svtools/source/brwbox')
-rw-r--r--svtools/source/brwbox/brwbox1.cxx42
1 files changed, 21 insertions, 21 deletions
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index 64efb0e7023f..18a5f772613f 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -495,9 +495,9 @@ void BrowseBox::SetColumnPos( sal_uInt16 nColumnId, sal_uInt16 nPos )
commitTableEvent(
TABLE_MODEL_CHANGED,
makeAny( AccessibleTableModelChange(
- DELETE,
- 0,
- GetRowCount(),
+ COLUMNS_REMOVED,
+ -1,
+ -1,
nOldPos,
nOldPos
)
@@ -508,9 +508,9 @@ void BrowseBox::SetColumnPos( sal_uInt16 nColumnId, sal_uInt16 nPos )
commitTableEvent(
TABLE_MODEL_CHANGED,
makeAny( AccessibleTableModelChange(
- INSERT,
- 0,
- GetRowCount(),
+ COLUMNS_INSERTED,
+ -1,
+ -1,
nPos,
nPos
)
@@ -740,9 +740,9 @@ void BrowseBox::RemoveColumn( sal_uInt16 nItemId )
commitTableEvent(
TABLE_MODEL_CHANGED,
- makeAny( AccessibleTableModelChange( DELETE,
- 0,
- GetRowCount(),
+ makeAny( AccessibleTableModelChange(COLUMNS_REMOVED,
+ -1,
+ -1,
nPos,
nPos
)
@@ -814,9 +814,9 @@ void BrowseBox::RemoveColumns()
// notify a table model change
commitTableEvent(
TABLE_MODEL_CHANGED,
- makeAny ( AccessibleTableModelChange( DELETE,
- 0,
- GetRowCount(),
+ makeAny ( AccessibleTableModelChange( COLUMNS_REMOVED,
+ -1,
+ -1,
0,
nOldCount
)
@@ -1134,11 +1134,11 @@ void BrowseBox::Clear()
// notify a table model change
commitTableEvent(
TABLE_MODEL_CHANGED,
- makeAny( AccessibleTableModelChange( DELETE,
+ makeAny( AccessibleTableModelChange(ROWS_REMOVED,
0,
nOldRowCount,
- 0,
- GetColumnCount())
+ -1,
+ -1)
),
Any()
);
@@ -1221,11 +1221,11 @@ void BrowseBox::RowInserted( sal_Int32 nRow, sal_Int32 nNumRows, bool bDoPaint,
commitTableEvent(
TABLE_MODEL_CHANGED,
makeAny( AccessibleTableModelChange(
- INSERT,
+ ROWS_INSERTED,
nRow,
nRow + nNumRows,
- 0,
- GetColumnCount()
+ -1,
+ -1
)
),
Any()
@@ -1391,11 +1391,11 @@ void BrowseBox::RowRemoved( sal_Int32 nRow, sal_Int32 nNumRows, bool bDoPaint )
commitTableEvent(
TABLE_MODEL_CHANGED,
makeAny( AccessibleTableModelChange(
- DELETE,
+ ROWS_REMOVED,
nRow,
nRow + nNumRows,
- 0,
- GetColumnCount()
+ -1,
+ -1
)
),
Any()