From d5f4221f7820a774fd209c7a75a8a526aeec7ee2 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 30 May 2022 20:23:22 +0300 Subject: Autocommit at 30.05.2022 @ 20:23 --- src/Models/Table.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Models/Table.cpp') diff --git a/src/Models/Table.cpp b/src/Models/Table.cpp index 892a05d..4aab10e 100644 --- a/src/Models/Table.cpp +++ b/src/Models/Table.cpp @@ -127,10 +127,12 @@ void Table::putCell(unsigned row, unsigned col, const char* rawValue) { newCell = (abs(doubleParse) - intPart > FLOATING_POINT_PRECISION) ? (Cell*)new CellDouble(doubleParse) : (Cell*)new CellInt(intPart); } - else { + else if (*rawValue == '"') { newCell = (*rawValue == '=') ? (Cell*)new CellFormula(rawValue, &cells) : (Cell*)new CellString(rawValue); } + else + throw std::logic_error("Error: Could not determine data type."); if (cells[row][col] != nullptr) -- cgit v1.3.1-23-gd82d