diff options
Autocommit at 30.05.2022 @ 20:23
1 files changed, 3 insertions, 1 deletions
| -rw-r--r-- | src/Models/Table.cpp | 4 |
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) |
