forked from sheetjs/sheetjs
SheetJS
d15b81e0e9
- very basic XLSX / XLSM write support with roundtrip tests (XLSB stubs) - reorganized source tree - new XLSB range check ensures that A1 is not emitted for empty sheets - SSF table emitted in output (consistent with js-xls) - CLI supports writing Backwards-incompatible changes: o new Property aliases (see CORE_PROPS and EXT_PROPS) o FILETIME custom properties parsed as JS Dates o `xlsx2csv` -> `xlsx` (and `bin/xlsx{2csv,}.njs`)
24 lines
677 B
JavaScript
24 lines
677 B
JavaScript
var strs = {}; // shared strings
|
|
var _ssfopts = {}; // spreadsheet formatting options
|
|
|
|
RELS.WS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet";
|
|
|
|
function get_sst_id(sst, str) {
|
|
for(var i = 0; i != sst.length; ++i) if(sst[i].t === str) { sst.Count ++; return i; }
|
|
sst[sst.length] = {t:str}; sst.Count ++; sst.Unique ++; return sst.length-1;
|
|
}
|
|
|
|
function get_cell_style(styles, cell, opts) {
|
|
var z = opts.revssf[cell.z];
|
|
for(var i = 0; i != styles.length; ++i) if(styles[i].numFmtId === z) return i;
|
|
styles[styles.length] = {
|
|
numFmtId:z,
|
|
fontId:0,
|
|
fillId:0,
|
|
borderId:0,
|
|
xfId:0,
|
|
applyNumberFormat:1
|
|
};
|
|
return styles.length-1;
|
|
}
|