From aecbafe786a451c202c867d0ce6cb92e7a76a5be Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 30 May 2022 18:12:40 +0300 Subject: Autocommit at 30.05.2022 @ 18:12 --- src/Models/CellFormula.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Models/CellFormula.cpp') 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(""); -- cgit v1.3.1-23-gd82d