Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / Table.cpp
diff options
context:
space:
mode:
Commitd5f4221f7820a774fd209c7a75a8a526aeec7ee2 (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-05-30 20:23:22 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-05-30 20:23:22 +0300
Files2596e8cbe06901c95979746df028c004288be9d1 /src/Models/Table.cpp
FMI-OOP-P2_Tables-d5f4221f7820a774fd209c7a75a8a526aeec7ee2.tar
FMI-OOP-P2_Tables-d5f4221f7820a774fd209c7a75a8a526aeec7ee2.tar.gz
FMI-OOP-P2_Tables-d5f4221f7820a774fd209c7a75a8a526aeec7ee2.zip
Parent4ae838df9d22037273fe97edc25971e6358549fb (diff)
Autocommit at 30.05.2022 @ 20:23
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)