Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / CellFormula.cpp
diff options
context:
space:
mode:
Commitfe20ad7968a7c4d51ffd4d46d7905a59867032a7 (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-05-28 18:44:32 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-05-28 18:44:32 +0300
Filese3444f4725f7bdc0197e4a121eadff3fa098464e /src/Models/CellFormula.cpp
FMI-OOP-P2_Tables-fe20ad7968a7c4d51ffd4d46d7905a59867032a7.tar
FMI-OOP-P2_Tables-fe20ad7968a7c4d51ffd4d46d7905a59867032a7.tar.gz
FMI-OOP-P2_Tables-fe20ad7968a7c4d51ffd4d46d7905a59867032a7.zip
Parent38857d8714495bf5ea72bb1faa75232dbcc0f77c (diff)
Autocommit at 28.05.2022 @ 18:44
1 files changed, 5 insertions, 1 deletions
-rw-r--r--src/Models/CellFormula.cpp6
diff --git a/src/Models/CellFormula.cpp b/src/Models/CellFormula.cpp
index 71e4e29..21de3ec 100644
--- a/src/Models/CellFormula.cpp
+++ b/src/Models/CellFormula.cpp
@@ -2,8 +2,12 @@
#include "CellDouble.h"
#include <cstring>
+CellFormula::CellFormula(const char* str) : referencedCells(), formula(), rawFormula() {
+ parseAndSetValue(str);
+}
+
double CellFormula::calculate(unsigned index) {
- double lval = CellDouble(formula[index].left->getValue()).getNumeralValue();
+ double lval = formula[index].left->getNumeralValue();
switch(formula[index].right) {
case plus: return lval + calculate(index++);