Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / Table.cpp
diff options
context:
space:
mode:
Commit9693e2b25d7935a06b3695137106038cf436caea (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-05-30 22:08:59 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-05-30 22:08:59 +0300
Filese3018171e9b16b6e615e0ea3173995f2e79ba726 /src/Models/Table.cpp
FMI-OOP-P2_Tables-9693e2b25d7935a06b3695137106038cf436caea.tar
FMI-OOP-P2_Tables-9693e2b25d7935a06b3695137106038cf436caea.tar.gz
FMI-OOP-P2_Tables-9693e2b25d7935a06b3695137106038cf436caea.zip
Parent7a566fe28b9beef1e31c73b82678caf427fbc70a (diff)
Autocommit at 30.05.2022 @ 22:08
1 files changed, 4 insertions, 0 deletions
-rw-r--r--src/Models/Table.cpp4
diff --git a/src/Models/Table.cpp b/src/Models/Table.cpp
index bbf22a6..637514a 100644
--- a/src/Models/Table.cpp
+++ b/src/Models/Table.cpp
@@ -35,6 +35,8 @@ void Table::readFromFile(std::ifstream& inFile) {
unsigned colInd = 0;
cells.add(List<Cell*>(cols));
+ for (unsigned i = 0; i < cols; i++)
+ cells[cells.get_count() - 1][i] = nullptr;
while (inFile.peek() != EOF) {
while (inFile.peek() == ' ') inFile.get();
@@ -46,6 +48,8 @@ void Table::readFromFile(std::ifstream& inFile) {
// Entering a new row
else if (inFile.peek() == '\n') {
cells.add(List<Cell*>(cols));
+ for (unsigned i = 0; i < cols; i++)
+ cells[cells.get_count() - 1][i] = nullptr;
colInd = 0;
inFile.get();
}