summaryrefslogtreecommitdiff
path: root/sheet.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2020-08-22 18:58:43 +0800
committerxuri <xuri.me@gmail.com>2020-08-22 18:58:43 +0800
commit88de2f8d510b0959bbb672b80656d207bd0bc927 (patch)
tree2f7c37bffac4ecad92aaf253877667ce2348a843 /sheet.go
parent3c8c8c55c8128c5bb94fe28451f58fbc5fb4a118 (diff)
Default row height compatibility with Apache OpenOffice and Kingsoft WPS, unit test update and typo fixed
Diffstat (limited to 'sheet.go')
-rw-r--r--sheet.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/sheet.go b/sheet.go
index a92221d..dedd2d9 100644
--- a/sheet.go
+++ b/sheet.go
@@ -1630,13 +1630,19 @@ func (f *File) relsReader(path string) *xlsxRelationships {
func prepareSheetXML(xlsx *xlsxWorksheet, col int, row int) {
rowCount := len(xlsx.SheetData.Row)
sizeHint := 0
+ var ht float64
+ var customHeight bool
+ if xlsx.SheetFormatPr != nil {
+ ht = xlsx.SheetFormatPr.DefaultRowHeight
+ customHeight = true
+ }
if rowCount > 0 {
sizeHint = len(xlsx.SheetData.Row[rowCount-1].C)
}
if rowCount < row {
// append missing rows
for rowIdx := rowCount; rowIdx < row; rowIdx++ {
- xlsx.SheetData.Row = append(xlsx.SheetData.Row, xlsxRow{R: rowIdx + 1, C: make([]xlsxC, 0, sizeHint)})
+ xlsx.SheetData.Row = append(xlsx.SheetData.Row, xlsxRow{R: rowIdx + 1, CustomHeight: customHeight, Ht: ht, C: make([]xlsxC, 0, sizeHint)})
}
}
rowData := &xlsx.SheetData.Row[row-1]