forked from p30928647/excelize
Fix #529, handle empty inline rich text
This commit is contained in:
parent
08d1a86c3a
commit
5d8365ca17
5
rows.go
5
rows.go
|
@ -279,7 +279,10 @@ func (xlsx *xlsxC) getValueFrom(f *File, d *xlsxSST) (string, error) {
|
|||
case "str":
|
||||
return f.formattedValue(xlsx.S, xlsx.V), nil
|
||||
case "inlineStr":
|
||||
return f.formattedValue(xlsx.S, xlsx.IS.String()), nil
|
||||
if xlsx.IS != nil {
|
||||
return f.formattedValue(xlsx.S, xlsx.IS.String()), nil
|
||||
}
|
||||
return f.formattedValue(xlsx.S, xlsx.V), nil
|
||||
default:
|
||||
return f.formattedValue(xlsx.S, xlsx.V), nil
|
||||
}
|
||||
|
|
|
@ -706,6 +706,15 @@ func TestDuplicateRowInvalidRownum(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestGetValueFrom(t *testing.T) {
|
||||
c := &xlsxC{T: "inlineStr"}
|
||||
f := NewFile()
|
||||
d := &xlsxSST{}
|
||||
val, err := c.getValueFrom(f, d)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "", val)
|
||||
}
|
||||
|
||||
func TestErrSheetNotExistError(t *testing.T) {
|
||||
err := ErrSheetNotExist{SheetName: "Sheet1"}
|
||||
assert.EqualValues(t, err.Error(), "sheet Sheet1 is not exist")
|
||||
|
|
Loading…
Reference in New Issue