From 8e1122d386cc970ae18a7f03ef7890dbfb4b20da Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 14 Jun 2022 08:18:43 +0300 Subject: Autocommit at 14.06.2022 @ 08:18 --- 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 4b2c0f8..931feff 100644 --- a/src/Models/CellFormula.cpp +++ b/src/Models/CellFormula.cpp @@ -87,9 +87,9 @@ void D(const char*& str, List& buffer) { buffer.add(*(str++)); } -void O(const char*& str, List& buffer) { +void O(const char*& str, char& buffer) { if (*str == '+' || *str == '-' || *str == '*' || *str == '/' || *str == '^') - buffer.add(*(str++)); + buffer = *(str++); } void CellFormula::parseAndSetValue(const char* str) { @@ -108,11 +108,11 @@ void CellFormula::parseAndSetValue(const char* str) { str++; buffer.clear(); D(str, buffer); - int col = atoi(++str); - while (*str != ' ' && *str != '\0') str++; - while (*str == ' ') str++; + int col = atoi(buffer.raw_data()); + W(str); - currOp = *str; + O(str, currOp); + W(str); loc = {row, col}; } else { -- cgit v1.3.1-23-gd82d