From bda8e7f8129dae0064c47f8e051f76492e1128f5 Mon Sep 17 00:00:00 2001 From: xuri Date: Tue, 16 Nov 2021 00:40:44 +0800 Subject: This closes #1061, support multi-byte language on set header footer typo fixed and simplify code for read the data values arguments of formula functions --- datavalidation.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'datavalidation.go') diff --git a/datavalidation.go b/datavalidation.go index 047a53c..80a0295 100644 --- a/datavalidation.go +++ b/datavalidation.go @@ -35,11 +35,6 @@ const ( DataValidationTypeWhole ) -const ( - // dataValidationFormulaStrLen 255 characters - dataValidationFormulaStrLen = 255 -) - // DataValidationErrorStyle defined the style of data validation error alert. type DataValidationErrorStyle int @@ -120,7 +115,7 @@ func (dd *DataValidation) SetInput(title, msg string) { // SetDropList data validation list. func (dd *DataValidation) SetDropList(keys []string) error { formula := strings.Join(keys, ",") - if dataValidationFormulaStrLen < len(utf16.Encode([]rune(formula))) { + if MaxFieldLength < len(utf16.Encode([]rune(formula))) { return ErrDataValidationFormulaLenth } dd.Formula1 = fmt.Sprintf(`"%s"`, formulaEscaper.Replace(formula)) -- cgit v1.2.1