2014-01-28 16:38:02 +00:00
|
|
|
/* [MS-XLSB] 2.4.301 BrtBundleSh */
|
|
|
|
var parse_BrtBundleSh = function(data, length) {
|
|
|
|
var z = {};
|
|
|
|
z.hsState = data.read_shift(4); //ST_SheetState
|
|
|
|
z.iTabID = data.read_shift(4);
|
|
|
|
z.strRelID = parse_RelID(data,length-8);
|
|
|
|
z.name = parse_XLWideString(data);
|
|
|
|
return z;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* [MS-XLSB] 2.1.7.60 Workbook */
|
2014-03-23 21:30:00 +00:00
|
|
|
var parse_wb_bin = function(data, opts) {
|
2014-01-28 16:38:02 +00:00
|
|
|
var wb = { AppVersion:{}, WBProps:{}, WBView:[], Sheets:[], CalcPr:{}, xmlns: "" };
|
2014-01-29 06:00:09 +00:00
|
|
|
var pass = false, z;
|
2014-01-28 16:38:02 +00:00
|
|
|
|
|
|
|
recordhopper(data, function(val, R) {
|
|
|
|
switch(R.n) {
|
|
|
|
case 'BrtBundleSh': wb.Sheets.push(val); break;
|
|
|
|
|
|
|
|
case 'BrtBeginBook': break;
|
|
|
|
case 'BrtFileVersion': break;
|
|
|
|
case 'BrtWbProp': break;
|
2014-02-17 08:44:22 +00:00
|
|
|
case 'BrtACBegin': break;
|
|
|
|
case 'BrtAbsPath15': break;
|
|
|
|
case 'BrtACEnd': break;
|
|
|
|
/*case 'BrtBookProtectionIso': break;*/
|
|
|
|
case 'BrtBookProtection': break;
|
2014-01-28 16:38:02 +00:00
|
|
|
case 'BrtBeginBookViews': break;
|
|
|
|
case 'BrtBookView': break;
|
|
|
|
case 'BrtEndBookViews': break;
|
|
|
|
case 'BrtBeginBundleShs': break;
|
|
|
|
case 'BrtEndBundleShs': break;
|
2014-02-14 06:25:46 +00:00
|
|
|
case 'BrtBeginFnGroup': break;
|
|
|
|
case 'BrtEndFnGroup': break;
|
|
|
|
case 'BrtBeginExternals': break;
|
|
|
|
case 'BrtSupSelf': break;
|
2014-02-17 08:44:22 +00:00
|
|
|
case 'BrtSupBookSrc': break;
|
2014-02-14 06:25:46 +00:00
|
|
|
case 'BrtExternSheet': break;
|
|
|
|
case 'BrtEndExternals': break;
|
2014-01-28 16:38:02 +00:00
|
|
|
case 'BrtName': break;
|
|
|
|
case 'BrtCalcProp': break;
|
2014-02-17 08:44:22 +00:00
|
|
|
case 'BrtUserBookView': break;
|
2014-01-28 16:38:02 +00:00
|
|
|
case 'BrtBeginPivotCacheIDs': break;
|
|
|
|
case 'BrtBeginPivotCacheID': break;
|
|
|
|
case 'BrtEndPivotCacheID': break;
|
|
|
|
case 'BrtEndPivotCacheIDs': break;
|
2014-02-17 08:44:22 +00:00
|
|
|
case 'BrtWebOpt': break;
|
2014-01-28 16:38:02 +00:00
|
|
|
case 'BrtFileRecover': break;
|
2014-02-17 08:44:22 +00:00
|
|
|
/*case 'BrtBeginWebPubItems': break;
|
|
|
|
case 'BrtBeginWebPubItem': break;
|
|
|
|
case 'BrtEndWebPubItem': break;
|
|
|
|
case 'BrtEndWebPubItems': break;*/
|
2014-01-28 16:38:02 +00:00
|
|
|
case 'BrtFRTBegin': pass = true; break;
|
|
|
|
case 'BrtFRTEnd': pass = false; break;
|
|
|
|
case 'BrtEndBook': break;
|
2014-03-19 17:53:20 +00:00
|
|
|
default: if(!pass) throw new Error("Unexpected record " + R.n);
|
2014-01-28 16:38:02 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
/* defaults */
|
|
|
|
for(z in WBPropsDef) if(typeof wb.WBProps[z] === 'undefined') wb.WBProps[z] = WBPropsDef[z];
|
|
|
|
for(z in CalcPrDef) if(typeof wb.CalcPr[z] === 'undefined') wb.CalcPr[z] = CalcPrDef[z];
|
|
|
|
|
|
|
|
wb.WBView.forEach(function(w){for(var z in WBViewDef) if(typeof w[z] === 'undefined') w[z]=WBViewDef[z]; });
|
|
|
|
wb.Sheets.forEach(function(w){for(var z in SheetDef) if(typeof w[z] === 'undefined') w[z]=SheetDef[z]; });
|
|
|
|
|
|
|
|
_ssfopts.date1904 = parsexmlbool(wb.WBProps.date1904, 'date1904');
|
|
|
|
|
|
|
|
return wb;
|
2014-01-29 06:00:09 +00:00
|
|
|
};
|