diff options
Autocommit at 29.05.2022 @ 13:59
1 files changed, 2 insertions, 2 deletions
| -rw-r--r-- | src/Models/CellFormula.cpp | 4 |
diff --git a/src/Models/CellFormula.cpp b/src/Models/CellFormula.cpp index 4473b28..76c9150 100644 --- a/src/Models/CellFormula.cpp +++ b/src/Models/CellFormula.cpp @@ -80,11 +80,11 @@ void CellFormula::parseAndSetValue(const char* str) { currOp = *str; } - if ((currOp == '+' || currOp == '-') && formula.get_count() != 0) { + if (currOp == '^') currOp *= -1; + else if ((currOp == '+' || currOp == '-') && formula.get_count() != 0) { Pair<Cell*, char>& prev = formula[formula.get_count() - 1]; if (prev.right == '*' || prev.right == '/' || prev.right == '-') prev.right *= -1; } - if (currOp == '^') currOp *= -1; formula.add({cellToAdd, currOp}); } |
