diff options
author | Arnie97 <arnie97@gmail.com> | 2021-07-31 00:31:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-31 00:31:51 +0800 |
commit | 7ac37edfebebc9bee201fad001e2f2f8b780a9a8 (patch) | |
tree | 62e3ccbafdd831eb19ffd95085ca6b46af273efa /errors.go | |
parent | 7dbf88f221f278075d4ff9e153b21236d0826c33 (diff) |
Fix data validation issues (#975)
* Fix `SetDropList` to allow XML special characters
* This closes #971, allow quotation marks in SetDropList()
This patch included a XML entity mapping table instead of
xml.EscapeText() to be fully compatible with Microsoft Excel.
* This closes #972, allow more than 255 bytes of validation formulas
This patch changed the string length calculation unit of data
validation formulas from UTF-8 bytes to UTF-16 code units.
* Add unit tests for SetDropList()
* Fix: allow MaxFloat64 to be used in validation range
17 decimal significant digits should be more than enough to represent
every IEEE-754 double-precision float number without losing precision,
and numbers in this form will never reach the Excel limitation of 255
UTF-16 code units.
Diffstat (limited to 'errors.go')
-rw-r--r-- | errors.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -105,4 +105,10 @@ var ( ErrSheetIdx = errors.New("invalid worksheet index") // ErrGroupSheets defined the error message on group sheets. ErrGroupSheets = errors.New("group worksheet must contain an active worksheet") + // ErrDataValidationFormulaLenth defined the error message for receiving a + // data validation formula length that exceeds the limit. + ErrDataValidationFormulaLenth = errors.New("data validation must be 0-255 characters") + // ErrDataValidationRange defined the error message on set decimal range + // exceeds limit. + ErrDataValidationRange = errors.New("data validation range exceeds limit") ) |