updating to 0.5.17

This commit is contained in:
SheetJS 2014-04-04 16:05:06 -07:00
parent aadb9c7aac
commit 24bcb71250

18
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 '</xf>': break;
/* 18.8.1 alignment CT_CellAlignment */
case '<alignment': break;
case '<alignment': case '<alignment/>': break;
/* 18.8.33 protection CT_CellProtection */
case '<protection': case '</protection>': case '<protection/>': break;
case '<extLst': case '</extLst>': break;
case '<ext': break;
default: throw 'unrecognized ' + y[0] + ' in cellXfs';
default: if(opts.WTF) throw 'unrecognized ' + y[0] + ' in cellXfs';
}
});
}
/* 18.8 Styles CT_Stylesheet*/
function parse_sty_xml(data) {
function parse_sty_xml(data, opts) {
/* 18.8.39 styleSheet CT_Stylesheet */
var t;
/* numFmts CT_NumFmts ? */
if((t=data.match(/<numFmts([^>]*)>.*<\/numFmts>/))) parseNumFmts(t);
if((t=data.match(/<numFmts([^>]*)>.*<\/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([^>]*)>.*<\/cellXfs>/))) parseCXfs(t);
if((t=data.match(/<cellXfs([^>]*)>.*<\/cellXfs>/))) parseCXfs(t, opts);
/* dxfs CT_Dxfs ? */
/* tableStyles CT_TableStyles ? */