diff options
Diffstat (limited to 'core/src/Model/Template/TableTemplate.cpp')
-rw-r--r-- | core/src/Model/Template/TableTemplate.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/src/Model/Template/TableTemplate.cpp b/core/src/Model/Template/TableTemplate.cpp index 28a4d6e..f2524a0 100644 --- a/core/src/Model/Template/TableTemplate.cpp +++ b/core/src/Model/Template/TableTemplate.cpp @@ -88,17 +88,15 @@ void TableTemplate::Resize(int newWidth, int newHeight) int tableWidth = GetTableWidth(); int tableHeight = GetTableHeight(); - int yEnd = std::min(tableHeight, newHeight); - int xEnd = std::min(tableWidth, newWidth); - for (int y = 0; y < yEnd; ++y) { + for (int y = 0; y < newHeight; ++y) { if (y >= tableHeight) { - for (int x = 0; x < xEnd; ++x) { + for (int x = 0; x < newWidth; ++x) { cells.push_back(TableCell{}); } continue; } - for (int x = 0; x < xEnd; ++x) { + for (int x = 0; x < newWidth; ++x) { if (x >= tableWidth) { cells.push_back(TableCell{}); } else { @@ -109,6 +107,8 @@ void TableTemplate::Resize(int newWidth, int newHeight) } mCells = std::move(cells); + mColumnWidths.resize(newWidth); + mRowHeights.resize(newHeight); } int TableTemplate::GetRowHeight(int row) const |