From b6b8fbd49482cbfc0cc57d61215032d43902ee46 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 28 May 2022 19:34:47 +0300 Subject: Autocommit at 28.05.2022 @ 19:34 --- src/Models/CellFormula.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Models/CellFormula.cpp') diff --git a/src/Models/CellFormula.cpp b/src/Models/CellFormula.cpp index 631621d..cc48951 100644 --- a/src/Models/CellFormula.cpp +++ b/src/Models/CellFormula.cpp @@ -48,6 +48,13 @@ void CellFormula::parseAndSetValue(const char* str) { formula.add({(*tableCells)[row][col], (Op)*str}); } + else { + double val = atof(str); + while ((*str >= '0' && *str <= '9') || *str == ' ') str++; + + localCells.add(CellDouble(val)); + formula.add({localCells[localCells.get_count() - 1], (Op)*str}); + } } void CellFormula::readFromFile(std::ifstream& file) { -- cgit v1.3.1-23-gd82d