Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / CellFormula.cpp
diff options
context:
space:
mode:
Commit7c70489b77c9fd8e914838bd77a191b18fca57e2 (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-05-29 13:54:57 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-05-29 13:54:57 +0300
Filese8c3d5ce28d6226f3bbb4405dc244db7fa3b4748 /src/Models/CellFormula.cpp
FMI-OOP-P2_Tables-7c70489b77c9fd8e914838bd77a191b18fca57e2.tar
FMI-OOP-P2_Tables-7c70489b77c9fd8e914838bd77a191b18fca57e2.tar.gz
FMI-OOP-P2_Tables-7c70489b77c9fd8e914838bd77a191b18fca57e2.zip
Parenteeb073334acd7037c8cb313aa7faeb1b0f0b0911 (diff)
Autocommit at 29.05.2022 @ 13:54
1 files changed, 2 insertions, 2 deletions
-rw-r--r--src/Models/CellFormula.cpp4
diff --git a/src/Models/CellFormula.cpp b/src/Models/CellFormula.cpp
index 439b21f..4473b28 100644
--- a/src/Models/CellFormula.cpp
+++ b/src/Models/CellFormula.cpp
@@ -82,9 +82,9 @@ void CellFormula::parseAndSetValue(const char* str) {
if ((currOp == '+' || currOp == '-') && formula.get_count() != 0) {
Pair<Cell*, char>& prev = formula[formula.get_count() - 1];
- if (prev.right == '*' || prev.right == '/') prev.right *= -1;
+ if (prev.right == '*' || prev.right == '/' || prev.right == '-') prev.right *= -1;
}
- if (currOp == '^' || currOp == '-') currOp *= -1;
+ if (currOp == '^') currOp *= -1;
formula.add({cellToAdd, currOp});
}