Skip to content

Commit fbc3d1c

Browse files
committed
- Worksheet conditional formatting support added, relate issue qax-os#56;
- gofmted with -s
1 parent dea57dd commit fbc3d1c

File tree

2 files changed

+24
-23
lines changed

2 files changed

+24
-23
lines changed

chart.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -390,12 +390,12 @@ func (f *File) drawBarChart(formatSet *formatChart) *cPlotArea {
390390
},
391391
}
392392
charts := map[string]*cPlotArea{
393-
"bar": &cPlotArea{
393+
"bar": {
394394
BarChart: &c,
395395
CatAx: f.drawPlotAreaCatAx(),
396396
ValAx: f.drawPlotAreaValAx(),
397397
},
398-
"bar3D": &cPlotArea{
398+
"bar3D": {
399399
Bar3DChart: &c,
400400
CatAx: f.drawPlotAreaCatAx(),
401401
ValAx: f.drawPlotAreaValAx(),

xmlWorksheet.go

+22-21
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@ import "encoding/xml"
66
// http://schemas.openxmlformats.org/spreadsheetml/2006/main - currently I have
77
// not checked it for completeness - it does as much as I need.
88
type xlsxWorksheet struct {
9-
XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main worksheet"`
10-
SheetPr *xlsxSheetPr `xml:"sheetPr"`
11-
Dimension xlsxDimension `xml:"dimension"`
12-
SheetViews xlsxSheetViews `xml:"sheetViews,omitempty"`
13-
SheetFormatPr *xlsxSheetFormatPr `xml:"sheetFormatPr"`
14-
Cols *xlsxCols `xml:"cols,omitempty"`
15-
SheetData xlsxSheetData `xml:"sheetData"`
16-
SheetProtection *xlsxSheetProtection `xml:"sheetProtection"`
17-
MergeCells *xlsxMergeCells `xml:"mergeCells,omitempty"`
18-
ConditionalFormatting *xlsxConditionalFormatting `xml:"conditionalFormatting"`
19-
DataValidations *xlsxDataValidations `xml:"dataValidations"`
20-
Hyperlinks *xlsxHyperlinks `xml:"hyperlinks"`
21-
PrintOptions *xlsxPrintOptions `xml:"printOptions"`
22-
PageMargins *xlsxPageMargins `xml:"pageMargins"`
23-
PageSetUp *xlsxPageSetUp `xml:"pageSetup"`
24-
HeaderFooter *xlsxHeaderFooter `xml:"headerFooter"`
25-
Drawing *xlsxDrawing `xml:"drawing"`
26-
LegacyDrawing *xlsxLegacyDrawing `xml:"legacyDrawing"`
27-
Picture *xlsxPicture `xml:"picture"`
28-
TableParts *xlsxTableParts `xml:"tableParts"`
29-
ExtLst *xlsxExtLst `xml:"extLst"`
9+
XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main worksheet"`
10+
SheetPr *xlsxSheetPr `xml:"sheetPr"`
11+
Dimension xlsxDimension `xml:"dimension"`
12+
SheetViews xlsxSheetViews `xml:"sheetViews,omitempty"`
13+
SheetFormatPr *xlsxSheetFormatPr `xml:"sheetFormatPr"`
14+
Cols *xlsxCols `xml:"cols,omitempty"`
15+
SheetData xlsxSheetData `xml:"sheetData"`
16+
SheetProtection *xlsxSheetProtection `xml:"sheetProtection"`
17+
MergeCells *xlsxMergeCells `xml:"mergeCells,omitempty"`
18+
ConditionalFormatting []*xlsxConditionalFormatting `xml:"conditionalFormatting"`
19+
DataValidations *xlsxDataValidations `xml:"dataValidations"`
20+
Hyperlinks *xlsxHyperlinks `xml:"hyperlinks"`
21+
PrintOptions *xlsxPrintOptions `xml:"printOptions"`
22+
PageMargins *xlsxPageMargins `xml:"pageMargins"`
23+
PageSetUp *xlsxPageSetUp `xml:"pageSetup"`
24+
HeaderFooter *xlsxHeaderFooter `xml:"headerFooter"`
25+
Drawing *xlsxDrawing `xml:"drawing"`
26+
LegacyDrawing *xlsxLegacyDrawing `xml:"legacyDrawing"`
27+
Picture *xlsxPicture `xml:"picture"`
28+
TableParts *xlsxTableParts `xml:"tableParts"`
29+
ExtLst *xlsxExtLst `xml:"extLst"`
3030
}
3131

3232
// xlsxDrawing change r:id to rid in the namespace.
@@ -348,6 +348,7 @@ type xlsxSheetProtection struct {
348348
// condition is true. This collection expresses conditional formatting rules
349349
// applied to a particular cell or range.
350350
type xlsxConditionalFormatting struct {
351+
SQRef string `xml:"sqref,attr,omitempty"`
351352
CfRule string `xml:",innerxml"`
352353
}
353354

0 commit comments

Comments
 (0)