From abb9700d4d45cf85d04759b76bd93a795e0f467e Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 30 May 2022 18:07:38 +0300 Subject: Autocommit at 30.05.2022 @ 18:07 --- src/Models/CellFormula.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Models/CellFormula.cpp') 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 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}); } } -- cgit v1.3.1-23-gd82d