Spreadsheet: fix extra row or column when printing

If there is only one single row or column in the table
This commit is contained in:
Zheng, Lei
2022-05-06 11:14:56 +08:00
committed by Chris Hennes
parent 6d6af2dd3b
commit d926331e57

View File

@@ -985,8 +985,8 @@ void SheetTableView::contextMenuEvent(QContextMenuEvent *)
QString SheetTableView::toHtml() const
{
auto cells = sheet->getCells()->getNonEmptyCells();
int rowCount = 1;
int colCount = 1;
int rowCount = 0;
int colCount = 0;
for (const auto& it : cells) {
rowCount = std::max(rowCount, it.row());
colCount = std::max(colCount, it.col());