diff --git a/xlsx.js b/xlsx.js index 50d8293..79a8038 100644 --- a/xlsx.js +++ b/xlsx.js @@ -498,7 +498,7 @@ SSF.load_table = function(tbl) { for(var i=0; i!=0x0188; ++i) if(tbl[i]) SSF.loa make_ssf(SSF); var XLSX = {}; (function(XLSX){ -XLSX.version = '0.5.16'; +XLSX.version = '0.5.17'; var current_codepage, current_cptable, cptable; if(typeof module !== "undefined" && typeof require !== 'undefined') { if(typeof cptable === 'undefined') cptable = require('codepage'); @@ -1009,7 +1009,7 @@ var parse_sst_bin = function(data, opts) { var styles = {}; // shared styles /* 18.8.31 numFmts CT_NumFmts */ -function parseNumFmts(t) { +function parseNumFmts(t, opts) { styles.NumberFmt = []; for(var y in SSF._table) styles.NumberFmt[y] = SSF._table[y]; t[0].match(/<[^>]*>/g).forEach(function(x) { @@ -1020,13 +1020,13 @@ function parseNumFmts(t) { var f=unescapexml(y.formatCode), i=parseInt(y.numFmtId,10); styles.NumberFmt[i] = f; if(i>0) SSF.load(f,i); } break; - default: throw 'unrecognized ' + y[0] + ' in numFmts'; + default: if(opts.WTF) throw 'unrecognized ' + y[0] + ' in numFmts'; } }); } /* 18.8.10 cellXfs CT_CellXfs */ -function parseCXfs(t) { +function parseCXfs(t, opts) { styles.CellXf = []; t[0].match(/<[^>]*>/g).forEach(function(x) { var y = parsexmltag(x); @@ -1040,25 +1040,25 @@ function parseCXfs(t) { case '': break; /* 18.8.1 alignment CT_CellAlignment */ - case '': break; /* 18.8.33 protection CT_CellProtection */ case '': case '': break; case '': break; case ']*)>.*<\/numFmts>/))) parseNumFmts(t); + if((t=data.match(/]*)>.*<\/numFmts>/))) parseNumFmts(t, opts); /* fonts CT_Fonts ? */ /* fills CT_Fills ? */ @@ -1066,7 +1066,7 @@ function parse_sty_xml(data) { /* cellStyleXfs CT_CellStyleXfs ? */ /* cellXfs CT_CellXfs ? */ - if((t=data.match(/]*)>.*<\/cellXfs>/))) parseCXfs(t); + if((t=data.match(/]*)>.*<\/cellXfs>/))) parseCXfs(t, opts); /* dxfs CT_Dxfs ? */ /* tableStyles CT_TableStyles ? */