diff options
author | xuri <xuri.me@gmail.com> | 2021-07-06 00:31:04 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2021-07-06 00:31:04 +0800 |
commit | b7fece51736977e7d84aca30ecce7f6b3a1251f2 (patch) | |
tree | 77c730b216adbdf54b1b5c3542478bfcb2e5c61b /drawing.go | |
parent | 544ef18a8cb9949fcb8833c6d2816783c90f3318 (diff) |
Support concurrency add picture
Diffstat (limited to 'drawing.go')
-rw-r--r-- | drawing.go | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1173,8 +1173,13 @@ func (f *File) drawingParser(path string) (*xlsxWsDr, int) { } f.Drawings.Store(path, &content) } - wsDr, _ := f.Drawings.Load(path) - return wsDr.(*xlsxWsDr), len(wsDr.(*xlsxWsDr).OneCellAnchor) + len(wsDr.(*xlsxWsDr).TwoCellAnchor) + 2 + var wsDr *xlsxWsDr + if drawing, ok := f.Drawings.Load(path); ok && drawing != nil { + wsDr = drawing.(*xlsxWsDr) + } + wsDr.Lock() + defer wsDr.Unlock() + return wsDr, len(wsDr.OneCellAnchor) + len(wsDr.TwoCellAnchor) + 2 } // addDrawingChart provides a function to add chart graphic frame by given |