Skip to content

Commit

Permalink
This closes qax-os#1867, breaking changes: change the data type for t…
Browse files Browse the repository at this point in the history
…he ConditionalFormatOptions structure field Format as a pointer
  • Loading branch information
xuri committed Apr 3, 2024
1 parent 5dc22e8 commit 5f8a5b8
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 111 deletions.
2 changes: 1 addition & 1 deletion adjust_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ func TestAdjustConditionalFormats(t *testing.T) {
{
Type: "cell",
Criteria: "greater than",
Format: formatID,
Format: &formatID,
Value: "0",
},
}
Expand Down
20 changes: 10 additions & 10 deletions excelize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ func TestConditionalFormat(t *testing.T) {
{
Type: "cell",
Criteria: "between",
Format: format1,
Format: &format1,
MinValue: "6",
MaxValue: "8",
},
Expand All @@ -1100,7 +1100,7 @@ func TestConditionalFormat(t *testing.T) {
{
Type: "cell",
Criteria: ">",
Format: format3,
Format: &format3,
Value: "6",
},
},
Expand All @@ -1111,7 +1111,7 @@ func TestConditionalFormat(t *testing.T) {
{
Type: "top",
Criteria: "=",
Format: format3,
Format: &format3,
},
},
))
Expand All @@ -1121,7 +1121,7 @@ func TestConditionalFormat(t *testing.T) {
{
Type: "unique",
Criteria: "=",
Format: format2,
Format: &format2,
},
},
))
Expand All @@ -1131,7 +1131,7 @@ func TestConditionalFormat(t *testing.T) {
{
Type: "duplicate",
Criteria: "=",
Format: format2,
Format: &format2,
},
},
))
Expand All @@ -1141,7 +1141,7 @@ func TestConditionalFormat(t *testing.T) {
{
Type: "top",
Criteria: "=",
Format: format1,
Format: &format1,
Value: "6",
Percent: true,
},
Expand All @@ -1153,7 +1153,7 @@ func TestConditionalFormat(t *testing.T) {
{
Type: "average",
Criteria: "=",
Format: format3,
Format: &format3,
AboveAverage: true,
},
},
Expand All @@ -1164,7 +1164,7 @@ func TestConditionalFormat(t *testing.T) {
{
Type: "average",
Criteria: "=",
Format: format1,
Format: &format1,
AboveAverage: false,
},
},
Expand All @@ -1187,7 +1187,7 @@ func TestConditionalFormat(t *testing.T) {
{
Type: "formula",
Criteria: "L2<3",
Format: format1,
Format: &format1,
},
},
))
Expand All @@ -1197,7 +1197,7 @@ func TestConditionalFormat(t *testing.T) {
{
Type: "cell",
Criteria: ">",
Format: format4,
Format: &format4,
Value: "0",
},
},
Expand Down
2 changes: 1 addition & 1 deletion rows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ func TestDuplicateRow(t *testing.T) {
assert.NoError(t, err)

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

Expand Down
Loading

0 comments on commit 5f8a5b8

Please sign in to comment.