diff options
3 files changed, 10 insertions, 1 deletions
| -rw-r--r-- | src/Generic/ConsoleInterface/Toolbox.cpp | 2 | ||||
| -rw-r--r-- | src/Models/Table.cpp | 2 | ||||
| -rw-r--r-- | src/UserInterface/UserInterface.cpp | 7 |
diff --git a/src/Generic/ConsoleInterface/Toolbox.cpp b/src/Generic/ConsoleInterface/Toolbox.cpp index 64649e9..ca739f0 100644 --- a/src/Generic/ConsoleInterface/Toolbox.cpp +++ b/src/Generic/ConsoleInterface/Toolbox.cpp @@ -79,7 +79,7 @@ void printTable(const List<String>& items, unsigned columns) { __printPadded(items[i], colWidths[i % columns]); if (i % columns == columns - 1) printLine(""); - else if (i % columns > 0) + else print("|"); } diff --git a/src/Models/Table.cpp b/src/Models/Table.cpp index edaccf7..7e4a7ac 100644 --- a/src/Models/Table.cpp +++ b/src/Models/Table.cpp @@ -39,6 +39,8 @@ void Table::putCell(unsigned row, unsigned col, const char* rawValue) { ? (Cell*)new CellFormula(rawValue, &cells) : (Cell*)new CellString(rawValue); } + if (cells[row][col] != nullptr) + delete cells[row][col]; cells[row][col] = newCell; } diff --git a/src/UserInterface/UserInterface.cpp b/src/UserInterface/UserInterface.cpp index 5e9ef00..4036840 100644 --- a/src/UserInterface/UserInterface.cpp +++ b/src/UserInterface/UserInterface.cpp @@ -15,6 +15,13 @@ void UserInterface::com_print(const char* params) { void UserInterface::com_edit(const char* params) { while (*params == ' ') params++; + + unsigned row = atoi(++params); + while (*params != 'C') params++; + unsigned col = atoi(++params); + while (*params != ' ') params++; + + table->putCell(row, col, params); } /* Public */ |
