Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / CellFormula.cpp
diff options
context:
space:
mode:
Commit8e1122d386cc970ae18a7f03ef7890dbfb4b20da (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-06-14 08:18:43 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-06-14 08:18:43 +0300
Files2f16f48bdacc962957fb05c0451b1ed236ec9fb3 /src/Models/CellFormula.cpp
FMI-OOP-P2_Tables-8e1122d386cc970ae18a7f03ef7890dbfb4b20da.tar
FMI-OOP-P2_Tables-8e1122d386cc970ae18a7f03ef7890dbfb4b20da.tar.gz
FMI-OOP-P2_Tables-8e1122d386cc970ae18a7f03ef7890dbfb4b20da.zip
Parentbc3b45e6e7cfba9251f80e498c87aadbf9b5e7b8 (diff)
Autocommit at 14.06.2022 @ 08:18
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 4b2c0f8..931feff 100644
--- a/src/Models/CellFormula.cpp
+++ b/src/Models/CellFormula.cpp
@@ -87,9 +87,9 @@ void D(const char*& str, List<char>& buffer) {
buffer.add(*(str++));
}
-void O(const char*& str, List<char>& 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 {