summaryrefslogtreecommitdiff
path: root/styles.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-02-08 00:08:06 +0800
committerxuri <xuri.me@gmail.com>2022-02-08 00:08:06 +0800
commit3f8f4f52e68d408da5a2e5108af3cc99bf8586bc (patch)
tree95ee799ee12d078b5dc12463417990acd2cb676a /styles.go
parent0f1fcb78d5518695cb80cc2266290e37df38a1ee (diff)
This closes #1139, `SetCellDefault` support non-numeric value
- Add default value on getting `View` property of sheet views - Add examples and unit test for set sheet views - Re-order field on sheet view options - Fix incorrect build-in number format: 42 - Simplify code for the `stylesReader` function
Diffstat (limited to 'styles.go')
-rw-r--r--styles.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/styles.go b/styles.go
index 5d373d3..7678b84 100644
--- a/styles.go
+++ b/styles.go
@@ -53,7 +53,7 @@ var builtInNumFmt = map[int]string{
39: "#,##0.00;(#,##0.00)",
40: "#,##0.00;[red](#,##0.00)",
41: `_(* #,##0_);_(* \(#,##0\);_(* "-"_);_(@_)`,
- 42: `_("$"* #,##0_);_("$* \(#,##0\);_("$"* "-"_);_(@_)`,
+ 42: `_("$"* #,##0_);_("$"* \(#,##0\);_("$"* "-"_);_(@_)`,
43: `_(* #,##0.00_);_(* \(#,##0.00\);_(* "-"??_);_(@_)`,
44: `_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)`,
45: "mm:ss",
@@ -1074,16 +1074,13 @@ func is12HourTime(format string) bool {
// stylesReader provides a function to get the pointer to the structure after
// deserialization of xl/styles.xml.
func (f *File) stylesReader() *xlsxStyleSheet {
- var err error
-
if f.Styles == nil {
f.Styles = new(xlsxStyleSheet)
- if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML(defaultXMLPathStyles)))).
+ if err := f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML(defaultXMLPathStyles)))).
Decode(f.Styles); err != nil && err != io.EOF {
log.Printf("xml decode error: %s", err)
}
}
-
return f.Styles
}