mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1551684 part 1. Stop using [array] in nsIAccessibleTable. r=surkov
Differential Revision: https://phabricator.services.mozilla.com/D31179 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
9f71a4be73
commit
51e40973fc
@ -162,29 +162,23 @@ interface nsIAccessibleTable : nsISupports
|
||||
/**
|
||||
* Return an array of cell indices currently selected.
|
||||
*
|
||||
* @param cellsArraySize [in] length of array
|
||||
* @param cellsArray [in] array of indexes of selected cells
|
||||
* @return array of indexes of selected cells
|
||||
*/
|
||||
void getSelectedCellIndices(out unsigned long cellsArraySize,
|
||||
[retval, array, size_is(cellsArraySize)] out long cellsArray);
|
||||
Array<uint32_t> getSelectedCellIndices();
|
||||
|
||||
/**
|
||||
* Return an array of column indices currently selected.
|
||||
*
|
||||
* @param columnsArraySize [in] length of array
|
||||
* @param columnsArray [in] array of indices of selected columns
|
||||
* @return array of indices of selected columns
|
||||
*/
|
||||
void getSelectedColumnIndices(out unsigned long columnsArraySize,
|
||||
[retval, array, size_is(columnsArraySize)] out long columnsArray);
|
||||
Array<uint32_t> getSelectedColumnIndices();
|
||||
|
||||
/**
|
||||
* Return an array of row indices currently selected.
|
||||
*
|
||||
* @param rowsArraySize [in] Length of array
|
||||
* @param rowsArray [in] array of indices of selected rows
|
||||
* @return array of indices of selected rows
|
||||
*/
|
||||
void getSelectedRowIndices(out unsigned long rowsArraySize,
|
||||
[retval, array, size_is(rowsArraySize)] out long rowsArray);
|
||||
Array<uint32_t> getSelectedRowIndices();
|
||||
|
||||
/**
|
||||
* Select a row and unselects all previously selected rows.
|
||||
|
@ -392,10 +392,9 @@ function testTableSelection(aIdentifier, aCellsArray, aMsg) {
|
||||
msg + "Wrong count of selected columns for " + prettyName(aIdentifier));
|
||||
|
||||
// getSelectedColumns test
|
||||
var actualSelColsCountObj = { value: null };
|
||||
var actualSelCols = acc.getSelectedColumnIndices(actualSelColsCountObj);
|
||||
var actualSelCols = acc.getSelectedColumnIndices();
|
||||
|
||||
var actualSelColsCount = actualSelColsCountObj.value;
|
||||
var actualSelColsCount = actualSelCols.length;
|
||||
is(actualSelColsCount, selCols.length,
|
||||
msg + "Wrong count of selected columns for " + prettyName(aIdentifier) +
|
||||
"from getSelectedColumns.");
|
||||
@ -432,10 +431,9 @@ function testTableSelection(aIdentifier, aCellsArray, aMsg) {
|
||||
msg + "Wrong count of selected rows for " + prettyName(aIdentifier));
|
||||
|
||||
// getSelectedRows test
|
||||
var actualSelrowCountObj = { value: null };
|
||||
var actualSelRows = acc.getSelectedRowIndices(actualSelrowCountObj);
|
||||
var actualSelRows = acc.getSelectedRowIndices();
|
||||
|
||||
var actualSelrowCount = actualSelrowCountObj.value;
|
||||
var actualSelrowCount = actualSelRows.length;
|
||||
is(actualSelrowCount, selRows.length,
|
||||
msg + "Wrong count of selected rows for " + prettyName(aIdentifier) +
|
||||
"from getSelectedRows.");
|
||||
@ -469,10 +467,9 @@ function testTableSelection(aIdentifier, aCellsArray, aMsg) {
|
||||
msg + "Wrong count of selected cells for " + prettyName(aIdentifier));
|
||||
|
||||
// getSelectedCellIndices test
|
||||
var actualSelCellsCountObj = { value: null };
|
||||
var actualSelCells = acc.getSelectedCellIndices(actualSelCellsCountObj);
|
||||
var actualSelCells = acc.getSelectedCellIndices();
|
||||
|
||||
var actualSelCellsCount = actualSelCellsCountObj.value;
|
||||
var actualSelCellsCount = actualSelCells.length;
|
||||
is(actualSelCellsCount, selCells.length,
|
||||
msg + "Wrong count of selected cells for " + prettyName(aIdentifier) +
|
||||
"from getSelectedCells.");
|
||||
|
@ -255,68 +255,28 @@ xpcAccessibleTable::GetSelectedCells(nsIArray** aSelectedCells) {
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessibleTable::GetSelectedCellIndices(uint32_t* aCellsArraySize,
|
||||
int32_t** aCellsArray) {
|
||||
NS_ENSURE_ARG_POINTER(aCellsArraySize);
|
||||
*aCellsArraySize = 0;
|
||||
|
||||
NS_ENSURE_ARG_POINTER(aCellsArray);
|
||||
*aCellsArray = 0;
|
||||
|
||||
xpcAccessibleTable::GetSelectedCellIndices(nsTArray<uint32_t>& aCellsArray) {
|
||||
if (!Intl()) return NS_ERROR_FAILURE;
|
||||
|
||||
AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> cellsArray;
|
||||
Intl()->SelectedCellIndices(&cellsArray);
|
||||
|
||||
*aCellsArraySize = cellsArray.Length();
|
||||
*aCellsArray =
|
||||
static_cast<int32_t*>(moz_xmalloc(*aCellsArraySize * sizeof(int32_t)));
|
||||
memcpy(*aCellsArray, cellsArray.Elements(),
|
||||
*aCellsArraySize * sizeof(int32_t));
|
||||
Intl()->SelectedCellIndices(&aCellsArray);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessibleTable::GetSelectedColumnIndices(uint32_t* aColsArraySize,
|
||||
int32_t** aColsArray) {
|
||||
NS_ENSURE_ARG_POINTER(aColsArraySize);
|
||||
*aColsArraySize = 0;
|
||||
|
||||
NS_ENSURE_ARG_POINTER(aColsArray);
|
||||
*aColsArray = 0;
|
||||
|
||||
xpcAccessibleTable::GetSelectedColumnIndices(nsTArray<uint32_t>& aColsArray) {
|
||||
if (!Intl()) return NS_ERROR_FAILURE;
|
||||
|
||||
AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> colsArray;
|
||||
Intl()->SelectedColIndices(&colsArray);
|
||||
|
||||
*aColsArraySize = colsArray.Length();
|
||||
*aColsArray =
|
||||
static_cast<int32_t*>(moz_xmalloc(*aColsArraySize * sizeof(int32_t)));
|
||||
memcpy(*aColsArray, colsArray.Elements(), *aColsArraySize * sizeof(int32_t));
|
||||
Intl()->SelectedColIndices(&aColsArray);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessibleTable::GetSelectedRowIndices(uint32_t* aRowsArraySize,
|
||||
int32_t** aRowsArray) {
|
||||
NS_ENSURE_ARG_POINTER(aRowsArraySize);
|
||||
*aRowsArraySize = 0;
|
||||
|
||||
NS_ENSURE_ARG_POINTER(aRowsArray);
|
||||
*aRowsArray = 0;
|
||||
|
||||
xpcAccessibleTable::GetSelectedRowIndices(nsTArray<uint32_t>& aRowsArray) {
|
||||
if (!Intl()) return NS_ERROR_FAILURE;
|
||||
|
||||
AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> rowsArray;
|
||||
Intl()->SelectedRowIndices(&rowsArray);
|
||||
|
||||
*aRowsArraySize = rowsArray.Length();
|
||||
*aRowsArray =
|
||||
static_cast<int32_t*>(moz_xmalloc(*aRowsArraySize * sizeof(int32_t)));
|
||||
memcpy(*aRowsArray, rowsArray.Elements(), *aRowsArraySize * sizeof(int32_t));
|
||||
Intl()->SelectedRowIndices(&aRowsArray);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -55,12 +55,9 @@ class xpcAccessibleTable : public xpcAccessibleHyperText,
|
||||
NS_IMETHOD GetSelectedColumnCount(uint32_t* aSelectedColumnCount) final;
|
||||
NS_IMETHOD GetSelectedRowCount(uint32_t* aSelectedRowCount) final;
|
||||
NS_IMETHOD GetSelectedCells(nsIArray** aSelectedCell) final;
|
||||
NS_IMETHOD GetSelectedCellIndices(uint32_t* aCellsArraySize,
|
||||
int32_t** aCellsArray) final;
|
||||
NS_IMETHOD GetSelectedColumnIndices(uint32_t* aColsArraySize,
|
||||
int32_t** aColsArray) final;
|
||||
NS_IMETHOD GetSelectedRowIndices(uint32_t* aRowsArraySize,
|
||||
int32_t** aRowsArray) final;
|
||||
NS_IMETHOD GetSelectedCellIndices(nsTArray<uint32_t>& aCellsArray) final;
|
||||
NS_IMETHOD GetSelectedColumnIndices(nsTArray<uint32_t>& aColsArray) final;
|
||||
NS_IMETHOD GetSelectedRowIndices(nsTArray<uint32_t>& aRowsArray) final;
|
||||
NS_IMETHOD SelectColumn(int32_t aColIdx) final;
|
||||
NS_IMETHOD SelectRow(int32_t aRowIdx) final;
|
||||
NS_IMETHOD UnselectColumn(int32_t aColIdx) final;
|
||||
|
Loading…
Reference in New Issue
Block a user