Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / Table.cpp
diff options
context:
space:
mode:
Commita96be90384c6ba4a0ea4bbf4bf4722734d1ee9b8 (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-05-30 21:53:54 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-05-30 21:53:54 +0300
Filesd6e7a45decdf8642e28cdda5cf45877f62c11962 /src/Models/Table.cpp
FMI-OOP-P2_Tables-a96be90384c6ba4a0ea4bbf4bf4722734d1ee9b8.tar
FMI-OOP-P2_Tables-a96be90384c6ba4a0ea4bbf4bf4722734d1ee9b8.tar.gz
FMI-OOP-P2_Tables-a96be90384c6ba4a0ea4bbf4bf4722734d1ee9b8.zip
Parent0157e5f0ba9b3c62f060322abb34b319104255ad (diff)
Autocommit at 30.05.2022 @ 21:53
1 files changed, 4 insertions, 4 deletions
-rw-r--r--src/Models/Table.cpp8
diff --git a/src/Models/Table.cpp b/src/Models/Table.cpp
index 54c34bd..b13045a 100644
--- a/src/Models/Table.cpp
+++ b/src/Models/Table.cpp
@@ -81,9 +81,9 @@ void Table::readFromFile(std::ifstream& inFile) {
throw std::logic_error(fileLocationExceptionMsg("Error: Expected space, comma or newline but got something else at row ", cells.get_count(), inFile.tellg() % commaCount + 1));
if (exponent == 1)
- cells[cells.get_count() - 1][colInd++] = new CellInt(whole);
+ cells[cells.get_count() - 1][colInd++] = (Cell*)new CellInt(whole);
else
- cells[cells.get_count() - 1][colInd++] = new CellDouble((double)whole / exponent);
+ cells[cells.get_count() - 1][colInd++] = (Cell*)new CellDouble((double)whole / exponent);
}
// Parsing string or formula
else if (inFile.peek() == '"') {
@@ -100,9 +100,9 @@ void Table::readFromFile(std::ifstream& inFile) {
inFile.get();
if (*res.get_cstr() == '=')
- cells[cells.get_count() - 1][colInd++] = new CellFormula(res.get_cstr(), &cells);
+ cells[cells.get_count() - 1][colInd++] = (Cell*)new CellFormula(res.get_cstr(), &cells);
else
- cells[cells.get_count() - 1][colInd++] = new CellString(res.get_cstr());
+ cells[cells.get_count() - 1][colInd++] = (Cell*)new CellString(res.get_cstr());
}
else
throw std::logic_error(fileLocationExceptionMsg("Error: Could not determine type of value at row ", cells.get_count(), inFile.tellg() % commaCount + 1));