From c24eb091ef16ff87e5363e3b364b59bb92c113a8 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 29 May 2022 10:04:24 +0300 Subject: Autocommit at 29.05.2022 @ 10:04 --- src/Models/CellFormula.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/Models/CellFormula.cpp') diff --git a/src/Models/CellFormula.cpp b/src/Models/CellFormula.cpp index 388af73..ecea06d 100644 --- a/src/Models/CellFormula.cpp +++ b/src/Models/CellFormula.cpp @@ -35,7 +35,7 @@ double CellFormula::calculate(unsigned index) { CellFormula::CellFormula(const char* str, const List>* tableCells) : localCells(), formula(), rawFormula() { this->tableCells = tableCells; - parseAndSetValue(str); + CellFormula::parseAndSetValue(str); } #include @@ -45,6 +45,7 @@ double CellFormula::getNumeralValue() { } String CellFormula::getValueForPrint() { + std::cout << formula.get_count() << std::endl; return String() += calculate(); } @@ -61,7 +62,7 @@ void CellFormula::parseAndSetValue(const char* str) { unsigned row = atoi(++str); while (*str != 'C') str++; unsigned col = atoi(++str); - while (*str != ' ') str++; + while (*str != ' ' && *str != '\0') str++; while (*str == ' ') str++; cellToAdd = (*tableCells)[row][col]; @@ -82,8 +83,6 @@ void CellFormula::parseAndSetValue(const char* str) { if (prev.right == '*' || prev.right == '/') prev.right *= -1; } - std::cout << formula.get_count() << std::endl; - std::cout << cellToAdd << " " << currOp << std::endl; formula.add({cellToAdd, currOp}); } } -- cgit v1.3.1-23-gd82d