diff options
author | xuri <xuri.me@gmail.com> | 2020-05-29 00:26:40 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2020-05-29 00:26:40 +0800 |
commit | 2ae631376b95ff0a59ea18c2c0befcd50135b020 (patch) | |
tree | c3542c127aed38cac104c513047327d6316b91d1 /cell.go | |
parent | c168233e70db8f220bd07d9d6d277ae9e2a4a73f (diff) |
add limits for total columns, row and filename length
Diffstat (limited to 'cell.go')
-rw-r--r-- | cell.go | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -281,8 +281,8 @@ func (f *File) SetCellStr(sheet, axis, value string) error { // setCellString provides a function to set string type to shared string // table. func (f *File) setCellString(value string) (t string, v string, ns xml.Attr) { - if len(value) > 32767 { - value = value[0:32767] + if len(value) > TotalCellChars { + value = value[0:TotalCellChars] } // Leading and ending space(s) character detection. if len(value) > 0 && (value[0] == 32 || value[len(value)-1] == 32) { @@ -311,8 +311,8 @@ func (f *File) setSharedString(val string) int { // setCellStr provides a function to set string type to cell. func setCellStr(value string) (t string, v string, ns xml.Attr) { - if len(value) > 32767 { - value = value[0:32767] + if len(value) > TotalCellChars { + value = value[0:TotalCellChars] } // Leading and ending space(s) character detection. if len(value) > 0 && (value[0] == 32 || value[len(value)-1] == 32) { @@ -476,7 +476,7 @@ func (f *File) SetCellHyperLink(sheet, axis, link, linkType string) error { xlsx.Hyperlinks = new(xlsxHyperlinks) } - if len(xlsx.Hyperlinks.Hyperlink) > 65529 { + if len(xlsx.Hyperlinks.Hyperlink) > TotalSheetHyperlinks { return errors.New("over maximum limit hyperlinks in a worksheet") } |