diff options
| Commit | 9693e2b25d7935a06b3695137106038cf436caea (patch) | |
|---|---|---|
| Author | 2022-05-30 22:08:59 +0300 | |
| Committer | 2022-05-30 22:08:59 +0300 | |
| Files | e3018171e9b16b6e615e0ea3173995f2e79ba726 /src | |
| FMI-OOP-P2_Tables-9693e2b25d7935a06b3695137106038cf436caea.tar FMI-OOP-P2_Tables-9693e2b25d7935a06b3695137106038cf436caea.tar.gz FMI-OOP-P2_Tables-9693e2b25d7935a06b3695137106038cf436caea.zip | ||
| Parent | 7a566fe28b9beef1e31c73b82678caf427fbc70a (diff) | |
Autocommit at 30.05.2022 @ 22:08
1 files changed, 4 insertions, 0 deletions
| -rw-r--r-- | src/Models/Table.cpp | 4 |
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(); } |
