diff options
author | william <willy.xiao1989@gmail.com> | 2021-05-24 15:27:36 +0800 |
---|---|---|
committer | william <willy.xiao1989@gmail.com> | 2021-05-24 15:27:36 +0800 |
commit | 2f74ec171d8c42367666014fa661eab26f088e68 (patch) | |
tree | 60ec1d28080ae2be73ea61963522e1b8eccbaa31 | |
parent | 5bf3ea61547df2a36757f14bfba47bf22b747079 (diff) |
fix the bug when there was no count attribute in sharedStrings file
-rw-r--r-- | rows.go | 3 | ||||
-rw-r--r-- | xmlWorksheet.go | 6 |
2 files changed, 6 insertions, 3 deletions
@@ -322,6 +322,9 @@ func (f *File) sharedStringsReader() *xlsxSST { Decode(&sharedStrings); err != nil && err != io.EOF { log.Printf("xml decode error: %s", err) } + if sharedStrings.Count == 0 { + sharedStrings.Count = len(sharedStrings.SI) + } if sharedStrings.UniqueCount == 0 { sharedStrings.UniqueCount = sharedStrings.Count } diff --git a/xmlWorksheet.go b/xmlWorksheet.go index 438e900..82ac395 100644 --- a/xmlWorksheet.go +++ b/xmlWorksheet.go @@ -248,9 +248,9 @@ type xlsxSheetPr struct { // adjust the direction of grouper controls. type xlsxOutlinePr struct { ApplyStyles *bool `xml:"applyStyles,attr"` - SummaryBelow bool `xml:"summaryBelow,attr,omitempty"` - SummaryRight bool `xml:"summaryRight,attr,omitempty"` - ShowOutlineSymbols bool `xml:"showOutlineSymbols,attr,omitempty"` + SummaryBelow bool `xml:"summaryBelow,attr"` + SummaryRight bool `xml:"summaryRight,attr"` + ShowOutlineSymbols bool `xml:"showOutlineSymbols,attr"` } // xlsxPageSetUpPr expresses page setup properties of the worksheet. |