This closes #1119, style parsing issue fixed

pull/2/head
xuri 3 years ago
parent 67127883dd
commit 236ee61d20
No known key found for this signature in database
GPG Key ID: BA5E5BB1C948EDF7

@ -473,6 +473,8 @@ func (avb *attrValBool) UnmarshalXML(d *xml.Decoder, start xml.StartElement) err
return nil return nil
} }
} }
defaultVal := true
avb.Val = &defaultVal
return nil return nil
} }

@ -78,7 +78,7 @@ type decodeWsDr struct {
type decodeTwoCellAnchor struct { type decodeTwoCellAnchor struct {
From *decodeFrom `xml:"from"` From *decodeFrom `xml:"from"`
To *decodeTo `xml:"to"` To *decodeTo `xml:"to"`
Pic *decodePic `xml:"pic,omitempty"` Pic *decodePic `xml:"pic"`
ClientData *decodeClientData `xml:"clientData"` ClientData *decodeClientData `xml:"clientData"`
} }

@ -20,16 +20,16 @@ import (
type xlsxStyleSheet struct { type xlsxStyleSheet struct {
sync.Mutex sync.Mutex
XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main styleSheet"` XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main styleSheet"`
NumFmts *xlsxNumFmts `xml:"numFmts,omitempty"` NumFmts *xlsxNumFmts `xml:"numFmts"`
Fonts *xlsxFonts `xml:"fonts,omitempty"` Fonts *xlsxFonts `xml:"fonts"`
Fills *xlsxFills `xml:"fills,omitempty"` Fills *xlsxFills `xml:"fills"`
Borders *xlsxBorders `xml:"borders,omitempty"` Borders *xlsxBorders `xml:"borders"`
CellStyleXfs *xlsxCellStyleXfs `xml:"cellStyleXfs,omitempty"` CellStyleXfs *xlsxCellStyleXfs `xml:"cellStyleXfs"`
CellXfs *xlsxCellXfs `xml:"cellXfs,omitempty"` CellXfs *xlsxCellXfs `xml:"cellXfs"`
CellStyles *xlsxCellStyles `xml:"cellStyles,omitempty"` CellStyles *xlsxCellStyles `xml:"cellStyles"`
Dxfs *xlsxDxfs `xml:"dxfs,omitempty"` Dxfs *xlsxDxfs `xml:"dxfs"`
TableStyles *xlsxTableStyles `xml:"tableStyles,omitempty"` TableStyles *xlsxTableStyles `xml:"tableStyles"`
Colors *xlsxStyleColors `xml:"colors,omitempty"` Colors *xlsxStyleColors `xml:"colors"`
ExtLst *xlsxExtLst `xml:"extLst"` ExtLst *xlsxExtLst `xml:"extLst"`
} }
@ -60,7 +60,7 @@ type xlsxProtection struct {
// xlsxLine expresses a single set of cell border. // xlsxLine expresses a single set of cell border.
type xlsxLine struct { type xlsxLine struct {
Style string `xml:"style,attr,omitempty"` Style string `xml:"style,attr,omitempty"`
Color *xlsxColor `xml:"color,omitempty"` Color *xlsxColor `xml:"color"`
} }
// xlsxColor is a common mapping used for both the fgColor and bgColor elements. // xlsxColor is a common mapping used for both the fgColor and bgColor elements.
@ -87,13 +87,13 @@ type xlsxFonts struct {
// xlsxFont directly maps the font element. This element defines the // xlsxFont directly maps the font element. This element defines the
// properties for one of the fonts used in this workbook. // properties for one of the fonts used in this workbook.
type xlsxFont struct { type xlsxFont struct {
B *attrValBool `xml:"b,omitempty"` B *attrValBool `xml:"b"`
I *attrValBool `xml:"i,omitempty"` I *attrValBool `xml:"i"`
Strike *attrValBool `xml:"strike,omitempty"` Strike *attrValBool `xml:"strike"`
Outline *attrValBool `xml:"outline,omitempty"` Outline *attrValBool `xml:"outline"`
Shadow *attrValBool `xml:"shadow,omitempty"` Shadow *attrValBool `xml:"shadow"`
Condense *attrValBool `xml:"condense,omitempty"` Condense *attrValBool `xml:"condense"`
Extend *attrValBool `xml:"extend,omitempty"` Extend *attrValBool `xml:"extend"`
U *attrValString `xml:"u"` U *attrValString `xml:"u"`
Sz *attrValFloat `xml:"sz"` Sz *attrValFloat `xml:"sz"`
Color *xlsxColor `xml:"color"` Color *xlsxColor `xml:"color"`
@ -109,14 +109,14 @@ type xlsxFont struct {
// applied across the cell. // applied across the cell.
type xlsxFills struct { type xlsxFills struct {
Count int `xml:"count,attr"` Count int `xml:"count,attr"`
Fill []*xlsxFill `xml:"fill,omitempty"` Fill []*xlsxFill `xml:"fill"`
} }
// xlsxFill directly maps the fill element. This element specifies fill // xlsxFill directly maps the fill element. This element specifies fill
// formatting. // formatting.
type xlsxFill struct { type xlsxFill struct {
PatternFill *xlsxPatternFill `xml:"patternFill,omitempty"` PatternFill *xlsxPatternFill `xml:"patternFill"`
GradientFill *xlsxGradientFill `xml:"gradientFill,omitempty"` GradientFill *xlsxGradientFill `xml:"gradientFill"`
} }
// xlsxPatternFill is used to specify cell fill information for pattern and // xlsxPatternFill is used to specify cell fill information for pattern and
@ -138,7 +138,7 @@ type xlsxGradientFill struct {
Right float64 `xml:"right,attr,omitempty"` Right float64 `xml:"right,attr,omitempty"`
Top float64 `xml:"top,attr,omitempty"` Top float64 `xml:"top,attr,omitempty"`
Type string `xml:"type,attr,omitempty"` Type string `xml:"type,attr,omitempty"`
Stop []*xlsxGradientFillStop `xml:"stop,omitempty"` Stop []*xlsxGradientFillStop `xml:"stop"`
} }
// xlsxGradientFillStop directly maps the stop element. // xlsxGradientFillStop directly maps the stop element.
@ -152,7 +152,7 @@ type xlsxGradientFillStop struct {
// the workbook. // the workbook.
type xlsxBorders struct { type xlsxBorders struct {
Count int `xml:"count,attr"` Count int `xml:"count,attr"`
Border []*xlsxBorder `xml:"border,omitempty"` Border []*xlsxBorder `xml:"border"`
} }
// xlsxBorder directly maps the border element. Expresses a single set of cell // xlsxBorder directly maps the border element. Expresses a single set of cell
@ -177,7 +177,7 @@ type xlsxBorder struct {
type xlsxCellStyles struct { type xlsxCellStyles struct {
XMLName xml.Name `xml:"cellStyles"` XMLName xml.Name `xml:"cellStyles"`
Count int `xml:"count,attr"` Count int `xml:"count,attr"`
CellStyle []*xlsxCellStyle `xml:"cellStyle,omitempty"` CellStyle []*xlsxCellStyle `xml:"cellStyle"`
} }
// xlsxCellStyle directly maps the cellStyle element. This element represents // xlsxCellStyle directly maps the cellStyle element. This element represents
@ -187,10 +187,10 @@ type xlsxCellStyle struct {
XMLName xml.Name `xml:"cellStyle"` XMLName xml.Name `xml:"cellStyle"`
Name string `xml:"name,attr"` Name string `xml:"name,attr"`
XfID int `xml:"xfId,attr"` XfID int `xml:"xfId,attr"`
BuiltInID *int `xml:"builtinId,attr,omitempty"` BuiltInID *int `xml:"builtinId,attr"`
ILevel *int `xml:"iLevel,attr,omitempty"` ILevel *int `xml:"iLevel,attr"`
Hidden *bool `xml:"hidden,attr,omitempty"` Hidden *bool `xml:"hidden,attr"`
CustomBuiltIn *bool `xml:"customBuiltin,attr,omitempty"` CustomBuiltIn *bool `xml:"customBuiltin,attr"`
} }
// xlsxCellStyleXfs directly maps the cellStyleXfs element. This element // xlsxCellStyleXfs directly maps the cellStyleXfs element. This element
@ -245,7 +245,7 @@ type xlsxCellXfs struct {
// to any formatting already present on the object using the dxf record. // to any formatting already present on the object using the dxf record.
type xlsxDxfs struct { type xlsxDxfs struct {
Count int `xml:"count,attr"` Count int `xml:"count,attr"`
Dxfs []*xlsxDxf `xml:"dxf,omitempty"` Dxfs []*xlsxDxf `xml:"dxf"`
} }
// xlsxDxf directly maps the dxf element. A single dxf record, expressing // xlsxDxf directly maps the dxf element. A single dxf record, expressing
@ -273,7 +273,7 @@ type xlsxTableStyles struct {
Count int `xml:"count,attr"` Count int `xml:"count,attr"`
DefaultPivotStyle string `xml:"defaultPivotStyle,attr"` DefaultPivotStyle string `xml:"defaultPivotStyle,attr"`
DefaultTableStyle string `xml:"defaultTableStyle,attr"` DefaultTableStyle string `xml:"defaultTableStyle,attr"`
TableStyles []*xlsxTableStyle `xml:"tableStyle,omitempty"` TableStyles []*xlsxTableStyle `xml:"tableStyle"`
} }
// xlsxTableStyle directly maps the tableStyle element. This element represents // xlsxTableStyle directly maps the tableStyle element. This element represents
@ -293,7 +293,7 @@ type xlsxTableStyle struct {
// to format and render the numeric value of a cell. // to format and render the numeric value of a cell.
type xlsxNumFmts struct { type xlsxNumFmts struct {
Count int `xml:"count,attr"` Count int `xml:"count,attr"`
NumFmt []*xlsxNumFmt `xml:"numFmt,omitempty"` NumFmt []*xlsxNumFmt `xml:"numFmt"`
} }
// xlsxNumFmt directly maps the numFmt element. This element specifies number // xlsxNumFmt directly maps the numFmt element. This element specifies number

@ -113,15 +113,15 @@ type xlsxPageSetUp struct {
Errors string `xml:"errors,attr,omitempty"` Errors string `xml:"errors,attr,omitempty"`
FirstPageNumber string `xml:"firstPageNumber,attr,omitempty"` FirstPageNumber string `xml:"firstPageNumber,attr,omitempty"`
FitToHeight *int `xml:"fitToHeight,attr"` FitToHeight *int `xml:"fitToHeight,attr"`
FitToWidth *int `xml:"fitToWidth,attr,omitempty"` FitToWidth *int `xml:"fitToWidth,attr"`
HorizontalDPI int `xml:"horizontalDpi,attr,omitempty"` HorizontalDPI int `xml:"horizontalDpi,attr,omitempty"`
RID string `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"` RID string `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"`
Orientation string `xml:"orientation,attr,omitempty"` Orientation string `xml:"orientation,attr,omitempty"`
PageOrder string `xml:"pageOrder,attr,omitempty"` PageOrder string `xml:"pageOrder,attr,omitempty"`
PaperHeight string `xml:"paperHeight,attr,omitempty"` PaperHeight string `xml:"paperHeight,attr,omitempty"`
PaperSize *int `xml:"paperSize,attr,omitempty"` PaperSize *int `xml:"paperSize,attr"`
PaperWidth string `xml:"paperWidth,attr,omitempty"` PaperWidth string `xml:"paperWidth,attr,omitempty"`
Scale int `xml:"scale,attr"` Scale int `xml:"scale,attr,omitempty"`
UseFirstPageNumber bool `xml:"useFirstPageNumber,attr,omitempty"` UseFirstPageNumber bool `xml:"useFirstPageNumber,attr,omitempty"`
UsePrinterDefaults bool `xml:"usePrinterDefaults,attr,omitempty"` UsePrinterDefaults bool `xml:"usePrinterDefaults,attr,omitempty"`
VerticalDPI int `xml:"verticalDpi,attr,omitempty"` VerticalDPI int `xml:"verticalDpi,attr,omitempty"`
@ -239,9 +239,9 @@ type xlsxSheetPr struct {
CodeName string `xml:"codeName,attr,omitempty"` CodeName string `xml:"codeName,attr,omitempty"`
FilterMode bool `xml:"filterMode,attr,omitempty"` FilterMode bool `xml:"filterMode,attr,omitempty"`
EnableFormatConditionsCalculation *bool `xml:"enableFormatConditionsCalculation,attr"` EnableFormatConditionsCalculation *bool `xml:"enableFormatConditionsCalculation,attr"`
TabColor *xlsxTabColor `xml:"tabColor,omitempty"` TabColor *xlsxTabColor `xml:"tabColor"`
OutlinePr *xlsxOutlinePr `xml:"outlinePr,omitempty"` OutlinePr *xlsxOutlinePr `xml:"outlinePr"`
PageSetUpPr *xlsxPageSetUpPr `xml:"pageSetUpPr,omitempty"` PageSetUpPr *xlsxPageSetUpPr `xml:"pageSetUpPr"`
} }
// xlsxOutlinePr maps to the outlinePr element. SummaryBelow allows you to // xlsxOutlinePr maps to the outlinePr element. SummaryBelow allows you to

Loading…
Cancel
Save