Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / Table.cpp
diff options
context:
space:
mode:
Commit8ac9daf2c9d82aacba01de8839a7eef374535b24 (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-06-14 07:48:34 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-06-14 07:48:34 +0300
Files96eeb64d5459a84e2f5785020ba7604a68e2db35 /src/Models/Table.cpp
FMI-OOP-P2_Tables-8ac9daf2c9d82aacba01de8839a7eef374535b24.tar
FMI-OOP-P2_Tables-8ac9daf2c9d82aacba01de8839a7eef374535b24.tar.gz
FMI-OOP-P2_Tables-8ac9daf2c9d82aacba01de8839a7eef374535b24.zip
Parent859196059b3c63d3461d29aed8b3ba326af65151 (diff)
Autocommit at 14.06.2022 @ 07:48
1 files changed, 2 insertions, 3 deletions
-rw-r--r--src/Models/Table.cpp5
diff --git a/src/Models/Table.cpp b/src/Models/Table.cpp
index cd9e7d1..f1201f2 100644
--- a/src/Models/Table.cpp
+++ b/src/Models/Table.cpp
@@ -51,7 +51,7 @@ void Table::readFromFile(std::ifstream& inFile) {
unsigned row = 0;
cells.add(List<Cell*>());
- while (!inFile.eof()) {
+ while (inFile.peek() != EOF) {
if (inFile.peek() == '\n') {
row++;
inFile.get();
@@ -168,8 +168,7 @@ List<String> Table::getAllCells() const {
for (unsigned i = 0; i < cells.get_count(); i++) {
for (unsigned j = 0; j < cells[i].get_length(); j++) {
std::cout << i << ' ' << j << std::endl;
- if (cells[i][j] == nullptr) toRet.add("");
- else toRet.add(cells[i][j]->getValueForPrint());
+ toRet.add(cells[i][j]->getValueForPrint());
}
}
return toRet;