pyuno/qa/pytests/insertremovecells.py | 12 ++++++------ uitest/libreoffice/calc/document.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-)
New commits: commit 9928f139e858768047b8dea0405720395beb18cd Author: Chenxiong Qi <qcxh...@gmail.com> AuthorDate: Thu Sep 1 08:44:20 2022 +0800 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Sep 5 16:05:56 2022 +0200 tdf#97361 replace getCellByPosition with access by subscript Signed-off-by: Chenxiong Qi <qcxh...@gmail.com> Change-Id: I50d6e29c34e3cf72cdf0afc9f118fafc3c144eaf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139141 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/pyuno/qa/pytests/insertremovecells.py b/pyuno/qa/pytests/insertremovecells.py index f1c0fa176113..1d850a65d9fd 100644 --- a/pyuno/qa/pytests/insertremovecells.py +++ b/pyuno/qa/pytests/insertremovecells.py @@ -57,19 +57,19 @@ class InsertRemoveCells(unittest.TestCase): (3, 3, '6', 6.0), (5, 1, '1', 1.0), ) - for pos in empty_cells: - cell = sheet.getCellByPosition(*pos) + for col, row in empty_cells: + cell = sheet[row,col] self.assertEqual('EMPTY', cell.Type.value) - for x, y, f, s, val in formula_cells: - cell = sheet.getCellByPosition(x, y) + for col, row, f, s, val in formula_cells: + cell = sheet[row,col] self.assertEqual('FORMULA', cell.Type.value) self.assertEqual(f, cell.getFormula()) self.assertEqual(s, cell.String) self.assertEqual(val, cell.Value) - for x, y, s, val in value_cells: - cell = sheet.getCellByPosition(x, y) + for col, row, s, val in value_cells: + cell = sheet[row,col] self.assertEqual(s, cell.String) self.assertEqual(val, cell.Value) diff --git a/uitest/libreoffice/calc/document.py b/uitest/libreoffice/calc/document.py index 40a2ec635e3c..b837bda72521 100644 --- a/uitest/libreoffice/calc/document.py +++ b/uitest/libreoffice/calc/document.py @@ -24,7 +24,7 @@ def get_cell_by_position(document, tab, column, row): row -- The 0-based row number """ sheet = get_sheet_from_doc(document, tab) - return sheet.getCellByPosition(column, row) + return sheet[row,column] def get_column(document, column, tab = 0): """ Get the column object through the column index