From c5dc63295186ad35ece6a2c9c940e84665f9f98f Mon Sep 17 00:00:00 2001 From: Ri Xu Date: Sat, 3 Jun 2017 17:36:28 +0800 Subject: [PATCH] - Fix missing relationships in drawing content type shall, relate issue #58; - Add a donation link, related issue #57 ^_^ --- README.md | 2 +- chart.go | 1 + xmlDecodeDrawing.go | 1 + xmlDrawing.go | 5 +++-- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b2c2979..2ab87e1 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Go Report Card](https://goreportcard.com/badge/github.com/Luxurioust/excelize)](https://goreportcard.com/report/github.com/Luxurioust/excelize) [![GoDoc](https://godoc.org/github.com/Luxurioust/excelize?status.svg)](https://godoc.org/github.com/Luxurioust/excelize) [![Licenses](https://img.shields.io/badge/license-bsd-orange.svg)](https://opensource.org/licenses/BSD-3-Clause) -[![Join the chat at https://gitter.im/xuri-excelize/Lobby](https://img.shields.io/badge/GITTER-join%20chat-green.svg)](https://gitter.im/xuri-excelize/Lobby) +[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/xuri) ## Introduction diff --git a/chart.go b/chart.go index b8464ad..09cbbad 100644 --- a/chart.go +++ b/chart.go @@ -812,6 +812,7 @@ func (f *File) drawingParser(drawingXML string, content *xlsxWsDr) int { if ok { // Append Model decodeWsDr := decodeWsDr{} xml.Unmarshal([]byte(f.readXML(drawingXML)), &decodeWsDr) + content.R = decodeWsDr.R cNvPrID = len(decodeWsDr.OneCellAnchor) + len(decodeWsDr.TwoCellAnchor) + 1 for _, v := range decodeWsDr.OneCellAnchor { content.OneCellAnchor = append(content.OneCellAnchor, &xdrCellAnchor{ diff --git a/xmlDecodeDrawing.go b/xmlDecodeDrawing.go index bb4cd24..fff6b9d 100644 --- a/xmlDecodeDrawing.go +++ b/xmlDecodeDrawing.go @@ -18,6 +18,7 @@ type decodeCellAnchor struct { type decodeWsDr struct { A string `xml:"xmlns a,attr"` Xdr string `xml:"xmlns xdr,attr"` + R string `xml:"xmlns r,attr"` OneCellAnchor []*decodeCellAnchor `xml:"oneCellAnchor,omitempty"` TwoCellAnchor []*decodeCellAnchor `xml:"twoCellAnchor,omitempty"` XMLName xml.Name `xml:"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing wsDr,omitempty"` diff --git a/xmlDrawing.go b/xmlDrawing.go index 966ca7b..bf263a5 100644 --- a/xmlDrawing.go +++ b/xmlDrawing.go @@ -198,8 +198,9 @@ type xlsxWsDr struct { XMLName xml.Name `xml:"xdr:wsDr"` OneCellAnchor []*xdrCellAnchor `xml:"xdr:oneCellAnchor"` TwoCellAnchor []*xdrCellAnchor `xml:"xdr:twoCellAnchor"` - Xdr string `xml:"xmlns:xdr,attr"` - A string `xml:"xmlns:a,attr"` + A string `xml:"xmlns:a,attr,omitempty"` + Xdr string `xml:"xmlns:xdr,attr,omitempty"` + R string `xml:"xmlns:r,attr,omitempty"` } // xlsxGraphicFrame (Graphic Frame) directly maps the xdr:graphicFrame element. -- GitLab