From bba3a7a2cbb2f8c7e67083d2ff4e65f20150c9a3 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Sat, 20 Mar 2021 13:56:35 +0330 Subject: [PATCH] Spreadsheet: Ignore empty cells when calculating data bounds There's no reason to use extra rows/columns to represent empty cells when exporting. --- Userland/Applications/Spreadsheet/Spreadsheet.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Applications/Spreadsheet/Spreadsheet.cpp b/Userland/Applications/Spreadsheet/Spreadsheet.cpp index e5acbcc054..1654f98953 100644 --- a/Userland/Applications/Spreadsheet/Spreadsheet.cpp +++ b/Userland/Applications/Spreadsheet/Spreadsheet.cpp @@ -495,6 +495,8 @@ Position Sheet::written_data_bounds() const { Position bound; for (auto& entry : m_cells) { + if (entry.value->data().is_empty()) + continue; if (entry.key.row >= bound.row) bound.row = entry.key.row; if (entry.key.column >= bound.column)