2014-03-23 21:30:00 +00:00
|
|
|
/* [MS-XLSB] 2.4.651 BrtFmt */
|
2014-01-31 11:52:18 +00:00
|
|
|
function parse_BrtFmt(data, length) {
|
|
|
|
var ifmt = data.read_shift(2);
|
|
|
|
var stFmtCode = parse_XLWideString(data,length-2);
|
|
|
|
return [ifmt, stFmtCode];
|
|
|
|
}
|
2014-01-28 16:38:02 +00:00
|
|
|
|
2014-03-23 21:30:00 +00:00
|
|
|
/* [MS-XLSB] 2.4.816 BrtXF */
|
2014-01-31 11:52:18 +00:00
|
|
|
function parse_BrtXF(data, length) {
|
|
|
|
var ixfeParent = data.read_shift(2);
|
|
|
|
var ifmt = data.read_shift(2);
|
|
|
|
parsenoop(data, length-4);
|
|
|
|
return {ixfe:ixfeParent, ifmt:ifmt };
|
|
|
|
}
|
|
|
|
|
2014-03-23 21:30:00 +00:00
|
|
|
/* [MS-XLSB] 2.1.7.50 Styles */
|
|
|
|
function parse_sty_bin(data, opts) {
|
2014-01-31 11:52:18 +00:00
|
|
|
styles.NumberFmt = [];
|
|
|
|
for(var y in SSF._table) styles.NumberFmt[y] = SSF._table[y];
|
2014-02-07 10:53:40 +00:00
|
|
|
|
2014-01-31 11:52:18 +00:00
|
|
|
styles.CellXf = [];
|
2014-02-17 08:44:22 +00:00
|
|
|
var state = ""; /* TODO: this should be a stack */
|
2014-01-31 11:52:18 +00:00
|
|
|
var pass = false;
|
|
|
|
recordhopper(data, function(val, R, RT) {
|
|
|
|
switch(R.n) {
|
|
|
|
case 'BrtFmt':
|
|
|
|
styles.NumberFmt[val[0]] = val[1]; SSF.load(val[1], val[0]);
|
|
|
|
break;
|
|
|
|
case 'BrtFont': break; /* TODO */
|
|
|
|
case 'BrtKnownFonts': break; /* TODO */
|
|
|
|
case 'BrtFill': break; /* TODO */
|
|
|
|
case 'BrtBorder': break; /* TODO */
|
|
|
|
case 'BrtXF':
|
|
|
|
if(state === "CELLXFS") {
|
|
|
|
styles.CellXf.push(val);
|
|
|
|
}
|
|
|
|
break; /* TODO */
|
|
|
|
case 'BrtStyle': break; /* TODO */
|
|
|
|
case 'BrtRowHdr': break; /* TODO */
|
|
|
|
case 'BrtCellMeta': break; /* ?? */
|
2014-02-17 08:44:22 +00:00
|
|
|
case 'BrtDXF': break; /* TODO */
|
|
|
|
case 'BrtMRUColor': break; /* TODO */
|
|
|
|
case 'BrtIndexedColor': break; /* TODO */
|
2014-01-31 11:52:18 +00:00
|
|
|
case 'BrtBeginStyleSheet': break;
|
|
|
|
case 'BrtEndStyleSheet': break;
|
2014-02-17 08:44:22 +00:00
|
|
|
case 'BrtBeginTableStyle': break;
|
|
|
|
case 'BrtTableStyleElement': break;
|
|
|
|
case 'BrtEndTableStyle': break;
|
2014-01-31 11:52:18 +00:00
|
|
|
case 'BrtBeginFmts': state = "FMTS"; break;
|
|
|
|
case 'BrtEndFmts': state = ""; break;
|
|
|
|
case 'BrtBeginFonts': state = "FONTS"; break;
|
|
|
|
case 'BrtEndFonts': state = ""; break;
|
|
|
|
case 'BrtACBegin': state = "ACFONTS"; break;
|
|
|
|
case 'BrtACEnd': state = ""; break;
|
|
|
|
case 'BrtBeginFills': state = "FILLS"; break;
|
|
|
|
case 'BrtEndFills': state = ""; break;
|
|
|
|
case 'BrtBeginBorders': state = "BORDERS"; break;
|
|
|
|
case 'BrtEndBorders': state = ""; break;
|
|
|
|
case 'BrtBeginCellStyleXFs': state = "CELLSTYLEXFS"; break;
|
|
|
|
case 'BrtEndCellStyleXFs': state = ""; break;
|
|
|
|
case 'BrtBeginCellXFs': state = "CELLXFS"; break;
|
|
|
|
case 'BrtEndCellXFs': state = ""; break;
|
|
|
|
case 'BrtBeginStyles': state = "STYLES"; break;
|
|
|
|
case 'BrtEndStyles': state = ""; break;
|
|
|
|
case 'BrtBeginDXFs': state = "DXFS"; break;
|
|
|
|
case 'BrtEndDXFs': state = ""; break;
|
|
|
|
case 'BrtBeginTableStyles': state = "TABLESTYLES"; break;
|
|
|
|
case 'BrtEndTableStyles': state = ""; break;
|
2014-02-17 08:44:22 +00:00
|
|
|
case 'BrtBeginColorPalette': state = "COLORPALETTE"; break;
|
2014-03-23 21:30:00 +00:00
|
|
|
case 'BrtEndColorPalette': state = ""; break;
|
2014-02-17 08:44:22 +00:00
|
|
|
case 'BrtBeginIndexedColors': state = "INDEXEDCOLORS"; break;
|
|
|
|
case 'BrtEndIndexedColors': state = ""; break;
|
|
|
|
case 'BrtBeginMRUColors': state = "MRUCOLORS"; break;
|
|
|
|
case 'BrtEndMRUColors': state = ""; break;
|
2014-01-31 11:52:18 +00:00
|
|
|
case 'BrtFRTBegin': pass = true; break;
|
|
|
|
case 'BrtFRTEnd': pass = false; break;
|
2014-03-23 21:30:00 +00:00
|
|
|
case 'BrtBeginStyleSheetExt14': break;
|
|
|
|
case 'BrtBeginSlicerStyles': break;
|
|
|
|
case 'BrtEndSlicerStyles': break;
|
|
|
|
case 'BrtBeginTimelineStylesheetExt15': break;
|
|
|
|
case 'BrtEndTimelineStylesheetExt15': break;
|
|
|
|
case 'BrtBeginTimelineStyles': break;
|
|
|
|
case 'BrtEndTimelineStyles': break;
|
|
|
|
case 'BrtEndStyleSheetExt14': break;
|
|
|
|
default: if(!pass || opts.WTF) throw new Error("Unexpected record " + RT + " " + R.n);
|
2014-01-31 11:52:18 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
return styles;
|
2014-01-28 16:38:02 +00:00
|
|
|
}
|