From 4998b7b92980e1139b3f38d3c2b8cbc11b1a629d Mon Sep 17 00:00:00 2001 From: xuri Date: Thu, 3 Nov 2022 00:23:48 +0800 Subject: This closes #1383, skip empty rows when saving the spreadsheet to reduce file size --- rows.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'rows.go') diff --git a/rows.go b/rows.go index 5b21f29..bfea398 100644 --- a/rows.go +++ b/rows.go @@ -772,6 +772,13 @@ func checkRow(ws *xlsxWorksheet) error { return nil } +// hasAttr determine if row non-default attributes. +func (r *xlsxRow) hasAttr() bool { + return r.Spans != "" || r.S != 0 || r.CustomFormat || r.Ht != 0 || + r.Hidden || r.CustomHeight || r.OutlineLevel != 0 || r.Collapsed || + r.ThickTop || r.ThickBot || r.Ph +} + // SetRowStyle provides a function to set the style of rows by given worksheet // name, row range, and style ID. Note that this will overwrite the existing // styles for the rows, it won't append or merge style with existing styles. -- cgit v1.2.1