diff options
author | xuri <xuri.me@gmail.com> | 2020-08-22 18:58:43 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2020-08-22 18:58:43 +0800 |
commit | 88de2f8d510b0959bbb672b80656d207bd0bc927 (patch) | |
tree | 2f7c37bffac4ecad92aaf253877667ce2348a843 /sheet.go | |
parent | 3c8c8c55c8128c5bb94fe28451f58fbc5fb4a118 (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.go | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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] |