diff options
author | xuri <xuri.me@gmail.com> | 2019-02-25 22:14:34 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2019-02-25 22:14:34 +0800 |
commit | 1aed1d744b12885c4a88c090494175c59208e038 (patch) | |
tree | 36b2f51e17df9dfb30a9466c6dcaa46846a0d589 /shape.go | |
parent | 1427027e38d6db46d441243f00d6989c2f53e7ce (diff) |
Resolve #274, performance optimization for add images, charts and shapes
Diffstat (limited to 'shape.go')
-rw-r--r-- | shape.go | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -11,7 +11,6 @@ package excelize import ( "encoding/json" - "encoding/xml" "strconv" "strings" ) @@ -293,10 +292,7 @@ func (f *File) addDrawingShape(sheet, drawingXML, cell string, formatSet *format width := int(float64(formatSet.Width) * formatSet.Format.XScale) height := int(float64(formatSet.Height) * formatSet.Format.YScale) colStart, rowStart, _, _, colEnd, rowEnd, x2, y2 := f.positionObjectPixels(sheet, col, row, formatSet.Format.OffsetX, formatSet.Format.OffsetY, width, height) - content := xlsxWsDr{} - content.A = NameSpaceDrawingML - content.Xdr = NameSpaceDrawingMLSpreadSheet - cNvPrID := f.drawingParser(drawingXML, &content) + content, cNvPrID := f.drawingParser(drawingXML) twoCellAnchor := xdrCellAnchor{} twoCellAnchor.EditAs = formatSet.Format.Positioning from := xlsxFrom{} @@ -402,8 +398,7 @@ func (f *File) addDrawingShape(sheet, drawingXML, cell string, formatSet *format FPrintsWithSheet: formatSet.Format.FPrintsWithSheet, } content.TwoCellAnchor = append(content.TwoCellAnchor, &twoCellAnchor) - output, _ := xml.Marshal(content) - f.saveFileList(drawingXML, output) + f.Drawings[drawingXML] = content } // setShapeRef provides a function to set color with hex model by given actual |