You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The adjustDataValidations function, which is invoked by operations such as RemoveCol, skips properly adjusting data validations on subsequent sheets if the first sheet in a workbook has no data validations.
Steps to reproduce the issue
t.Run("no_data_validations_on_first_sheet", func(t*testing.T) {
f:=NewFile()
// Add Sheet2 and set a data validation_, err=f.NewSheet("Sheet2")
assert.NoError(t, err)
dv:=NewDataValidation(true)
dv.Sqref="C5:D6"assert.NoError(t, f.AddDataValidation("Sheet2", dv))
// Adjust Sheet2 by removing a columnassert.NoError(t, f.RemoveCol("Sheet2", "A"))
// Verify that data validations on Sheet2 are adjusted correctlydvs, err=f.GetDataValidations("Sheet2")
assert.NoError(t, err)
assert.Equal(t, "B5:C6", dvs[0].Sqref) // test failed
})
Describe the results you received
DataValidation not updated
Describe the results you expected
DataValidation adjusted
Go version
go version go1.22.2 darwin/arm64
Excelize version or commit ID
2.9.0
Environment
Mac
Validations
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
The provided reproduction is a minimal reproducible example of the bug.
The text was updated successfully, but these errors were encountered:
Description
The adjustDataValidations function, which is invoked by operations such as RemoveCol, skips properly adjusting data validations on subsequent sheets if the first sheet in a workbook has no data validations.
Steps to reproduce the issue
Describe the results you received
DataValidation not updated
Describe the results you expected
DataValidation adjusted
Go version
go version go1.22.2 darwin/arm64
Excelize version or commit ID
2.9.0
Environment
Validations
The text was updated successfully, but these errors were encountered: