Fixed invalid shared string table index on set cell value (#1725)
This commit is contained in:
parent
55e4d4b2c3
commit
6251d493b3
2
cell.go
2
cell.go
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue