summaryrefslogtreecommitdiff
path: root/styles.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2020-03-03 00:15:03 +0800
committerxuri <xuri.me@gmail.com>2020-03-03 00:15:03 +0800
commit1e3c85024d3bbc650c2f6a85fb075804af74720b (patch)
treec161e6753dc36043a4ef1194b18f7f4f8aa98ec6 /styles.go
parent1d87da57ecf5e13203b6441dd97160885981545e (diff)
Resolve #571, init remove conditional format support
Diffstat (limited to 'styles.go')
-rw-r--r--styles.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/styles.go b/styles.go
index 272d728..caf2732 100644
--- a/styles.go
+++ b/styles.go
@@ -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.