summaryrefslogtreecommitdiff
path: root/comment.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2019-02-25 22:14:34 +0800
committerxuri <xuri.me@gmail.com>2019-02-25 22:14:34 +0800
commit1aed1d744b12885c4a88c090494175c59208e038 (patch)
tree36b2f51e17df9dfb30a9466c6dcaa46846a0d589 /comment.go
parent1427027e38d6db46d441243f00d6989c2f53e7ce (diff)
Resolve #274, performance optimization for add images, charts and shapes
Diffstat (limited to 'comment.go')
-rw-r--r--comment.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/comment.go b/comment.go
index 5db6312..c86e932 100644
--- a/comment.go
+++ b/comment.go
@@ -33,10 +33,7 @@ func parseFormatCommentsSet(formatSet string) (*formatComment, error) {
func (f *File) GetComments() (comments map[string][]Comment) {
comments = map[string][]Comment{}
for n := range f.sheetMap {
- c, ok := f.XLSX["xl"+strings.TrimPrefix(f.getSheetComments(f.GetSheetIndex(n)), "..")]
- if ok {
- d := xlsxComments{}
- xml.Unmarshal([]byte(c), &d)
+ if d := f.commentsReader("xl" + strings.TrimPrefix(f.getSheetComments(f.GetSheetIndex(n)), "..")); d != nil {
sheetComments := []Comment{}
for _, comment := range d.CommentList.Comment {
sheetComment := Comment{}
@@ -294,7 +291,7 @@ func (f *File) decodeVMLDrawingReader(path string) *decodeVmlDrawing {
return f.DecodeVMLDrawing[path]
}
-// vmlDrawingWriter provides a function to save xl/drawings/vmlDrawing%d.xml.
+// vmlDrawingWriter provides a function to save xl/drawings/vmlDrawing%d.xml
// after serialize structure.
func (f *File) vmlDrawingWriter() {
for path, vml := range f.VMLDrawing {