forked from p30928647/excelize
Fix UpdateLinkedValue which returns an error when has graph sheet (#793)
* Fixed UpdateLinkedValue which returns an error when there is a graph sheet Signed-off-by: yuuki.ono <yagfair@gmail.com> * fix refactoring from review Signed-off-by: yuuki.ono <yagfair@gmail.com>
This commit is contained in:
parent
a12dfd3ce6
commit
dbe88d723e
|
@ -236,6 +236,8 @@ func TestAddChartSheet(t *testing.T) {
|
|||
// Test with unsupported chart type
|
||||
assert.EqualError(t, f.AddChartSheet("Chart2", `{"type":"unknown","series":[{"name":"Sheet1!$A$2","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$2:$D$2"},{"name":"Sheet1!$A$3","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$3:$D$3"},{"name":"Sheet1!$A$4","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$4:$D$4"}],"title":{"name":"Fruit 3D Clustered Column Chart"}}`), "unsupported chart type unknown")
|
||||
|
||||
assert.NoError(t, f.UpdateLinkedValue())
|
||||
|
||||
assert.NoError(t, f.SaveAs(filepath.Join("test", "TestAddChartSheet.xlsx")))
|
||||
}
|
||||
|
||||
|
|
|
@ -314,6 +314,9 @@ func (f *File) UpdateLinkedValue() error {
|
|||
for _, name := range f.GetSheetList() {
|
||||
xlsx, err := f.workSheetReader(name)
|
||||
if err != nil {
|
||||
if err.Error() == fmt.Sprintf("sheet %s is chart sheet", trimSheetName(name)) {
|
||||
continue
|
||||
}
|
||||
return err
|
||||
}
|
||||
for indexR := range xlsx.SheetData.Row {
|
||||
|
|
Loading…
Reference in New Issue