summaryrefslogtreecommitdiff
path: root/cell.go
diff options
context:
space:
mode:
authorArtem Kustikov <artem.kustikov@gmail.com>2020-12-12 11:17:00 +0300
committerGitHub <noreply@github.com>2020-12-12 16:17:00 +0800
commit61057c58d34c78232ad0a5c1702ea9fa25a7641a (patch)
treea7a50ca2707a9b5a0ea877d08d4e7c37198a7670 /cell.go
parent95d8920c8e99684eb4e5068e38d3e7e5d0409d4e (diff)
Number format read fix (#741)
* fix UT-generated file names to be ignored * fix cell value load with invalid number format ID * fix PR issues
Diffstat (limited to 'cell.go')
-rw-r--r--cell.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/cell.go b/cell.go
index 1edfd24..22adefd 100644
--- a/cell.go
+++ b/cell.go
@@ -762,10 +762,15 @@ func (f *File) formattedValue(s int, v string) string {
return v
}
styleSheet := f.stylesReader()
+
if s >= len(styleSheet.CellXfs.Xf) {
return v
}
- numFmtID := *styleSheet.CellXfs.Xf[s].NumFmtID
+ var numFmtID int
+ if styleSheet.CellXfs.Xf[s].NumFmtID != nil {
+ numFmtID = *styleSheet.CellXfs.Xf[s].NumFmtID
+ }
+
ok := builtInNumFmtFunc[numFmtID]
if ok != nil {
return ok(v, builtInNumFmt[numFmtID])