summaryrefslogtreecommitdiff
path: root/shape.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2019-09-16 01:17:35 +0800
committerxuri <xuri.me@gmail.com>2019-09-16 01:17:35 +0800
commit8922f659788187afa6d0a5d3248e999c2c1bb846 (patch)
tree29b2aae2028eaedc448daef08a5670d6f3ca4604 /shape.go
parenta3ee098ab60d9528a0d6b7a7c475ea8ff7ebaba5 (diff)
Combine functions:
workBookRelsWriter, drawingRelsWriter into relsWriter; drawingRelsReader, workbookRelsReader, workSheetRelsReader into relsReader; addDrawingRelationships, addSheetRelationships into addRels
Diffstat (limited to 'shape.go')
-rw-r--r--shape.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/shape.go b/shape.go
index 8d95849..e6a2ff3 100644
--- a/shape.go
+++ b/shape.go
@@ -275,7 +275,9 @@ func (f *File) AddShape(sheet, cell, format string) error {
drawingXML = strings.Replace(sheetRelationshipsDrawingXML, "..", "xl", -1)
} else {
// Add first shape for given sheet.
- rID := f.addSheetRelationships(sheet, SourceRelationshipDrawingML, sheetRelationshipsDrawingXML, "")
+ name, _ := f.sheetMap[trimSheetName(sheet)]
+ sheetRels := "xl/worksheets/_rels/" + strings.TrimPrefix(name, "xl/worksheets/") + ".rels"
+ rID := f.addRels(sheetRels, SourceRelationshipDrawingML, sheetRelationshipsDrawingXML, "")
f.addSheetDrawing(sheet, rID)
}
err = f.addDrawingShape(sheet, drawingXML, cell, formatSet)