summaryrefslogtreecommitdiff
path: root/picture.go
diff options
context:
space:
mode:
authorRi Xu <xuri.me@gmail.com>2017-07-24 10:26:02 +0800
committerRi Xu <xuri.me@gmail.com>2017-07-24 10:26:02 +0800
commit6aa59a1af29c21e0ece37fc94c66bc2999ed3540 (patch)
tree8d09c6b9fc6f5154f5ba9c8cf5e99435fad84de6 /picture.go
parent3b2c80ddc37db87bf090f531ae6afcb70d49b759 (diff)
- Init insert/remove column/row support. Relate issue #77 and #82;
- Readme and go test updated
Diffstat (limited to 'picture.go')
-rw-r--r--picture.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/picture.go b/picture.go
index 3ae309d..f221616 100644
--- a/picture.go
+++ b/picture.go
@@ -127,6 +127,23 @@ func (f *File) addSheetRelationships(sheet, relType, target, targetMode string)
return rID
}
+// deleteSheetRelationships provides function to delete relationships in
+// xl/worksheets/_rels/sheet%d.xml.rels by given sheet name and relationship
+// index.
+func (f *File) deleteSheetRelationships(sheet, rID string) {
+ var rels = "xl/worksheets/_rels/" + strings.ToLower(sheet) + ".xml.rels"
+ var sheetRels xlsxWorkbookRels
+ xml.Unmarshal([]byte(f.readXML(rels)), &sheetRels)
+ for k, v := range sheetRels.Relationships {
+ if v.ID != rID {
+ continue
+ }
+ sheetRels.Relationships = append(sheetRels.Relationships[:k], sheetRels.Relationships[k+1:]...)
+ }
+ output, _ := xml.Marshal(sheetRels)
+ f.saveFileList(rels, string(output))
+}
+
// addSheetLegacyDrawing provides function to add legacy drawing element to
// xl/worksheets/sheet%d.xml by given sheet name and relationship index.
func (f *File) addSheetLegacyDrawing(sheet string, rID int) {