diff options
author | xuri <xuri.me@gmail.com> | 2019-05-11 09:46:20 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2019-05-11 09:46:20 +0800 |
commit | 25763ba3e1af39bf2fd00bfa6aabcb054ca78327 (patch) | |
tree | 051de0dbe58281f7c6d247e53e8273a52353b26a /comment.go | |
parent | 69b38ddcd60f7cf4c158c706ddbbeb89a8ff2108 (diff) |
fixed #373, comments duplicate caused by inner counting errors
Diffstat (limited to 'comment.go')
-rw-r--r-- | comment.go | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -277,13 +277,21 @@ func (f *File) addComment(commentsXML, cell string, formatSet *formatComment) { // countComments provides a function to get comments files count storage in // the folder xl. func (f *File) countComments() int { - count := 0 + c1, c2 := 0, 0 for k := range f.XLSX { if strings.Contains(k, "xl/comments") { - count++ + c1++ } } - return count + for rel := range f.Comments { + if strings.Contains(rel, "xl/comments") { + c2++ + } + } + if c1 < c2 { + return c2 + } + return c1 } // decodeVMLDrawingReader provides a function to get the pointer to the |