提交 fbc3d1cd 编写于 作者: xurime's avatar xurime

- Worksheet conditional formatting support added, relate issue #56;

- gofmted with -s
上级 dea57dd0
...@@ -390,12 +390,12 @@ func (f *File) drawBarChart(formatSet *formatChart) *cPlotArea { ...@@ -390,12 +390,12 @@ func (f *File) drawBarChart(formatSet *formatChart) *cPlotArea {
}, },
} }
charts := map[string]*cPlotArea{ charts := map[string]*cPlotArea{
"bar": &cPlotArea{ "bar": {
BarChart: &c, BarChart: &c,
CatAx: f.drawPlotAreaCatAx(), CatAx: f.drawPlotAreaCatAx(),
ValAx: f.drawPlotAreaValAx(), ValAx: f.drawPlotAreaValAx(),
}, },
"bar3D": &cPlotArea{ "bar3D": {
Bar3DChart: &c, Bar3DChart: &c,
CatAx: f.drawPlotAreaCatAx(), CatAx: f.drawPlotAreaCatAx(),
ValAx: f.drawPlotAreaValAx(), ValAx: f.drawPlotAreaValAx(),
......
...@@ -6,27 +6,27 @@ import "encoding/xml" ...@@ -6,27 +6,27 @@ import "encoding/xml"
// http://schemas.openxmlformats.org/spreadsheetml/2006/main - currently I have // http://schemas.openxmlformats.org/spreadsheetml/2006/main - currently I have
// not checked it for completeness - it does as much as I need. // not checked it for completeness - it does as much as I need.
type xlsxWorksheet struct { type xlsxWorksheet struct {
XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main worksheet"` XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main worksheet"`
SheetPr *xlsxSheetPr `xml:"sheetPr"` SheetPr *xlsxSheetPr `xml:"sheetPr"`
Dimension xlsxDimension `xml:"dimension"` Dimension xlsxDimension `xml:"dimension"`
SheetViews xlsxSheetViews `xml:"sheetViews,omitempty"` SheetViews xlsxSheetViews `xml:"sheetViews,omitempty"`
SheetFormatPr *xlsxSheetFormatPr `xml:"sheetFormatPr"` SheetFormatPr *xlsxSheetFormatPr `xml:"sheetFormatPr"`
Cols *xlsxCols `xml:"cols,omitempty"` Cols *xlsxCols `xml:"cols,omitempty"`
SheetData xlsxSheetData `xml:"sheetData"` SheetData xlsxSheetData `xml:"sheetData"`
SheetProtection *xlsxSheetProtection `xml:"sheetProtection"` SheetProtection *xlsxSheetProtection `xml:"sheetProtection"`
MergeCells *xlsxMergeCells `xml:"mergeCells,omitempty"` MergeCells *xlsxMergeCells `xml:"mergeCells,omitempty"`
ConditionalFormatting *xlsxConditionalFormatting `xml:"conditionalFormatting"` ConditionalFormatting []*xlsxConditionalFormatting `xml:"conditionalFormatting"`
DataValidations *xlsxDataValidations `xml:"dataValidations"` DataValidations *xlsxDataValidations `xml:"dataValidations"`
Hyperlinks *xlsxHyperlinks `xml:"hyperlinks"` Hyperlinks *xlsxHyperlinks `xml:"hyperlinks"`
PrintOptions *xlsxPrintOptions `xml:"printOptions"` PrintOptions *xlsxPrintOptions `xml:"printOptions"`
PageMargins *xlsxPageMargins `xml:"pageMargins"` PageMargins *xlsxPageMargins `xml:"pageMargins"`
PageSetUp *xlsxPageSetUp `xml:"pageSetup"` PageSetUp *xlsxPageSetUp `xml:"pageSetup"`
HeaderFooter *xlsxHeaderFooter `xml:"headerFooter"` HeaderFooter *xlsxHeaderFooter `xml:"headerFooter"`
Drawing *xlsxDrawing `xml:"drawing"` Drawing *xlsxDrawing `xml:"drawing"`
LegacyDrawing *xlsxLegacyDrawing `xml:"legacyDrawing"` LegacyDrawing *xlsxLegacyDrawing `xml:"legacyDrawing"`
Picture *xlsxPicture `xml:"picture"` Picture *xlsxPicture `xml:"picture"`
TableParts *xlsxTableParts `xml:"tableParts"` TableParts *xlsxTableParts `xml:"tableParts"`
ExtLst *xlsxExtLst `xml:"extLst"` ExtLst *xlsxExtLst `xml:"extLst"`
} }
// xlsxDrawing change r:id to rid in the namespace. // xlsxDrawing change r:id to rid in the namespace.
...@@ -348,6 +348,7 @@ type xlsxSheetProtection struct { ...@@ -348,6 +348,7 @@ type xlsxSheetProtection struct {
// condition is true. This collection expresses conditional formatting rules // condition is true. This collection expresses conditional formatting rules
// applied to a particular cell or range. // applied to a particular cell or range.
type xlsxConditionalFormatting struct { type xlsxConditionalFormatting struct {
SQRef string `xml:"sqref,attr,omitempty"`
CfRule string `xml:",innerxml"` CfRule string `xml:",innerxml"`
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册