From 28c22b23863ff82581e934be8c0d26b93f51abbb Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 30 May 2022 19:58:13 +0300 Subject: Autocommit at 30.05.2022 @ 19:58 --- src/Models/Table.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Models/Table.cpp') diff --git a/src/Models/Table.cpp b/src/Models/Table.cpp index 8c1f54d..c0fe315 100644 --- a/src/Models/Table.cpp +++ b/src/Models/Table.cpp @@ -84,7 +84,14 @@ void Table::readFromFile(std::ifstream& inFile) { } res += inFile.get(); } + + if (*res.get_cstr() == '=') + cells[cells.get_count() - 1].add(new CellFormula(res.get_cstr(), &cells)); + else + cells[cells.get_count() - 1].add(new CellString(res.get_cstr())); } + else + throw std::logic_error(fileLocationExceptionMsg("Error: Could not determine type of value at row ", cells.get_count(), inFile.tellg() % cells.get_count() + 1)); } } -- cgit v1.3.1-23-gd82d