Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / Table.cpp
diff options
context:
space:
mode:
1 files changed, 3 insertions, 1 deletions
-rw-r--r--src/Models/Table.cpp4
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)