summaryrefslogtreecommitdiff
path: root/excelize.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2020-11-06 20:03:13 +0800
committerxuri <xuri.me@gmail.com>2020-11-06 20:03:13 +0800
commit5dd0b4aec2931079e064f1fb393b034ce4934540 (patch)
tree118b86bc2460f46b33de4aefcce0bb0b2a768afa /excelize.go
parentcdc57db3b3758781bd053228bfb32879b3adf3de (diff)
using POSIX directory separator in zip path with Windows
Diffstat (limited to 'excelize.go')
-rw-r--r--excelize.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/excelize.go b/excelize.go
index 3a511d1..2cbf54d 100644
--- a/excelize.go
+++ b/excelize.go
@@ -22,7 +22,6 @@ import (
"io/ioutil"
"os"
"path"
- "path/filepath"
"strconv"
"strings"
"sync"
@@ -346,9 +345,7 @@ func (f *File) AddVBAProject(bin string) error {
return errors.New("unsupported VBA project extension")
}
f.setContentTypePartVBAProjectExtensions()
- wbPath := f.getWorkbookPath()
- wbRelsPath := strings.TrimPrefix(filepath.Join(filepath.Dir(wbPath), "_rels", filepath.Base(wbPath)+".rels"), string(filepath.Separator))
- wb := f.relsReader(wbRelsPath)
+ wb := f.relsReader(f.getWorkbookRelsPath())
var rID int
var ok bool
for _, rel := range wb.Relationships {