Fixed invalid shared string table index on set cell value (#1725)

This commit is contained in:
ZX 2023-11-21 11:23:54 +08:00 committed by GitHub
parent 55e4d4b2c3
commit 6251d493b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -495,7 +495,7 @@ func (f *File) setSharedString(val string) (int, error) {
val, t.Space = trimCellValue(val, false) val, t.Space = trimCellValue(val, false)
sst.SI = append(sst.SI, xlsxSI{T: &t}) sst.SI = append(sst.SI, xlsxSI{T: &t})
f.sharedStringsMap[val] = sst.UniqueCount - 1 f.sharedStringsMap[val] = sst.UniqueCount - 1
return sst.UniqueCount - 1, nil return len(sst.SI) - 1, nil
} }
// trimCellValue provides a function to set string type to cell. // trimCellValue provides a function to set string type to cell.