Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / CellFormula.cpp
diff options
context:
space:
mode:
1 files changed, 1 insertions, 1 deletions
-rw-r--r--src/Models/CellFormula.cpp2
diff --git a/src/Models/CellFormula.cpp b/src/Models/CellFormula.cpp
index 4742ad1..3c40421 100644
--- a/src/Models/CellFormula.cpp
+++ b/src/Models/CellFormula.cpp
@@ -22,7 +22,7 @@ double CellFormula::calculate(unsigned index) const {
double numVal = currCell->getNumeralValue();
while (formula[index].right < 0) {
- switch (-formula[index].right) {
+ switch (-formula[index++].right) {
case '+' : numVal += ptrByInd(formula[index].left)->getNumeralValue(); break;
case '*' : numVal *= ptrByInd(formula[index].left)->getNumeralValue(); break;
case '/' : if (ptrByInd(formula[index].left)->getNumeralValue() == 0) throw std::logic_error("");