diff options
author | Ri Xu <xuri.me@gmail.com> | 2017-01-19 14:05:32 +0800 |
---|---|---|
committer | Ri Xu <xuri.me@gmail.com> | 2017-01-19 14:05:32 +0800 |
commit | 4a9b39afc634a2399c4729f4fb47c9f290ab1ee5 (patch) | |
tree | 71d673195ccae30d6ef174611f6cf362be7e9133 /picture.go | |
parent | 52796f6e58e95145e2964d0d313a2f721dcc040e (diff) |
- Add hyperlink and set formula support for cell support;
- Character limits for cells added;
- Update go test and fix typo
Diffstat (limited to 'picture.go')
-rw-r--r-- | picture.go | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -53,7 +53,7 @@ func (f *File) AddPicture(sheet string, xAxis string, yAxis string, picture stri drawingXML = strings.Replace(sheetRelationshipsDrawingXML, "..", "xl", -1) } else { // Add first picture for given sheet. - rID := f.addSheetRelationships(sheet, SourceRelationshipDrawingML, sheetRelationshipsDrawingXML) + rID := f.addSheetRelationships(sheet, SourceRelationshipDrawingML, sheetRelationshipsDrawingXML, "") f.addSheetDrawing(sheet, rID) } drawingRID = f.addDrawingRelationships(drawingID, SourceRelationshipImage, "../media/image"+strconv.Itoa(pictureID)+ext) @@ -66,7 +66,7 @@ func (f *File) AddPicture(sheet string, xAxis string, yAxis string, picture stri // addSheetRelationships provides function to add // xl/worksheets/_rels/sheet%d.xml.rels by given sheet name, relationship type // and target. -func (f *File) addSheetRelationships(sheet string, relType string, target string) int { +func (f *File) addSheetRelationships(sheet, relType, target, targetMode string) int { var rels = "xl/worksheets/_rels/" + strings.ToLower(sheet) + ".xml.rels" var sheetRels xlsxWorkbookRels var rID = 1 @@ -82,9 +82,10 @@ func (f *File) addSheetRelationships(sheet string, relType string, target string ID.WriteString(strconv.Itoa(rID)) } sheetRels.Relationships = append(sheetRels.Relationships, xlsxWorkbookRelation{ - ID: ID.String(), - Type: relType, - Target: target, + ID: ID.String(), + Type: relType, + Target: target, + TargetMode: targetMode, }) output, err := xml.Marshal(sheetRels) if err != nil { |