From 5dd0b4aec2931079e064f1fb393b034ce4934540 Mon Sep 17 00:00:00 2001 From: xuri Date: Fri, 6 Nov 2020 20:03:13 +0800 Subject: using POSIX directory separator in zip path with Windows --- pivotTable.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'pivotTable.go') diff --git a/pivotTable.go b/pivotTable.go index 3a277c3..96e3627 100644 --- a/pivotTable.go +++ b/pivotTable.go @@ -15,7 +15,6 @@ import ( "encoding/xml" "errors" "fmt" - "path/filepath" "strconv" "strings" ) @@ -139,9 +138,7 @@ func (f *File) AddPivotTable(opt *PivotTableOption) error { } // workbook pivot cache - wbPath := f.getWorkbookPath() - wbRelsPath := strings.TrimPrefix(filepath.Join(filepath.Dir(wbPath), "_rels", filepath.Base(wbPath)+".rels"), string(filepath.Separator)) - workBookPivotCacheRID := f.addRels(wbRelsPath, SourceRelationshipPivotCache, fmt.Sprintf("/xl/pivotCache/pivotCacheDefinition%d.xml", pivotCacheID), "") + workBookPivotCacheRID := f.addRels(f.getWorkbookRelsPath(), SourceRelationshipPivotCache, fmt.Sprintf("/xl/pivotCache/pivotCacheDefinition%d.xml", pivotCacheID), "") cacheID := f.addWorkbookPivotCache(workBookPivotCacheRID) pivotCacheRels := "xl/pivotTables/_rels/pivotTable" + strconv.Itoa(pivotTableID) + ".xml.rels" -- cgit v1.2.1