@@ -53,23 +53,27 @@ type xlsxDrawing struct {
53
53
// footers on the first page can differ from those on odd- and even-numbered
54
54
// pages. In the latter case, the first page is not considered an odd page.
55
55
type xlsxHeaderFooter struct {
56
- DifferentFirst bool `xml:"differentFirst,attr,omitempty"`
57
- DifferentOddEven bool `xml:"differentOddEven,attr,omitempty"`
58
- OddHeader []* xlsxOddHeader `xml:"oddHeader"`
59
- OddFooter []* xlsxOddFooter `xml:"oddFooter"`
60
- }
61
-
62
- // xlsxOddHeader directly maps the oddHeader element in the namespace
63
- // http://schemas.openxmlformats.org/spreadsheetml/2006/main - currently I have
64
- // not checked it for completeness - it does as much as I need.
65
- type xlsxOddHeader struct {
66
- Content string `xml:",chardata"`
67
- }
68
-
69
- // xlsxOddFooter directly maps the oddFooter element in the namespace
70
- // http://schemas.openxmlformats.org/spreadsheetml/2006/main - currently I have
71
- // not checked it for completeness - it does as much as I need.
72
- type xlsxOddFooter struct {
56
+ AlignWithMargins bool `xml:"alignWithMargins,attr,omitempty"`
57
+ DifferentFirst bool `xml:"differentFirst,attr,omitempty"`
58
+ DifferentOddEven bool `xml:"differentOddEven,attr,omitempty"`
59
+ ScaleWithDoc bool `xml:"scaleWithDoc,attr,omitempty"`
60
+ OddHeader string `xml:"oddHeader,omitempty"`
61
+ OddFooter string `xml:"oddFooter,omitempty"`
62
+ EvenHeader string `xml:"evenHeader,omitempty"`
63
+ EvenFooter string `xml:"evenFooter,omitempty"`
64
+ FirstFooter string `xml:"firstFooter,omitempty"`
65
+ FirstHeader string `xml:"firstHeader,omitempty"`
66
+ DrawingHF * xlsxDrawingHF `xml:"drawingHF"`
67
+ }
68
+
69
+ // xlsxDrawingHF (Drawing Reference in Header Footer) specifies the usage of
70
+ // drawing objects to be rendered in the headers and footers of the sheet. It
71
+ // specifies an explicit relationship to the part containing the DrawingML
72
+ // shapes used in the headers and footers. It also indicates where in the
73
+ // headers and footers each shape belongs. One drawing object can appear in
74
+ // each of the left section, center section and right section of a header and
75
+ // a footer.
76
+ type xlsxDrawingHF struct {
73
77
Content string `xml:",chardata"`
74
78
}
75
79
@@ -324,16 +328,16 @@ type DataValidation struct {
324
328
Error * string `xml:"error,attr"`
325
329
ErrorStyle * string `xml:"errorStyle,attr"`
326
330
ErrorTitle * string `xml:"errorTitle,attr"`
327
- Operator string `xml:"operator,attr"`
331
+ Operator string `xml:"operator,attr,omitempty "`
328
332
Prompt * string `xml:"prompt,attr"`
329
- PromptTitle * string `xml:"promptTitle"`
330
- ShowDropDown bool `xml:"showDropDown,attr"`
331
- ShowErrorMessage bool `xml:"showErrorMessage,attr"`
332
- ShowInputMessage bool `xml:"showInputMessage,attr"`
333
+ PromptTitle * string `xml:"promptTitle,attr "`
334
+ ShowDropDown bool `xml:"showDropDown,attr,omitempty "`
335
+ ShowErrorMessage bool `xml:"showErrorMessage,attr,omitempty "`
336
+ ShowInputMessage bool `xml:"showInputMessage,attr,omitempty "`
333
337
Sqref string `xml:"sqref,attr"`
334
338
Type string `xml:"type,attr"`
335
- Formula1 string `xml:"formula1 "`
336
- Formula2 string `xml:"formula2 "`
339
+ Formula1 string `xml:",innerxml "`
340
+ Formula2 string `xml:",innerxml "`
337
341
}
338
342
339
343
// xlsxC directly maps the c element in the namespace
@@ -482,7 +486,7 @@ type xlsxIconSet struct {
482
486
type xlsxCfvo struct {
483
487
Gte bool `xml:"gte,attr,omitempty"`
484
488
Type string `xml:"type,attr,omitempty"`
485
- Val string `xml:"val,attr"`
489
+ Val string `xml:"val,attr,omitempty "`
486
490
ExtLst * xlsxExtLst `xml:"extLst"`
487
491
}
488
492
@@ -627,3 +631,17 @@ type FormatSheetProtection struct {
627
631
SelectUnlockedCells bool
628
632
Sort bool
629
633
}
634
+
635
+ // FormatHeaderFooter directly maps the settings of header and footer.
636
+ type FormatHeaderFooter struct {
637
+ AlignWithMargins bool
638
+ DifferentFirst bool
639
+ DifferentOddEven bool
640
+ ScaleWithDoc bool
641
+ OddHeader string
642
+ OddFooter string
643
+ EvenHeader string
644
+ EvenFooter string
645
+ FirstFooter string
646
+ FirstHeader string
647
+ }
0 commit comments