Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / CellFormula.cpp
diff options
context:
space:
mode:
Commitb6b8fbd49482cbfc0cc57d61215032d43902ee46 (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-05-28 19:34:47 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-05-28 19:34:47 +0300
Files35f5e1a23d6a5c79ba87e183eaf796582bfb5fbc /src/Models/CellFormula.cpp
FMI-OOP-P2_Tables-b6b8fbd49482cbfc0cc57d61215032d43902ee46.tar
FMI-OOP-P2_Tables-b6b8fbd49482cbfc0cc57d61215032d43902ee46.tar.gz
FMI-OOP-P2_Tables-b6b8fbd49482cbfc0cc57d61215032d43902ee46.zip
Parentdf1d4f096d676be8faaf4f1183fdef09ff301706 (diff)
Autocommit at 28.05.2022 @ 19:34
1 files changed, 7 insertions, 0 deletions
-rw-r--r--src/Models/CellFormula.cpp7
diff --git a/src/Models/CellFormula.cpp b/src/Models/CellFormula.cpp
index 631621d..cc48951 100644
--- a/src/Models/CellFormula.cpp
+++ b/src/Models/CellFormula.cpp
@@ -48,6 +48,13 @@ void CellFormula::parseAndSetValue(const char* str) {
formula.add({(*tableCells)[row][col], (Op)*str});
}
+ else {
+ double val = atof(str);
+ while ((*str >= '0' && *str <= '9') || *str == ' ') str++;
+
+ localCells.add(CellDouble(val));
+ formula.add({localCells[localCells.get_count() - 1], (Op)*str});
+ }
}
void CellFormula::readFromFile(std::ifstream& file) {