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 --- chart.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'chart.go') diff --git a/chart.go b/chart.go index 978a2f9..c5b8fc8 100644 --- a/chart.go +++ b/chart.go @@ -16,7 +16,6 @@ import ( "encoding/xml" "errors" "fmt" - "path/filepath" "strconv" "strings" ) @@ -802,9 +801,7 @@ func (f *File) AddChartSheet(sheet, format string, combo ...string) error { f.addContentTypePart(sheetID, "chartsheet") f.addContentTypePart(drawingID, "drawings") // Update workbook.xml.rels - wbPath := f.getWorkbookPath() - wbRelsPath := strings.TrimPrefix(filepath.Join(filepath.Dir(wbPath), "_rels", filepath.Base(wbPath)+".rels"), string(filepath.Separator)) - rID := f.addRels(wbRelsPath, SourceRelationshipChartsheet, fmt.Sprintf("/xl/chartsheets/sheet%d.xml", sheetID), "") + rID := f.addRels(f.getWorkbookRelsPath(), SourceRelationshipChartsheet, fmt.Sprintf("/xl/chartsheets/sheet%d.xml", sheetID), "") // Update workbook.xml f.setWorkbook(sheet, sheetID, rID) chartsheet, _ := xml.Marshal(cs) -- cgit v1.2.1