diff options
Autocommit at 28.05.2022 @ 18:44
1 files changed, 5 insertions, 1 deletions
| -rw-r--r-- | src/Models/CellFormula.cpp | 6 |
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++); |
