summaryrefslogtreecommitdiff
path: root/picture.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2021-09-10 23:19:59 +0800
committerxuri <xuri.me@gmail.com>2021-09-10 23:19:59 +0800
commit52609ba52678642810363cba485e60f370850ddc (patch)
treecf799e91880b3589088cbc838d8527c4de1f0b29 /picture.go
parentdad8f490cc2df664bf1e7c6770ecd89a0c0e7fe4 (diff)
This closes #1017, fix duplicate image caused by incorrect internal relationships ID calculation
Diffstat (limited to 'picture.go')
-rw-r--r--picture.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/picture.go b/picture.go
index 5f3a375..ecd6d94 100644
--- a/picture.go
+++ b/picture.go
@@ -253,24 +253,20 @@ func (f *File) addSheetPicture(sheet string, rID int) {
// countDrawings provides a function to get drawing files count storage in the
// folder xl/drawings.
-func (f *File) countDrawings() int {
- c1, c2 := 0, 0
+func (f *File) countDrawings() (count int) {
f.Pkg.Range(func(k, v interface{}) bool {
if strings.Contains(k.(string), "xl/drawings/drawing") {
- c1++
+ count++
}
return true
})
f.Drawings.Range(func(rel, value interface{}) bool {
if strings.Contains(rel.(string), "xl/drawings/drawing") {
- c2++
+ count++
}
return true
})
- if c1 < c2 {
- return c2
- }
- return c1
+ return
}
// addDrawingPicture provides a function to add picture by given sheet,