From 76219275737f28d1b58ac4c693c5e8f59daf53fd Mon Sep 17 00:00:00 2001 From: Ri Xu Date: Sat, 3 Feb 2018 15:02:37 +0800 Subject: - Add a hyperlink to an image support for the function `AddPicture()`, relate issue #185; - go test and document has been updated. --- xmlDrawing.go | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'xmlDrawing.go') diff --git a/xmlDrawing.go b/xmlDrawing.go index e61fe6a..600d83a 100644 --- a/xmlDrawing.go +++ b/xmlDrawing.go @@ -30,10 +30,26 @@ var supportImageTypes = map[string]string{".gif": ".gif", ".jpg": ".jpeg", ".jpe // element specifies non-visual canvas properties. This allows for additional // information that does not affect the appearance of the picture to be stored. type xlsxCNvPr struct { - ID int `xml:"id,attr"` - Name string `xml:"name,attr"` - Descr string `xml:"descr,attr"` - Title string `xml:"title,attr,omitempty"` + ID int `xml:"id,attr"` + Name string `xml:"name,attr"` + Descr string `xml:"descr,attr"` + Title string `xml:"title,attr,omitempty"` + HlinkClick *xlsxHlinkClick `xml:"a:hlinkClick"` +} + +// xlsxHlinkClick (Click Hyperlink) Specifies the on-click hyperlink +// information to be applied to a run of text. When the hyperlink text is +// clicked the link is fetched. +type xlsxHlinkClick struct { + R string `xml:"xmlns:r,attr,omitempty"` + RID string `xml:"r:id,attr,omitempty"` + InvalidURL string `xml:"invalidUrl,attr,omitempty"` + Action string `xml:"action,attr,omitempty"` + TgtFrame string `xml:"tgtFrame,attr,omitempty"` + Tooltip string `xml:"tooltip,attr,omitempty"` + History bool `xml:"history,attr,omitempty"` + HighlightClick bool `xml:"highlightClick,attr,omitempty"` + EndSnd bool `xml:"endSnd,attr,omitempty"` } // xlsxPicLocks directly maps the picLocks (Picture Locks). This element @@ -342,6 +358,8 @@ type formatPicture struct { OffsetY int `json:"y_offset"` XScale float64 `json:"x_scale"` YScale float64 `json:"y_scale"` + Hyperlink string `json:"hyperlink"` + HyperlinkType string `json:"hyperlink_type"` } // formatShape directly maps the format settings of the shape. -- cgit v1.2.1