From ac564afa56a691e378ab9bb04cb14bb283886a16 Mon Sep 17 00:00:00 2001 From: xuri Date: Sun, 13 Nov 2022 00:40:04 +0800 Subject: Remove internal error log print, throw XML deserialize error --- pivotTable.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pivotTable.go') diff --git a/pivotTable.go b/pivotTable.go index 0999a97..7b4b553 100644 --- a/pivotTable.go +++ b/pivotTable.go @@ -160,10 +160,10 @@ func (f *File) AddPivotTable(opts *PivotTableOptions) error { } pivotTableSheetRels := "xl/worksheets/_rels/" + strings.TrimPrefix(pivotTableSheetPath, "xl/worksheets/") + ".rels" f.addRels(pivotTableSheetRels, SourceRelationshipPivotTable, sheetRelationshipsPivotTableXML, "") - f.addContentTypePart(pivotTableID, "pivotTable") - f.addContentTypePart(pivotCacheID, "pivotCache") - - return nil + if err = f.addContentTypePart(pivotTableID, "pivotTable"); err != nil { + return err + } + return f.addContentTypePart(pivotCacheID, "pivotCache") } // parseFormatPivotTableSet provides a function to validate pivot table @@ -697,7 +697,7 @@ func (f *File) getPivotTableFieldOptions(name string, fields []PivotTableField) // addWorkbookPivotCache add the association ID of the pivot cache in workbook.xml. func (f *File) addWorkbookPivotCache(RID int) int { - wb := f.workbookReader() + wb, _ := f.workbookReader() if wb.PivotCaches == nil { wb.PivotCaches = &xlsxPivotCaches{} } -- cgit v1.2.1