version bump 0.5.11: removing XLSB training wheels

- Brt* errors restored
- updated SSF to 0.5.9
This commit is contained in:
SheetJS 2014-03-19 10:53:20 -07:00
parent 49a37c9cf5
commit 2df14a3cce
13 changed files with 162 additions and 34 deletions

@ -6,7 +6,7 @@ var _strrev = function(x) { return String(x).split("").reverse().join("");};
function fill(c,l) { return new Array(l+1).join(c); }
function pad(v,d,c){var t=String(v);return t.length>=d?t:(fill(c||0,d-t.length)+t);}
function rpad(v,d,c){var t=String(v);return t.length>=d?t:(t+fill(c||0,d-t.length));}
SSF.version = '0.5.8';
SSF.version = '0.5.9';
/* Options */
var opts_fmt = {};
function fixopts(o){for(var y in opts_fmt) if(o[y]===undefined) o[y]=opts_fmt[y];}
@ -243,9 +243,10 @@ var write_num = function(type, fmt, val) {
o = Math.round(val * Math.pow(10,r[1].length));
return String(o/Math.pow(10,r[1].length)).replace(/^([^\.]+)$/,"$1."+r[1]).replace(/\.$/,"."+r[1]).replace(/\.([0-9]*)$/,function($$, $1) { return "." + $1 + fill("0", r[1].length-$1.length); });
}
fmt = fmt.replace(/^#+0/, "0");
if((r = fmt.match(/^(0*)\.(#*)$/))) {
o = Math.round(val*Math.pow(10,r[2].length));
return String(o * Math.pow(10,-r[2].length)).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^([-]?\d*)$/,"$1.").replace(/^0\./,r[1].length?"0.":".");
o = Math.round(aval*Math.pow(10,r[2].length));
return sign + String(o / Math.pow(10,r[2].length)).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^([-]?\d*)$/,"$1.").replace(/^0\./,r[1].length?"0.":".");
}
if((r = fmt.match(/^#,##0([.]?)$/))) return sign + commaify(String(Math.round(aval)));
if((r = fmt.match(/^#,##0\.([#0]*0)$/))) {

@ -1 +1 @@
XLSX.version = '0.5.10-b';
XLSX.version = '0.5.11';

@ -11,7 +11,9 @@ var parse_sst_bin = function(data) {
case 'BrtBeginSst': s.Count = val[0]; s.Unique = val[1]; break;
case 'BrtSSTItem': s.push(val); break;
case 'BrtEndSst': return true;
default: throw new Error("Unexpected record " + R.n);
case 'BrtFRTBegin': pass = true; break;
case 'BrtFRTEnd': pass = false; break;
default: if(!pass) throw new Error("Unexpected record " + RT + " " + R.n);
}
});
return s;

@ -71,7 +71,7 @@ function parse_sty_bin(data) {
case 'BrtEndColorPalette': state = ""; break;
case 'BrtFRTBegin': pass = true; break;
case 'BrtFRTEnd': pass = false; break;
//default: if(!pass) throw new Error("Unexpected record " + RT + " " + R.n);
default: if(!pass) throw new Error("Unexpected record " + RT + " " + R.n);
}
});
return styles;

@ -145,6 +145,7 @@ var parse_ws_bin = function(data, opts) {
case 'BrtCellIsst':
case 'BrtCellReal':
case 'BrtCellRk':
case 'BrtCellSt':
p = {t:val[2]};
switch(val[2]) {
case 'n': p.v = val[1]; break;
@ -174,10 +175,12 @@ var parse_ws_bin = function(data, opts) {
case 'BrtSheetCalcProp': break; // TODO
case 'BrtBeginWsViews': break; // TODO
case 'BrtBeginWsView': break; // TODO
case 'BrtPane': break; // TODO
case 'BrtSel': break; // TODO
case 'BrtEndWsView': break; // TODO
case 'BrtEndWsViews': break; // TODO
case 'BrtSel': break; // TODO
case 'BrtACBegin': break; // TODO
case 'BrtRwDescent': break; // TODO
case 'BrtACEnd': break; // TODO
case 'BrtWsFmtInfoEx14': break; // TODO
case 'BrtWsFmtInfo': break; // TODO
@ -196,8 +199,44 @@ var parse_ws_bin = function(data, opts) {
case 'BrtBeginMergeCells': break; // TODO
case 'BrtMergeCell': break; // TODO
case 'BrtEndMergeCells': break; // TODO
case 'BrtHLink': break; // TODO
case 'BrtDrawing': break; // TODO
case 'BrtLegacyDrawing': break; // TODO
//default: if(!pass) throw new Error("Unexpected record " + R.n);
case 'BrtPhoneticInfo': break; // TODO
case 'BrtBeginHeaderFooter': break; // TODO
case 'BrtEndHeaderFooter': break; // TODO
case 'BrtBrk': break; // TODO
case 'BrtBeginRwBrk': break; // TODO
case 'BrtEndRwBrk': break; // TODO
case 'BrtBeginColBrk': break; // TODO
case 'BrtEndColBrk': break; // TODO
case 'BrtBeginUserShViews': break; // TODO
case 'BrtBeginUserShView': break; // TODO
case 'BrtEndUserShView': break; // TODO
case 'BrtEndUserShViews': break; // TODO
case 'BrtBkHim': break; // TODO
case 'BrtBeginOleObjects': break; // TODO
case 'BrtOleObject': break; // TODO
case 'BrtEndOleObjects': break; // TODO
case 'BrtBeginListParts': break; // TODO
case 'BrtListPart': break; // TODO
case 'BrtEndListParts': break; // TODO
case 'BrtBeginSortState': break; // TODO
case 'BrtBeginSortCond': break; // TODO
case 'BrtEndSortCond': break; // TODO
case 'BrtEndSortState': break; // TODO
case 'BrtBeginConditionalFormatting': break; // TODO
case 'BrtEndConditionalFormatting': break; // TODO
case 'BrtBeginCFRule': break; // TODO
case 'BrtEndCFRule': break; // TODO
case 'BrtBeginDVals': break; // TODO
case 'BrtDVal': break; // TODO
case 'BrtEndDVals': break; // TODO
case 'BrtRangeProtection': break; // TODO
case 'BrtBeginActiveXControls': break; // TODO
case 'BrtActiveX': break; // TODO
case 'BrtEndActiveXControls': break; // TODO
default: if(!pass) throw new Error("Unexpected record " + R.n);
}
}, opts);
s["!ref"] = encode_range(ref);

@ -53,7 +53,7 @@ var parse_wb_bin = function(data) {
case 'BrtFRTBegin': pass = true; break;
case 'BrtFRTEnd': pass = false; break;
case 'BrtEndBook': break;
//default: if(!pass) throw new Error("Unexpected record " + R.n);
default: if(!pass) throw new Error("Unexpected record " + R.n);
}
});

60
dist/xlsx.js vendored

@ -9,7 +9,7 @@ var _strrev = function(x) { return String(x).split("").reverse().join("");};
function fill(c,l) { return new Array(l+1).join(c); }
function pad(v,d,c){var t=String(v);return t.length>=d?t:(fill(c||0,d-t.length)+t);}
function rpad(v,d,c){var t=String(v);return t.length>=d?t:(t+fill(c||0,d-t.length));}
SSF.version = '0.5.8';
SSF.version = '0.5.9';
/* Options */
var opts_fmt = {};
function fixopts(o){for(var y in opts_fmt) if(o[y]===undefined) o[y]=opts_fmt[y];}
@ -246,9 +246,10 @@ var write_num = function(type, fmt, val) {
o = Math.round(val * Math.pow(10,r[1].length));
return String(o/Math.pow(10,r[1].length)).replace(/^([^\.]+)$/,"$1."+r[1]).replace(/\.$/,"."+r[1]).replace(/\.([0-9]*)$/,function($$, $1) { return "." + $1 + fill("0", r[1].length-$1.length); });
}
fmt = fmt.replace(/^#+0/, "0");
if((r = fmt.match(/^(0*)\.(#*)$/))) {
o = Math.round(val*Math.pow(10,r[2].length));
return String(o * Math.pow(10,-r[2].length)).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^([-]?\d*)$/,"$1.").replace(/^0\./,r[1].length?"0.":".");
o = Math.round(aval*Math.pow(10,r[2].length));
return sign + String(o / Math.pow(10,r[2].length)).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^([-]?\d*)$/,"$1.").replace(/^0\./,r[1].length?"0.":".");
}
if((r = fmt.match(/^#,##0([.]?)$/))) return sign + commaify(String(Math.round(aval)));
if((r = fmt.match(/^#,##0\.([#0]*0)$/))) {
@ -423,7 +424,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.10-b';
XLSX.version = '0.5.11';
var current_codepage, current_cptable, cptable;
if(typeof module !== "undefined" && typeof require !== 'undefined') {
if(typeof cptable === 'undefined') cptable = require('codepage');
@ -889,7 +890,9 @@ var parse_sst_bin = function(data) {
case 'BrtBeginSst': s.Count = val[0]; s.Unique = val[1]; break;
case 'BrtSSTItem': s.push(val); break;
case 'BrtEndSst': return true;
default: throw new Error("Unexpected record " + R.n);
case 'BrtFRTBegin': pass = true; break;
case 'BrtFRTEnd': pass = false; break;
default: if(!pass) throw new Error("Unexpected record " + RT + " " + R.n);
}
});
return s;
@ -1036,7 +1039,7 @@ function parse_sty_bin(data) {
case 'BrtEndColorPalette': state = ""; break;
case 'BrtFRTBegin': pass = true; break;
case 'BrtFRTEnd': pass = false; break;
//default: if(!pass) throw new Error("Unexpected record " + RT + " " + R.n);
default: if(!pass) throw new Error("Unexpected record " + RT + " " + R.n);
}
});
return styles;
@ -1547,6 +1550,7 @@ var parse_ws_bin = function(data, opts) {
case 'BrtCellIsst':
case 'BrtCellReal':
case 'BrtCellRk':
case 'BrtCellSt':
p = {t:val[2]};
switch(val[2]) {
case 'n': p.v = val[1]; break;
@ -1576,10 +1580,12 @@ var parse_ws_bin = function(data, opts) {
case 'BrtSheetCalcProp': break; // TODO
case 'BrtBeginWsViews': break; // TODO
case 'BrtBeginWsView': break; // TODO
case 'BrtPane': break; // TODO
case 'BrtSel': break; // TODO
case 'BrtEndWsView': break; // TODO
case 'BrtEndWsViews': break; // TODO
case 'BrtSel': break; // TODO
case 'BrtACBegin': break; // TODO
case 'BrtRwDescent': break; // TODO
case 'BrtACEnd': break; // TODO
case 'BrtWsFmtInfoEx14': break; // TODO
case 'BrtWsFmtInfo': break; // TODO
@ -1598,8 +1604,44 @@ var parse_ws_bin = function(data, opts) {
case 'BrtBeginMergeCells': break; // TODO
case 'BrtMergeCell': break; // TODO
case 'BrtEndMergeCells': break; // TODO
case 'BrtHLink': break; // TODO
case 'BrtDrawing': break; // TODO
case 'BrtLegacyDrawing': break; // TODO
//default: if(!pass) throw new Error("Unexpected record " + R.n);
case 'BrtPhoneticInfo': break; // TODO
case 'BrtBeginHeaderFooter': break; // TODO
case 'BrtEndHeaderFooter': break; // TODO
case 'BrtBrk': break; // TODO
case 'BrtBeginRwBrk': break; // TODO
case 'BrtEndRwBrk': break; // TODO
case 'BrtBeginColBrk': break; // TODO
case 'BrtEndColBrk': break; // TODO
case 'BrtBeginUserShViews': break; // TODO
case 'BrtBeginUserShView': break; // TODO
case 'BrtEndUserShView': break; // TODO
case 'BrtEndUserShViews': break; // TODO
case 'BrtBkHim': break; // TODO
case 'BrtBeginOleObjects': break; // TODO
case 'BrtOleObject': break; // TODO
case 'BrtEndOleObjects': break; // TODO
case 'BrtBeginListParts': break; // TODO
case 'BrtListPart': break; // TODO
case 'BrtEndListParts': break; // TODO
case 'BrtBeginSortState': break; // TODO
case 'BrtBeginSortCond': break; // TODO
case 'BrtEndSortCond': break; // TODO
case 'BrtEndSortState': break; // TODO
case 'BrtBeginConditionalFormatting': break; // TODO
case 'BrtEndConditionalFormatting': break; // TODO
case 'BrtBeginCFRule': break; // TODO
case 'BrtEndCFRule': break; // TODO
case 'BrtBeginDVals': break; // TODO
case 'BrtDVal': break; // TODO
case 'BrtEndDVals': break; // TODO
case 'BrtRangeProtection': break; // TODO
case 'BrtBeginActiveXControls': break; // TODO
case 'BrtActiveX': break; // TODO
case 'BrtEndActiveXControls': break; // TODO
default: if(!pass) throw new Error("Unexpected record " + R.n);
}
}, opts);
s["!ref"] = encode_range(ref);
@ -1873,7 +1915,7 @@ var parse_wb_bin = function(data) {
case 'BrtFRTBegin': pass = true; break;
case 'BrtFRTEnd': pass = false; break;
case 'BrtEndBook': break;
//default: if(!pass) throw new Error("Unexpected record " + R.n);
default: if(!pass) throw new Error("Unexpected record " + R.n);
}
});

4
dist/xlsx.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/xlsx.min.map vendored

File diff suppressed because one or more lines are too long

@ -1,15 +1,15 @@
{
"name": "xlsx",
"version": "0.5.10-b",
"version": "0.5.11",
"author": "sheetjs",
"description": "XLSB / XLSX / XLSM parser",
"description": "XLSB / XLSX / XLSM (Excel 2007+ Spreadsheet) parser",
"keywords": [ "xlsx", "xlsb", "xlsm", "office", "excel", "spreadsheet" ],
"bin": {
"xlsx2csv": "./bin/xlsx2csv.njs"
},
"main": "./xlsx",
"dependencies": {
"ssf":"~0.5.6",
"ssf":"~0.5.9",
"codepage":"",
"cfb":"",
"jszip":"~2.1.0",

@ -82,6 +82,8 @@ apachepoi_55926.xlsx
apachepoi_55927.xlsx
apachepoi_56011.xlsx
apachepoi_56017.xlsx
apachepoi_56169.xlsx
apachepoi_56278.xlsx
apachepoi_AverageTaxRates.xlsx
apachepoi_Booleans.xlsx
apachepoi_BrNotClosed.xlsx

@ -1 +1 @@
Subproject commit e0c5c7ddb3cbaf4f70c1cd7e5c9fe1597aa2f4da
Subproject commit a0974ce48b17fdeaf7db5d865b215b98192921c7

60
xlsx.js

@ -9,7 +9,7 @@ var _strrev = function(x) { return String(x).split("").reverse().join("");};
function fill(c,l) { return new Array(l+1).join(c); }
function pad(v,d,c){var t=String(v);return t.length>=d?t:(fill(c||0,d-t.length)+t);}
function rpad(v,d,c){var t=String(v);return t.length>=d?t:(t+fill(c||0,d-t.length));}
SSF.version = '0.5.8';
SSF.version = '0.5.9';
/* Options */
var opts_fmt = {};
function fixopts(o){for(var y in opts_fmt) if(o[y]===undefined) o[y]=opts_fmt[y];}
@ -246,9 +246,10 @@ var write_num = function(type, fmt, val) {
o = Math.round(val * Math.pow(10,r[1].length));
return String(o/Math.pow(10,r[1].length)).replace(/^([^\.]+)$/,"$1."+r[1]).replace(/\.$/,"."+r[1]).replace(/\.([0-9]*)$/,function($$, $1) { return "." + $1 + fill("0", r[1].length-$1.length); });
}
fmt = fmt.replace(/^#+0/, "0");
if((r = fmt.match(/^(0*)\.(#*)$/))) {
o = Math.round(val*Math.pow(10,r[2].length));
return String(o * Math.pow(10,-r[2].length)).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^([-]?\d*)$/,"$1.").replace(/^0\./,r[1].length?"0.":".");
o = Math.round(aval*Math.pow(10,r[2].length));
return sign + String(o / Math.pow(10,r[2].length)).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^([-]?\d*)$/,"$1.").replace(/^0\./,r[1].length?"0.":".");
}
if((r = fmt.match(/^#,##0([.]?)$/))) return sign + commaify(String(Math.round(aval)));
if((r = fmt.match(/^#,##0\.([#0]*0)$/))) {
@ -423,7 +424,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.10-b';
XLSX.version = '0.5.11';
var current_codepage, current_cptable, cptable;
if(typeof module !== "undefined" && typeof require !== 'undefined') {
if(typeof cptable === 'undefined') cptable = require('codepage');
@ -889,7 +890,9 @@ var parse_sst_bin = function(data) {
case 'BrtBeginSst': s.Count = val[0]; s.Unique = val[1]; break;
case 'BrtSSTItem': s.push(val); break;
case 'BrtEndSst': return true;
default: throw new Error("Unexpected record " + R.n);
case 'BrtFRTBegin': pass = true; break;
case 'BrtFRTEnd': pass = false; break;
default: if(!pass) throw new Error("Unexpected record " + RT + " " + R.n);
}
});
return s;
@ -1036,7 +1039,7 @@ function parse_sty_bin(data) {
case 'BrtEndColorPalette': state = ""; break;
case 'BrtFRTBegin': pass = true; break;
case 'BrtFRTEnd': pass = false; break;
//default: if(!pass) throw new Error("Unexpected record " + RT + " " + R.n);
default: if(!pass) throw new Error("Unexpected record " + RT + " " + R.n);
}
});
return styles;
@ -1547,6 +1550,7 @@ var parse_ws_bin = function(data, opts) {
case 'BrtCellIsst':
case 'BrtCellReal':
case 'BrtCellRk':
case 'BrtCellSt':
p = {t:val[2]};
switch(val[2]) {
case 'n': p.v = val[1]; break;
@ -1576,10 +1580,12 @@ var parse_ws_bin = function(data, opts) {
case 'BrtSheetCalcProp': break; // TODO
case 'BrtBeginWsViews': break; // TODO
case 'BrtBeginWsView': break; // TODO
case 'BrtPane': break; // TODO
case 'BrtSel': break; // TODO
case 'BrtEndWsView': break; // TODO
case 'BrtEndWsViews': break; // TODO
case 'BrtSel': break; // TODO
case 'BrtACBegin': break; // TODO
case 'BrtRwDescent': break; // TODO
case 'BrtACEnd': break; // TODO
case 'BrtWsFmtInfoEx14': break; // TODO
case 'BrtWsFmtInfo': break; // TODO
@ -1598,8 +1604,44 @@ var parse_ws_bin = function(data, opts) {
case 'BrtBeginMergeCells': break; // TODO
case 'BrtMergeCell': break; // TODO
case 'BrtEndMergeCells': break; // TODO
case 'BrtHLink': break; // TODO
case 'BrtDrawing': break; // TODO
case 'BrtLegacyDrawing': break; // TODO
//default: if(!pass) throw new Error("Unexpected record " + R.n);
case 'BrtPhoneticInfo': break; // TODO
case 'BrtBeginHeaderFooter': break; // TODO
case 'BrtEndHeaderFooter': break; // TODO
case 'BrtBrk': break; // TODO
case 'BrtBeginRwBrk': break; // TODO
case 'BrtEndRwBrk': break; // TODO
case 'BrtBeginColBrk': break; // TODO
case 'BrtEndColBrk': break; // TODO
case 'BrtBeginUserShViews': break; // TODO
case 'BrtBeginUserShView': break; // TODO
case 'BrtEndUserShView': break; // TODO
case 'BrtEndUserShViews': break; // TODO
case 'BrtBkHim': break; // TODO
case 'BrtBeginOleObjects': break; // TODO
case 'BrtOleObject': break; // TODO
case 'BrtEndOleObjects': break; // TODO
case 'BrtBeginListParts': break; // TODO
case 'BrtListPart': break; // TODO
case 'BrtEndListParts': break; // TODO
case 'BrtBeginSortState': break; // TODO
case 'BrtBeginSortCond': break; // TODO
case 'BrtEndSortCond': break; // TODO
case 'BrtEndSortState': break; // TODO
case 'BrtBeginConditionalFormatting': break; // TODO
case 'BrtEndConditionalFormatting': break; // TODO
case 'BrtBeginCFRule': break; // TODO
case 'BrtEndCFRule': break; // TODO
case 'BrtBeginDVals': break; // TODO
case 'BrtDVal': break; // TODO
case 'BrtEndDVals': break; // TODO
case 'BrtRangeProtection': break; // TODO
case 'BrtBeginActiveXControls': break; // TODO
case 'BrtActiveX': break; // TODO
case 'BrtEndActiveXControls': break; // TODO
default: if(!pass) throw new Error("Unexpected record " + R.n);
}
}, opts);
s["!ref"] = encode_range(ref);
@ -1873,7 +1915,7 @@ var parse_wb_bin = function(data) {
case 'BrtFRTBegin': pass = true; break;
case 'BrtFRTEnd': pass = false; break;
case 'BrtEndBook': break;
//default: if(!pass) throw new Error("Unexpected record " + R.n);
default: if(!pass) throw new Error("Unexpected record " + R.n);
}
});