From 0e02329bedf6648259fd219642bb907bdb07fd21 Mon Sep 17 00:00:00 2001
From: xuri <xuri.me@gmail.com>
Date: Sun, 4 Jul 2021 12:13:06 +0800
Subject: This closes #861, support concurrency get cell picture and remove
 unused internal function `getSheetNameByID`

---
 excelize.go | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'excelize.go')

diff --git a/excelize.go b/excelize.go
index 940acf1..66cfd00 100644
--- a/excelize.go
+++ b/excelize.go
@@ -39,7 +39,7 @@ type File struct {
 	CalcChain        *xlsxCalcChain
 	Comments         map[string]*xlsxComments
 	ContentTypes     *xlsxTypes
-	Drawings         map[string]*xlsxWsDr
+	Drawings         sync.Map
 	Path             string
 	SharedStrings    *xlsxSST
 	sharedStringsMap map[string]int
@@ -50,7 +50,7 @@ type File struct {
 	DecodeVMLDrawing map[string]*decodeVmlDrawing
 	VMLDrawing       map[string]*vmlDrawing
 	WorkBook         *xlsxWorkbook
-	Relationships    map[string]*xlsxRelationships
+	Relationships    sync.Map
 	XLSX             map[string][]byte
 	CharsetReader    charsetTranscoderFn
 }
@@ -93,12 +93,12 @@ func newFile() *File {
 		checked:          make(map[string]bool),
 		sheetMap:         make(map[string]string),
 		Comments:         make(map[string]*xlsxComments),
-		Drawings:         make(map[string]*xlsxWsDr),
+		Drawings:         sync.Map{},
 		sharedStringsMap: make(map[string]int),
 		Sheet:            make(map[string]*xlsxWorksheet),
 		DecodeVMLDrawing: make(map[string]*decodeVmlDrawing),
 		VMLDrawing:       make(map[string]*vmlDrawing),
-		Relationships:    make(map[string]*xlsxRelationships),
+		Relationships:    sync.Map{},
 		CharsetReader:    charset.NewReaderLabel,
 	}
 }
@@ -277,7 +277,7 @@ func (f *File) addRels(relPath, relType, target, targetMode string) int {
 		Target:     target,
 		TargetMode: targetMode,
 	})
-	f.Relationships[relPath] = rels
+	f.Relationships.Store(relPath, rels)
 	return rID
 }
 
-- 
cgit v1.2.1