Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / Table.cpp
diff options
context:
space:
mode:
Commit63a04433aaf4585181598f10398e41dc9801292e (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-05-28 19:54:54 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-05-28 19:54:54 +0300
Filesc7bfa02b244f89d898148a645820d07acac611c3 /src/Models/Table.cpp
FMI-OOP-P2_Tables-63a04433aaf4585181598f10398e41dc9801292e.tar
FMI-OOP-P2_Tables-63a04433aaf4585181598f10398e41dc9801292e.tar.gz
FMI-OOP-P2_Tables-63a04433aaf4585181598f10398e41dc9801292e.zip
Parent31b78420ad5d7a5fd9596bba961ed554b9c38838 (diff)
Autocommit at 28.05.2022 @ 19:54
1 files changed, 9 insertions, 4 deletions
-rw-r--r--src/Models/Table.cpp13
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<String> Table::getAllCells() const {
+ List<String> 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;
}