Skip to content

Commit 5f8a5b8

Browse files
committed
This closes qax-os#1867, breaking changes: change the data type for the ConditionalFormatOptions structure field Format as a pointer
1 parent 5dc22e8 commit 5f8a5b8

6 files changed

+78
-111
lines changed

adjust_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ func TestAdjustConditionalFormats(t *testing.T) {
999999
{
10001000
Type: "cell",
10011001
Criteria: "greater than",
1002-
Format: formatID,
1002+
Format: &formatID,
10031003
Value: "0",
10041004
},
10051005
}

excelize_test.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ func TestConditionalFormat(t *testing.T) {
10881088
{
10891089
Type: "cell",
10901090
Criteria: "between",
1091-
Format: format1,
1091+
Format: &format1,
10921092
MinValue: "6",
10931093
MaxValue: "8",
10941094
},
@@ -1100,7 +1100,7 @@ func TestConditionalFormat(t *testing.T) {
11001100
{
11011101
Type: "cell",
11021102
Criteria: ">",
1103-
Format: format3,
1103+
Format: &format3,
11041104
Value: "6",
11051105
},
11061106
},
@@ -1111,7 +1111,7 @@ func TestConditionalFormat(t *testing.T) {
11111111
{
11121112
Type: "top",
11131113
Criteria: "=",
1114-
Format: format3,
1114+
Format: &format3,
11151115
},
11161116
},
11171117
))
@@ -1121,7 +1121,7 @@ func TestConditionalFormat(t *testing.T) {
11211121
{
11221122
Type: "unique",
11231123
Criteria: "=",
1124-
Format: format2,
1124+
Format: &format2,
11251125
},
11261126
},
11271127
))
@@ -1131,7 +1131,7 @@ func TestConditionalFormat(t *testing.T) {
11311131
{
11321132
Type: "duplicate",
11331133
Criteria: "=",
1134-
Format: format2,
1134+
Format: &format2,
11351135
},
11361136
},
11371137
))
@@ -1141,7 +1141,7 @@ func TestConditionalFormat(t *testing.T) {
11411141
{
11421142
Type: "top",
11431143
Criteria: "=",
1144-
Format: format1,
1144+
Format: &format1,
11451145
Value: "6",
11461146
Percent: true,
11471147
},
@@ -1153,7 +1153,7 @@ func TestConditionalFormat(t *testing.T) {
11531153
{
11541154
Type: "average",
11551155
Criteria: "=",
1156-
Format: format3,
1156+
Format: &format3,
11571157
AboveAverage: true,
11581158
},
11591159
},
@@ -1164,7 +1164,7 @@ func TestConditionalFormat(t *testing.T) {
11641164
{
11651165
Type: "average",
11661166
Criteria: "=",
1167-
Format: format1,
1167+
Format: &format1,
11681168
AboveAverage: false,
11691169
},
11701170
},
@@ -1187,7 +1187,7 @@ func TestConditionalFormat(t *testing.T) {
11871187
{
11881188
Type: "formula",
11891189
Criteria: "L2<3",
1190-
Format: format1,
1190+
Format: &format1,
11911191
},
11921192
},
11931193
))
@@ -1197,7 +1197,7 @@ func TestConditionalFormat(t *testing.T) {
11971197
{
11981198
Type: "cell",
11991199
Criteria: ">",
1200-
Format: format4,
1200+
Format: &format4,
12011201
Value: "0",
12021202
},
12031203
},

rows_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ func TestDuplicateRow(t *testing.T) {
892892
assert.NoError(t, err)
893893

894894
expected := []ConditionalFormatOptions{
895-
{Type: "cell", Criteria: "greater than", Format: format, Value: "0"},
895+
{Type: "cell", Criteria: "greater than", Format: &format, Value: "0"},
896896
}
897897
assert.NoError(t, f.SetConditionalFormat("Sheet1", "A1", expected))
898898

0 commit comments

Comments
 (0)