summaryrefslogtreecommitdiff
path: root/xmlWorksheet.go
diff options
context:
space:
mode:
authorArnie97 <arnie97@gmail.com>2021-07-31 00:31:51 +0800
committerGitHub <noreply@github.com>2021-07-31 00:31:51 +0800
commit7ac37edfebebc9bee201fad001e2f2f8b780a9a8 (patch)
tree62e3ccbafdd831eb19ffd95085ca6b46af273efa /xmlWorksheet.go
parent7dbf88f221f278075d4ff9e153b21236d0826c33 (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 'xmlWorksheet.go')
-rw-r--r--xmlWorksheet.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmlWorksheet.go b/xmlWorksheet.go
index a54d51b..4499546 100644
--- a/xmlWorksheet.go
+++ b/xmlWorksheet.go
@@ -436,8 +436,8 @@ type DataValidation struct {
ShowInputMessage bool `xml:"showInputMessage,attr,omitempty"`
Sqref string `xml:"sqref,attr"`
Type string `xml:"type,attr,omitempty"`
- Formula1 string `xml:"formula1,omitempty"`
- Formula2 string `xml:"formula2,omitempty"`
+ Formula1 string `xml:",innerxml"`
+ Formula2 string `xml:",innerxml"`
}
// xlsxC collection represents a cell in the worksheet. Information about the