Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 27 additions & 6 deletions dist/xlsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -7209,10 +7209,31 @@ 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, len = sst.length; i < len; ++i) if(sst[i].t === str) { sst.Count ++; return i; }
sst[len] = {t:str}; sst.Count ++; sst.Unique ++; return len;
}
function get_sst_id(sst, cell) {
var i, len;
i = 0;
len = sst.length;
while (i < len) {
if (sst[i].t === cell.v) {
sst.Count++;
return i;
}
++i;
}
if (cell.r && cell.r !== '') {
sst[len] = {
t: cell.v,
r: cell.r
};
} else {
sst[len] = {
t: cell.v
};
}
sst.Count++;
sst.Unique++;
return len;
};

function get_cell_style(styles, cell, opts) {
var z = opts.revssf[cell.z != null ? cell.z : "General"];
Expand Down Expand Up @@ -7416,7 +7437,7 @@ function write_ws_xml_cell(cell, ref, ws, opts, idx, wb) {
case 'e': o.t = "e"; break;
default:
if(opts.bookSST) {
v = writetag('v', ''+get_sst_id(opts.Strings, cell.v));
v = writetag('v', ''+get_sst_id(opts.Strings, cell));
o.t = "s"; break;
}
o.t = "str"; break;
Expand Down Expand Up @@ -7928,7 +7949,7 @@ function write_ws_bin_cell(ba, cell, R, C, opts) {
switch(cell.t) {
case 's': case 'str':
if(opts.bookSST) {
vv = get_sst_id(opts.Strings, cell.v);
vv = get_sst_id(opts.Strings, cell);
o.t = "s"; break;
}
o.t = "str"; break;
Expand Down