fix reading wrong string from xml such as below

<sheetData><row r="1"><c r="A1" s="1" t="s"><v>0</v></c><c r="B1" s="1" t="s"></c></row></sheetData>
formula
foxmeder 5 years ago committed by xuri
parent 736362694a
commit 59f6af21a3

@ -301,10 +301,12 @@ func (f *File) sharedStringsReader() *xlsxSST {
func (xlsx *xlsxC) getValueFrom(f *File, d *xlsxSST) (string, error) {
switch xlsx.T {
case "s":
xlsxSI := 0
xlsxSI, _ = strconv.Atoi(xlsx.V)
if len(d.SI) > xlsxSI {
return f.formattedValue(xlsx.S, d.SI[xlsxSI].String()), nil
if xlsx.V != "" {
xlsxSI := 0
xlsxSI, _ = strconv.Atoi(xlsx.V)
if len(d.SI) > xlsxSI {
return f.formattedValue(xlsx.S, d.SI[xlsxSI].String()), nil
}
}
return f.formattedValue(xlsx.S, xlsx.V), nil
case "str":

Loading…
Cancel
Save