From 63a04433aaf4585181598f10398e41dc9801292e Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 28 May 2022 19:54:54 +0300 Subject: Autocommit at 28.05.2022 @ 19:54 --- src/Models/Table.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/Models/Table.cpp') diff --git a/src/Models/Table.cpp b/src/Models/Table.cpp index 4bdf13e..0719a58 100644 --- a/src/Models/Table.cpp +++ b/src/Models/Table.cpp @@ -29,13 +29,18 @@ void Table::putCell(unsigned row, unsigned col, const char* rawValue) { ? (Cell*)new CellDouble(doubleParse) : (Cell*)new CellInt(intParse); } else { - newCell = (*rawValue == '=') ? (Cell*)new CellFormula(rawValue) : (Cell*)new CellString(rawValue); + newCell = (*rawValue == '=') + ? (Cell*)new CellFormula(rawValue, &cells) : (Cell*)new CellString(rawValue); } cells[row][col] = newCell; } -String Table::getAllCells() const { - //TODO - return String(); +List Table::getAllCells() const { + List toRet; + for (unsigned i = 0; i < cells.get_count(); i++) { + for (unsigned j = 0; j < cells[i].get_count(); j++) + toRet.add(cells[i][j]->getValueForPrint()); + } + return toRet; } -- cgit v1.3.1-23-gd82d