summaryrefslogtreecommitdiff
path: root/pivotTable.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-11-13 00:40:04 +0800
committerxuri <xuri.me@gmail.com>2022-11-13 00:40:04 +0800
commitac564afa56a691e378ab9bb04cb14bb283886a16 (patch)
treedef0303fd88e78897a3c739c31c89cff8f492d43 /pivotTable.go
parentbd5dd17673f767b9f4643423c77eec486f2ad53f (diff)
Remove internal error log print, throw XML deserialize error
Diffstat (limited to 'pivotTable.go')
-rw-r--r--pivotTable.go10
1 files changed, 5 insertions, 5 deletions
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{}
}