Skip to content

Commit d81b4c8

Browse files
committed
This closes qax-os#1957, fix missing shape macro missing after adjusted drawing object
1 parent 4dd3447 commit d81b4c8

File tree

3 files changed

+31
-18
lines changed

3 files changed

+31
-18
lines changed

xmlDecodeDrawing.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type decodeCellAnchorPos struct {
3636
To *xlsxTo `xml:"to"`
3737
Pos *xlsxInnerXML `xml:"pos"`
3838
Ext *xlsxInnerXML `xml:"ext"`
39-
Sp *xlsxInnerXML `xml:"sp"`
39+
Sp *xlsxSp `xml:"sp"`
4040
GrpSp *xlsxInnerXML `xml:"grpSp"`
4141
GraphicFrame *xlsxInnerXML `xml:"graphicFrame"`
4242
CxnSp *xlsxInnerXML `xml:"cxnSp"`
@@ -46,16 +46,14 @@ type decodeCellAnchorPos struct {
4646
ClientData *xlsxInnerXML `xml:"clientData"`
4747
}
4848

49-
// xdrSp (Shape) directly maps the sp element. This element specifies the
50-
// existence of a single shape. A shape can either be a preset or a custom
51-
// geometry, defined using the SpreadsheetDrawingML framework. In addition to
52-
// a geometry each shape can have both visual and non-visual properties
53-
// attached. Text and corresponding styling information can also be attached
54-
// to a shape. This shape is specified along with all other shapes within
55-
// either the shape tree or group shape elements.
49+
// decodeSp defines the structure used to deserialize the sp element.
5650
type decodeSp struct {
57-
NvSpPr *decodeNvSpPr `xml:"nvSpPr"`
58-
SpPr *decodeSpPr `xml:"spPr"`
51+
Macro string `xml:"macro,attr,omitempty"`
52+
TextLink string `xml:"textlink,attr,omitempty"`
53+
FLocksText bool `xml:"fLocksText,attr,omitempty"`
54+
FPublished *bool `xml:"fPublished,attr"`
55+
NvSpPr *decodeNvSpPr `xml:"nvSpPr"`
56+
SpPr *decodeSpPr `xml:"spPr"`
5957
}
6058

6159
// decodeSp (Non-Visual Properties for a Shape) directly maps the nvSpPr

xmlDrawing.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ type xlsxCellAnchorPos struct {
238238
To *xlsxTo `xml:"xdr:to"`
239239
Pos *xlsxInnerXML `xml:"xdr:pos"`
240240
Ext *xlsxInnerXML `xml:"xdr:ext"`
241-
Sp *xlsxInnerXML `xml:"xdr:sp"`
241+
Sp *xlsxSp `xml:"xdr:sp"`
242242
GrpSp *xlsxInnerXML `xml:"xdr:grpSp"`
243243
GraphicFrame *xlsxInnerXML `xml:"xdr:graphicFrame"`
244244
CxnSp *xlsxInnerXML `xml:"xdr:cxnSp"`
@@ -248,6 +248,21 @@ type xlsxCellAnchorPos struct {
248248
ClientData *xlsxInnerXML `xml:"xdr:clientData"`
249249
}
250250

251+
// xdrSp (Shape) directly maps the sp element. This element specifies the
252+
// existence of a single shape. A shape can either be a preset or a custom
253+
// geometry, defined using the SpreadsheetDrawingML framework. In addition to
254+
// a geometry each shape can have both visual and non-visual properties
255+
// attached. Text and corresponding styling information can also be attached
256+
// to a shape. This shape is specified along with all other shapes within
257+
// either the shape tree or group shape elements.
258+
type xlsxSp struct {
259+
Macro string `xml:"macro,attr,omitempty"`
260+
TextLink string `xml:"textlink,attr,omitempty"`
261+
FLocksText bool `xml:"fLocksText,attr,omitempty"`
262+
FPublished *bool `xml:"fPublished,attr"`
263+
Content string `xml:",innerxml"`
264+
}
265+
251266
// xlsxPoint2D describes the position of a drawing element within a spreadsheet.
252267
type xlsxPoint2D struct {
253268
XMLName xml.Name `xml:"xdr:pos"`

xmlPivotTable.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ type xlsxPivotTableDefinition struct {
5656
EnableDrill bool `xml:"enableDrill,attr,omitempty"`
5757
EnableFieldProperties bool `xml:"enableFieldProperties,attr,omitempty"`
5858
PreserveFormatting bool `xml:"preserveFormatting,attr,omitempty"`
59-
UseAutoFormatting *bool `xml:"useAutoFormatting,attr,omitempty"`
59+
UseAutoFormatting *bool `xml:"useAutoFormatting,attr"`
6060
PageWrap int `xml:"pageWrap,attr,omitempty"`
61-
PageOverThenDown *bool `xml:"pageOverThenDown,attr,omitempty"`
61+
PageOverThenDown *bool `xml:"pageOverThenDown,attr"`
6262
SubtotalHiddenItems bool `xml:"subtotalHiddenItems,attr,omitempty"`
63-
RowGrandTotals *bool `xml:"rowGrandTotals,attr,omitempty"`
64-
ColGrandTotals *bool `xml:"colGrandTotals,attr,omitempty"`
63+
RowGrandTotals *bool `xml:"rowGrandTotals,attr"`
64+
ColGrandTotals *bool `xml:"colGrandTotals,attr"`
6565
FieldPrintTitles bool `xml:"fieldPrintTitles,attr,omitempty"`
6666
ItemPrintTitles bool `xml:"itemPrintTitles,attr,omitempty"`
67-
MergeItem *bool `xml:"mergeItem,attr,omitempty"`
67+
MergeItem *bool `xml:"mergeItem,attr"`
6868
ShowDropZones bool `xml:"showDropZones,attr,omitempty"`
6969
CreatedVersion int `xml:"createdVersion,attr,omitempty"`
7070
Indent int `xml:"indent,attr,omitempty"`
@@ -74,7 +74,7 @@ type xlsxPivotTableDefinition struct {
7474
Compact *bool `xml:"compact,attr"`
7575
Outline *bool `xml:"outline,attr"`
7676
OutlineData bool `xml:"outlineData,attr,omitempty"`
77-
CompactData *bool `xml:"compactData,attr,omitempty"`
77+
CompactData *bool `xml:"compactData,attr"`
7878
Published bool `xml:"published,attr,omitempty"`
7979
GridDropZones bool `xml:"gridDropZones,attr,omitempty"`
8080
Immersive bool `xml:"immersive,attr,omitempty"`
@@ -150,7 +150,7 @@ type xlsxPivotField struct {
150150
DataSourceSort bool `xml:"dataSourceSort,attr,omitempty"`
151151
NonAutoSortDefault bool `xml:"nonAutoSortDefault,attr,omitempty"`
152152
RankBy int `xml:"rankBy,attr,omitempty"`
153-
DefaultSubtotal *bool `xml:"defaultSubtotal,attr,omitempty"`
153+
DefaultSubtotal *bool `xml:"defaultSubtotal,attr"`
154154
SumSubtotal bool `xml:"sumSubtotal,attr,omitempty"`
155155
CountASubtotal bool `xml:"countASubtotal,attr,omitempty"`
156156
AvgSubtotal bool `xml:"avgSubtotal,attr,omitempty"`

0 commit comments

Comments
 (0)