diff --git a/xmlDecodeDrawing.go b/xmlDecodeDrawing.go index 8cd7625fe7..5c900fc373 100644 --- a/xmlDecodeDrawing.go +++ b/xmlDecodeDrawing.go @@ -36,7 +36,7 @@ type decodeCellAnchorPos struct { To *xlsxTo `xml:"to"` Pos *xlsxInnerXML `xml:"pos"` Ext *xlsxInnerXML `xml:"ext"` - Sp *xlsxInnerXML `xml:"sp"` + Sp *xlsxSp `xml:"sp"` GrpSp *xlsxInnerXML `xml:"grpSp"` GraphicFrame *xlsxInnerXML `xml:"graphicFrame"` CxnSp *xlsxInnerXML `xml:"cxnSp"` @@ -46,16 +46,14 @@ type decodeCellAnchorPos struct { ClientData *xlsxInnerXML `xml:"clientData"` } -// xdrSp (Shape) directly maps the sp element. This element specifies the -// existence of a single shape. A shape can either be a preset or a custom -// geometry, defined using the SpreadsheetDrawingML framework. In addition to -// a geometry each shape can have both visual and non-visual properties -// attached. Text and corresponding styling information can also be attached -// to a shape. This shape is specified along with all other shapes within -// either the shape tree or group shape elements. +// decodeSp defines the structure used to deserialize the sp element. type decodeSp struct { - NvSpPr *decodeNvSpPr `xml:"nvSpPr"` - SpPr *decodeSpPr `xml:"spPr"` + Macro string `xml:"macro,attr,omitempty"` + TextLink string `xml:"textlink,attr,omitempty"` + FLocksText bool `xml:"fLocksText,attr,omitempty"` + FPublished *bool `xml:"fPublished,attr"` + NvSpPr *decodeNvSpPr `xml:"nvSpPr"` + SpPr *decodeSpPr `xml:"spPr"` } // decodeSp (Non-Visual Properties for a Shape) directly maps the nvSpPr diff --git a/xmlDrawing.go b/xmlDrawing.go index f3dbf0997f..3d39d35d94 100644 --- a/xmlDrawing.go +++ b/xmlDrawing.go @@ -238,7 +238,7 @@ type xlsxCellAnchorPos struct { To *xlsxTo `xml:"xdr:to"` Pos *xlsxInnerXML `xml:"xdr:pos"` Ext *xlsxInnerXML `xml:"xdr:ext"` - Sp *xlsxInnerXML `xml:"xdr:sp"` + Sp *xlsxSp `xml:"xdr:sp"` GrpSp *xlsxInnerXML `xml:"xdr:grpSp"` GraphicFrame *xlsxInnerXML `xml:"xdr:graphicFrame"` CxnSp *xlsxInnerXML `xml:"xdr:cxnSp"` @@ -248,6 +248,21 @@ type xlsxCellAnchorPos struct { ClientData *xlsxInnerXML `xml:"xdr:clientData"` } +// xdrSp (Shape) directly maps the sp element. This element specifies the +// existence of a single shape. A shape can either be a preset or a custom +// geometry, defined using the SpreadsheetDrawingML framework. In addition to +// a geometry each shape can have both visual and non-visual properties +// attached. Text and corresponding styling information can also be attached +// to a shape. This shape is specified along with all other shapes within +// either the shape tree or group shape elements. +type xlsxSp struct { + Macro string `xml:"macro,attr,omitempty"` + TextLink string `xml:"textlink,attr,omitempty"` + FLocksText bool `xml:"fLocksText,attr,omitempty"` + FPublished *bool `xml:"fPublished,attr"` + Content string `xml:",innerxml"` +} + // xlsxPoint2D describes the position of a drawing element within a spreadsheet. type xlsxPoint2D struct { XMLName xml.Name `xml:"xdr:pos"` diff --git a/xmlPivotTable.go b/xmlPivotTable.go index 41405c3e85..fd45ca84eb 100644 --- a/xmlPivotTable.go +++ b/xmlPivotTable.go @@ -56,15 +56,15 @@ type xlsxPivotTableDefinition struct { EnableDrill bool `xml:"enableDrill,attr,omitempty"` EnableFieldProperties bool `xml:"enableFieldProperties,attr,omitempty"` PreserveFormatting bool `xml:"preserveFormatting,attr,omitempty"` - UseAutoFormatting *bool `xml:"useAutoFormatting,attr,omitempty"` + UseAutoFormatting *bool `xml:"useAutoFormatting,attr"` PageWrap int `xml:"pageWrap,attr,omitempty"` - PageOverThenDown *bool `xml:"pageOverThenDown,attr,omitempty"` + PageOverThenDown *bool `xml:"pageOverThenDown,attr"` SubtotalHiddenItems bool `xml:"subtotalHiddenItems,attr,omitempty"` - RowGrandTotals *bool `xml:"rowGrandTotals,attr,omitempty"` - ColGrandTotals *bool `xml:"colGrandTotals,attr,omitempty"` + RowGrandTotals *bool `xml:"rowGrandTotals,attr"` + ColGrandTotals *bool `xml:"colGrandTotals,attr"` FieldPrintTitles bool `xml:"fieldPrintTitles,attr,omitempty"` ItemPrintTitles bool `xml:"itemPrintTitles,attr,omitempty"` - MergeItem *bool `xml:"mergeItem,attr,omitempty"` + MergeItem *bool `xml:"mergeItem,attr"` ShowDropZones bool `xml:"showDropZones,attr,omitempty"` CreatedVersion int `xml:"createdVersion,attr,omitempty"` Indent int `xml:"indent,attr,omitempty"` @@ -74,7 +74,7 @@ type xlsxPivotTableDefinition struct { Compact *bool `xml:"compact,attr"` Outline *bool `xml:"outline,attr"` OutlineData bool `xml:"outlineData,attr,omitempty"` - CompactData *bool `xml:"compactData,attr,omitempty"` + CompactData *bool `xml:"compactData,attr"` Published bool `xml:"published,attr,omitempty"` GridDropZones bool `xml:"gridDropZones,attr,omitempty"` Immersive bool `xml:"immersive,attr,omitempty"` @@ -150,7 +150,7 @@ type xlsxPivotField struct { DataSourceSort bool `xml:"dataSourceSort,attr,omitempty"` NonAutoSortDefault bool `xml:"nonAutoSortDefault,attr,omitempty"` RankBy int `xml:"rankBy,attr,omitempty"` - DefaultSubtotal *bool `xml:"defaultSubtotal,attr,omitempty"` + DefaultSubtotal *bool `xml:"defaultSubtotal,attr"` SumSubtotal bool `xml:"sumSubtotal,attr,omitempty"` CountASubtotal bool `xml:"countASubtotal,attr,omitempty"` AvgSubtotal bool `xml:"avgSubtotal,attr,omitempty"`