Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / CellFormula.cpp
diff options
context:
space:
mode:
Commitabb9700d4d45cf85d04759b76bd93a795e0f467e (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-05-30 18:07:38 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-05-30 18:07:38 +0300
Files42154311b6fea71bab2aa62f4dbad6a9312e8242 /src/Models/CellFormula.cpp
FMI-OOP-P2_Tables-abb9700d4d45cf85d04759b76bd93a795e0f467e.tar
FMI-OOP-P2_Tables-abb9700d4d45cf85d04759b76bd93a795e0f467e.tar.gz
FMI-OOP-P2_Tables-abb9700d4d45cf85d04759b76bd93a795e0f467e.zip
Parent09bf71b13d873767a400b4e3e17172ae1c2830f8 (diff)
Autocommit at 30.05.2022 @ 18:07
1 files changed, 6 insertions, 6 deletions
-rw-r--r--src/Models/CellFormula.cpp12
diff --git a/src/Models/CellFormula.cpp b/src/Models/CellFormula.cpp
index 5cc3ae5..4742ad1 100644
--- a/src/Models/CellFormula.cpp
+++ b/src/Models/CellFormula.cpp
@@ -72,7 +72,7 @@ String CellFormula::getValueForPrint() const {
void CellFormula::parseAndSetValue(const char* str) {
rawFormula = String(str);
- CellLoc cellToAdd;
+ Pair<int, int> loc;
char currOp;
while (*str != '\0') {
@@ -86,7 +86,7 @@ void CellFormula::parseAndSetValue(const char* str) {
while (*str == ' ') str++;
currOp = *str;
- cellToAdd = {row, col};
+ loc = {row, col};
}
else {
double val = atof(str);
@@ -94,7 +94,7 @@ void CellFormula::parseAndSetValue(const char* str) {
currOp = *str;
localCells.add(CellDouble(val));
- cellToAdd = {-1, (int)(localCells.get_count() - 1)};
+ loc = {-1, localCells.get_count() - 1};
}
if (currOp == '^') currOp *= -1;
@@ -104,11 +104,11 @@ void CellFormula::parseAndSetValue(const char* str) {
}
if (currOp == '-') {
- formula.add({cellToAdd, '+'});
+ formula.add({loc, '+'});
localCells.add(CellDouble(-1.0));
- formula.add({{-1, (int)(localCells.get_count() - 1)}, '*' * -1});
+ formula.add({{-1, localCells.get_count() - 1}, '*' * -1});
}
- else formula.add({cellToAdd, currOp});
+ else formula.add({loc, currOp});
}
}