From 1aed1d744b12885c4a88c090494175c59208e038 Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 25 Feb 2019 22:14:34 +0800 Subject: Resolve #274, performance optimization for add images, charts and shapes --- comment.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'comment.go') 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 { -- cgit v1.2.1