From 7bc43301dabaef70b785133caf4fb4f1f978e089 Mon Sep 17 00:00:00 2001 From: Ri Xu Date: Mon, 19 Jun 2017 11:18:58 +0800 Subject: - Support insert new lines into shape, relate issue #38, note that the format set parameter of function `AddShape()` changed; - go test and go doc updated --- xmlDrawing.go | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'xmlDrawing.go') diff --git a/xmlDrawing.go b/xmlDrawing.go index bf263a5..e61fe6a 100644 --- a/xmlDrawing.go +++ b/xmlDrawing.go @@ -330,7 +330,7 @@ type aFontRef struct { // paragraphs multiple runs of text. type xdrTxBody struct { BodyPr *aBodyPr `xml:"a:bodyPr"` - P *aP `xml:"a:p"` + P []*aP `xml:"a:p"` } // formatPicture directly maps the format settings of the picture. @@ -346,15 +346,22 @@ type formatPicture struct { // formatShape directly maps the format settings of the shape. type formatShape struct { - Type string `json:"type"` - Width int `json:"width"` - Height int `json:"height"` - Format formatPicture `json:"format"` - Font formatFont `json:"font"` - Text string `json:"text"` - Color formatShapeColor `json:"color"` + Type string `json:"type"` + Width int `json:"width"` + Height int `json:"height"` + Format formatPicture `json:"format"` + Color formatShapeColor `json:"color"` + Paragraph []formatShapeParagraph `json:"paragraph"` } +// formatShapeParagraph directly maps the format settings of the paragraph in +// the shape. +type formatShapeParagraph struct { + Font formatFont `json:"font"` + Text string `json:"text"` +} + +// formatShapeColor directly maps the color settings of the shape. type formatShapeColor struct { Line string `json:"line"` Fill string `json:"fill"` -- cgit v1.2.1