diff options
author | xuri <xuri.me@gmail.com> | 2020-03-03 00:15:03 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2020-03-03 00:15:03 +0800 |
commit | 1e3c85024d3bbc650c2f6a85fb075804af74720b (patch) | |
tree | c161e6753dc36043a4ef1194b18f7f4f8aa98ec6 /styles.go | |
parent | 1d87da57ecf5e13203b6441dd97160885981545e (diff) |
Resolve #571, init remove conditional format support
Diffstat (limited to 'styles.go')
-rw-r--r-- | styles.go | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -2676,6 +2676,22 @@ func (f *File) SetConditionalFormat(sheet, area, formatSet string) error { return err } +// UnsetConditionalFormat provides a function to unset the conditional format +// by given worksheet name and range. +func (f *File) UnsetConditionalFormat(sheet, area string) error { + ws, err := f.workSheetReader(sheet) + if err != nil { + return err + } + for i, cf := range ws.ConditionalFormatting { + if cf.SQRef == area { + ws.ConditionalFormatting = append(ws.ConditionalFormatting[:i], ws.ConditionalFormatting[i+1:]...) + return nil + } + } + return nil +} + // drawCondFmtCellIs provides a function to create conditional formatting rule // for cell value (include between, not between, equal, not equal, greater // than and less than) by given priority, criteria type and format settings. |