Fix TypeError when styles don't have NumberFmt

This commit is contained in:
ikeq 2021-09-13 07:07:08 +08:00
parent 3d35cebe9e
commit f384ccd8a8

@ -318,7 +318,7 @@ function parse_cellXfs(t, styles, opts) {
xf[cellXF_uint[i]] = parseInt(xf[cellXF_uint[i]], 10);
for(i = 0; i < cellXF_bool.length; ++i) if(xf[cellXF_bool[i]])
xf[cellXF_bool[i]] = parsexmlbool(xf[cellXF_bool[i]]);
if(xf.numFmtId > 0x188) {
if(styles.NumberFmt && xf.numFmtId > 0x188) {
for(i = 0x188; i > 0x3c; --i) if(styles.NumberFmt[xf.numFmtId] == styles.NumberFmt[i]) { xf.numFmtId = i; break; }
}
styles.CellXf.push(xf); break;