summaryrefslogtreecommitdiff
path: root/shape.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 /shape.go
parent1427027e38d6db46d441243f00d6989c2f53e7ce (diff)
Resolve #274, performance optimization for add images, charts and shapes
Diffstat (limited to 'shape.go')
-rw-r--r--shape.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/shape.go b/shape.go
index e2281a2..3cf09d8 100644
--- a/shape.go
+++ b/shape.go
@@ -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