Lines Matching refs:cell

547 	TODO: technically the display depends on the width of the cell
4227 function shift_cell_xls(cell/*:CellAddress*/, tgt/*:any*/, opts/*:?any*/)/*:CellAddress*/ { argument
4228 var out = dup(cell);
4243 function shift_range_xls(cell, range, opts) { argument
4244 var out = dup(cell);
4293 //function encode_cell(cell/*:CellAddress*/)/*:string*/ { return encode_col(cell.c) + encode_row(ce…
4294 function encode_cell(cell/*:CellAddress*/)/*:string*/ { argument
4295 var col = cell.c + 1;
4298 return s + (cell.r + 1);
4305 /*# if only one arg, it is assumed to be a Range. If 2 args, both are cell addresses */
4363 function safe_format_cell(cell/*:Cell*/, v/*:any*/) { argument
4364 var q = (cell.t == 'd' && v instanceof Date);
4365 if(cell.z != null) try { return (cell.w = SSF_format(cell.z, q ? datenum(v) : v)); } catch(e) { }
4366 …try { return (cell.w = SSF_format((cell.XF||{}).numFmtId||(q ? 14 : 0), q ? datenum(v) : v)); } c…
4369 function format_cell(cell/*:Cell*/, v/*:any*/, o/*:any*/) { argument
4370 if(cell == null || cell.t == null || cell.t == 'z') return "";
4371 if(cell.w !== undefined) return cell.w;
4372 if(cell.t == 'd' && !cell.z && o && o.dateNF) cell.z = o.dateNF;
4373 if(cell.t == "e") return BErr[cell.v] || cell.v;
4374 if(v == undefined) return safe_format_cell(cell, cell.v);
4375 return safe_format_cell(cell, v);
4412 var cell/*:Cell*/ = ({v: data[R][C] }/*:any*/); class
4418 …[C] === 'object' && !Array.isArray(data[R][C]) && !(data[R][C] instanceof Date)) cell = data[R][C];
4420 if(Array.isArray(cell.v)) { cell.f = data[R][C][1]; cell.v = cell.v[0]; }
4421 if(cell.v === null) {
4422 if(cell.f) cell.t = 'n';
4423 else if(o.nullError) { cell.t = 'e'; cell.v = 0; }
4425 else cell.t = 'z';
4427 else if(typeof cell.v === 'number') cell.t = 'n';
4428 else if(typeof cell.v === 'boolean') cell.t = 'b';
4429 else if(cell.v instanceof Date) {
4430 cell.z = o.dateNF || table_fmt[14];
4431 if(o.cellDates) { cell.t = 'd'; cell.w = SSF_format(cell.z, datenum(cell.v, o.date1904)); }
4432 … else { cell.t = 'n'; cell.v = datenum(cell.v, o.date1904); cell.w = SSF_format(cell.z, cell.v); }
4434 else cell.t = 's';
4438 if(ws[__R][__C] && ws[__R][__C].z) cell.z = ws[__R][__C].z;
4439 ws[__R][__C] = cell;
4442 if(ws[cell_ref] && ws[cell_ref].z) cell.z = ws[cell_ref].z;
4443 ws[cell_ref] = cell;
4537 function write_XLSBCell(cell/*:any*/, o/*:?Block*/) { argument
4539 o.write_shift(-4, cell.c);
4540 o.write_shift(3, cell.iStyleRef || cell.s);
4552 function write_XLSBShortCell(cell/*:any*/, o/*:?Block*/) { argument
4554 o.write_shift(3, cell.iStyleRef || cell.s);
4604 var cell/*:Range*/ = ({ s: {}, e: {} }/*:any*/); class in parse_RfX
4605 cell.s.r = data.read_shift(4);
4606 cell.e.r = data.read_shift(4);
4607 cell.s.c = data.read_shift(4);
4608 cell.e.c = data.read_shift(4);
4609 return cell;
6970 var cell = parse_XLSCell(blob);
6971 cell.isst = blob.read_shift(4);
6972 return cell;
6985 var cell = parse_XLSCell(blob, 6);
6988 cell.val = str;
6989 return cell;
7163 var cell = parse_XLSCell(blob, 6);
7166 cell.val = val;
7167 cell.t = (val === true || val === false) ? 'b' : 'e';
7168 return cell;
7180 var cell = parse_XLSCell(blob, 6);
7182 cell.val = xnum;
7183 return cell;
7561 var parse_Blank = parse_XLSCell; /* [MS-XLS] 2.4.20 Just the cell */
7578 var cell = parse_XLSCell(blob, 6);
7581 cell.t = 'str';
7582 cell.val = str;
7583 return cell;
7587 var cell = parse_XLSCell(blob, 6);
7590 cell.t = 'n';
7591 cell.val = num;
7592 return cell;
7602 var cell = parse_XLSCell(blob, 6);
7605 cell.t = 'n';
7606 cell.val = num;
7607 return cell;
7635 var cell = parse_XLSCell(blob, 6);
7639 cell.t = 'str';
7640 cell.val = str;
7641 return cell;
8099 case 'C': /* cell */
8168 case 'S': break; /* cell style */
8214 …function write_ws_cell_sylk(cell/*:Cell*/, ws/*:Worksheet*/, R/*:number*/, C/*:number*//*::, opts*…
8216 switch(cell.t) {
8218 o += (cell.v||0);
8219 if(cell.f && !cell.F) o += ";E" + a1_to_rc(cell.f, {r:R, c:C}); break;
8220 case 'b': o += cell.v ? "TRUE" : "FALSE"; break;
8221 case 'e': o += cell.w || cell.v; break;
8222 case 'd': o += '"' + (cell.w || cell.v) + '"'; break;
8223 …case 's': o += '"' + (cell.v == null ? "" : String(cell.v)).replace(/"/g,"").replace(/;/g, ";;") +…
8254 var r = safe_decode_range(ws['!ref']), cell/*:Cell*/;
8270 cell = dense ? (ws[R]||[])[C]: ws[coord];
8271 if(!cell || (cell.v == null && (!cell.f || cell.F))) continue;
8272 p.push(write_ws_cell_sylk(cell, ws, R, C, opts)); // TODO: pass date1904 info
8353 var cell/*:Cell*/ = dense ? (ws[R] && ws[R][C]) : ws[encode_cell({r:R,c:C})];
8354 if(cell == null) { p +=("1,0\r\n\"\"\r\n"); continue;}
8355 switch(cell.t) {
8358 if(cell.w != null) p +=("0," + cell.w + "\r\nV");
8359 else if(cell.v != null) p +=(make_value(cell.v, "V")); // TODO: should this call SSF_format?
8360 else if(cell.f != null && !cell.F) p +=(make_value_str("=" + cell.f));
8363 if(cell.v == null) p +=("1,0\r\n\"\"");
8364 else p +=(make_value(cell.v, "V"));
8368 p +=(cell.v ? make_value(1, "TRUE") : make_value(0, "FALSE"));
8371 p +=(make_value_str((!_DIF_XL || isNaN(+cell.v)) ? cell.v : '="' + cell.v + '"'));
8374 if(!cell.w) cell.w = SSF_format(cell.z || table_fmt[14], datenum(parseDate(cell.v)));
8375 if(_DIF_XL) p +=(make_value(cell.w, "V"));
8376 else p +=(make_value_str(cell.w));
8401 if(record[0] !== 'cell') continue;
8446 var o/*:Array<string>*/ = [], oo/*:Array<string>*/ = [], cell, coord = "";
8452 cell = dense ? (ws[R]||[])[C] : ws[coord];
8453 if(!cell || cell.v == null || cell.t === 'z') continue;
8454 oo = ["cell", coord, 't'];
8455 switch(cell.t) {
8456 case 's': case 'str': oo.push(encode(cell.v)); break;
8458 if(!cell.f) { oo[2]='v'; oo[3]=cell.v; }
8459 else { oo[2]='vtf'; oo[3]='n'; oo[4]=cell.v; oo[5]=encode(cell.f); }
8462 oo[2] = 'vt'+(cell.f?'f':'c'); oo[3]='nl'; oo[4]=cell.v?"1":"0";
8463 oo[5] = encode(cell.f||(cell.v?'TRUE':'FALSE'));
8466 var t = datenum(parseDate(cell.v));
8468 oo[5] = cell.w || SSF_format(cell.z || table_fmt[14], t);
8595 var cell = ({}/*:any*/);
8597 if(s.length === 0) cell.t = 'z';
8598 else if(o.raw) { cell.t = 's'; cell.v = s; }
8599 else if(s.trim().length === 0) { cell.t = 's'; cell.v = s; }
8601 …if(s.charCodeAt(1) == 0x22 && s.charCodeAt(s.length - 1) == 0x22) { cell.t = 's'; cell.v = s.slice…
8602 else if(fuzzyfmla(s)) { cell.t = 'n'; cell.f = s.slice(1); }
8603 else { cell.t = 's'; cell.v = s; } }
8604 else if(s == "TRUE") { cell.t = 'b'; cell.v = true; }
8605 else if(s == "FALSE") { cell.t = 'b'; cell.v = false; }
8606 …else if(!isNaN(v = fuzzynum(s))) { cell.t = 'n'; if(o.cellText !== false) cell.w = s; cell.v = v; }
8608 cell.z = o.dateNF || table_fmt[14];
8611 if(o.cellDates) { cell.t = 'd'; cell.v = v; }
8612 else { cell.t = 'n'; cell.v = datenum(v); }
8613 …if(o.cellText !== false) cell.w = SSF_format(cell.z, cell.v instanceof Date ? datenum(cell.v):cell
8614 if(!o.cellNF) delete cell.z;
8616 cell.t = 's';
8617 cell.v = s;
8619 if(cell.t == 'z'){}
8620 else if(o.dense) { if(!ws[R]) ws[R] = []; ws[R][C] = cell; }
8621 else ws[encode_cell({c:C,r:R})] = cell;
8675 var r = safe_decode_range(ws['!ref']), cell/*:Cell*/;
8681 cell = dense ? (ws[R]||[])[C] : ws[coord];
8682 if(!cell || cell.v == null) { oo.push(" "); continue; }
8683 var w = (cell.w || (format_cell(cell), cell.w) || "").slice(0,10);
8883 var cell = dense ? (ws[R]||[])[C] : ws[ref];
8884 if(!cell || cell.t == "z") continue;
8886 if(cell.t == "n") {
8887 …if((cell.v|0)==cell.v && cell.v >= -32768 && cell.v <= 32767) write_biff_rec(ba, 0x0d, write_INTEG…
8888 else write_biff_rec(ba, 0x0e, write_NUMBER(R, C, cell.v));
8890 var str = format_cell(cell);
8923 var cell = dense ? (ws[R]||[])[C] : ws[ref];
8924 if(!cell || cell.t == "z") continue;
8926 if(cell.t == "n") {
8927 write_biff_rec(ba, 0x17, write_NUMBER_17(R, C, wsidx, cell.v));
8929 var str = format_cell(cell);
9709 var cell = { t: "z" };
9715 case 2: cell = { t: "n", v: p.read_shift(2) }; break;
9716 case 3: cell = { t: "n", v: p.read_shift(2, 'i') }; break;
9717 case 5: cell = { t: "n", v: p.read_shift(8, 'f') }; break;
9718 case 7: cell = { t: "s", v: SST[type = p.read_shift(4) - 1] }; break;
9719 …case 8: cell = { t: "n", v: p.read_shift(8, 'f') }; p.l += 2; /* cell.f = formulae[p.read_shift(4)…
9720 default: throw "Unrecognized QPW cell type " + (flags & 0x1F);
9727 default: throw "Unsupported delta for QPW cell type " + (flags & 0x1F);
9729 if(!(!o.sheetStubs && cell.t == "z")) {
9732 s[R][C] = cell;
9733 } else s[encode_cell({r:R, c:C})] = cell;
9738 case 2: cell = { t: "n", v: (cell.v + delta) & 0xFFFF }; break;
9739 …case 3: cell = { t: "n", v: (cell.v + delta) & 0xFFFF }; if(cell.v > 0x7FFF) cell.v -= 0x10000; br…
9740 case 7: cell = { t: "s", v: SST[type = (type + delta) >>> 0] }; break;
9741 default: throw "Cannot apply delta for QPW cell type " + (flags & 0x1F);
9743 case 1: cell = { t: "z" }; break;
9744 case 2: cell = { t: "n", v: p.read_shift(2) }; break;
9745 case 7: cell = { t: "s", v: SST[type = p.read_shift(4) - 1] }; break;
9746 default: throw "Cannot apply repeat for QPW cell type " + (flags & 0x1F);
9748 if(!(!o.sheetStubs && cell.t == "z")) {
9751 s[R][C] = cell;
9752 } else s[encode_cell({r:R, c:C})] = cell;
10412 case "\\cell":
10415 var cell = { v: payload.join(""), t: "s" }; class in AnonymousFunction701aad5b3900
10416 if (cell.v == "TRUE" || cell.v == "FALSE") {
10417 cell.v = cell.v == "TRUE";
10418 cell.t = "b";
10419 } else if (!isNaN(fuzzynum(cell.v))) {
10420 cell.t = "n";
10422 cell.w = cell.v;
10423 cell.v = fuzzynum(cell.v);
10426 ws[R][C] = cell;
10428 ws[encode_cell({ r: R, c: C })] = cell;
10453 var r = safe_decode_range(ws["!ref"]), cell;
10462 cell = dense ? (ws[R] || [])[C] : ws[coord];
10463 if (!cell || cell.v == null && (!cell.f || cell.F)) {
10464 o.push(" \\cell");
10467 o.push(" " + (cell.w || (format_cell(cell), cell.w) || "").replace(/[\r\n]/g, "\\par "));
10468 o.push("\\cell");
11772 case 0x07: break; /* top cell border color */
11773 case 0x08: break; /* bottom cell border color */
11774 case 0x09: break; /* left cell border color */
11775 case 0x0a: break; /* right cell border color */
11776 case 0x0b: break; /* diagonal cell border color */
12005 var cell = {};
12006 cell.r = data.read_shift(4);
12007 cell.c = data.read_shift(4);
12008 out.r = encode_cell(cell);
12162 var cell/*:Cell*/;
12167 cell = sheet[r.r][r.c];
12168 } else cell = sheet[comment.ref];
12169 if (!cell) {
12170 cell = ({t:"z"}/*:any*/); class in AnonymousFunction701aad5b4b00
12171 if(dense) sheet[r.r][r.c] = cell;
12172 else sheet[comment.ref] = cell;
12182 if (!cell.c) cell.c = [];
12187 for(var i = cell.c.length - 1; i >= 0; --i) {
12188 if(!threaded && cell.c[i].T) return;
12189 if(threaded && !cell.c[i].T) cell.c.splice(i, 1);
12194 cell.c.push(o);
12217 var cell = decode_cell(y.ref);
12218 if(opts.sheetRows && opts.sheetRows <= cell.r) return;
12543 /* no defined name can collide with a valid cell address A1:XFD1048576 ... except LOG10! */
12550 function shift_formula_xlsx(f/*:string*/, range/*:string*/, cell/*:string*/)/*:string*/ { argument
12551 var r = decode_range(range), s = r.s, c = decode_cell(cell);
13302 function stringify_formula(formula/*Array<any>*/, range, cell/*:any*/, supbooks, opts)/*:string*/ { argument
13378 …/*::type = f[1][0]; */c = cell ? shift_cell_xls((f[1][1]/*:any*/), cell, opts) : (f[1][1]/*:any*/);
13412 /*::type = f[1][0]; */r = shift_range_xls(f[1][1], cell ? {s:cell} : _range, opts);
13501 var q = ({c: cell.c, r:cell.r}/*:any*/);
13682 var cell = parse_XLSCell(blob, 6);
13693 return {cell:cell, val:val[0], formula:cbf, shared: (flags >> 3) & 1, tt:val[1]};
13695 function write_Formula(cell/*:Cell*/, R/*:number*/, C/*:number*/, opts, os/*:number*/) { argument
13700 var o2 = write_FormulaValue(cell.v);
13709 var bf = new_buf(cell.bf.length);
13710 for(var i = 0; i < cell.bf.length; ++i) bf[i] = cell.bf[i];
13794 var cell = decode_cell(str);
13798 out.write_shift(4, cell.r);
13799 …out.write_shift(2, cell.c | ((str.charAt(0) == "$" ? 0 : 1)<<14) | ((str.match(/\$\d/) ? 0 : 1)<<1…
13810 var cell = decode_cell(str);
13817 out.write_shift(4, cell.r);
13818 …out.write_shift(2, cell.c | ((str.charAt(0) == "$" ? 0 : 1)<<14) | ((str.match(/\$\d/) ? 0 : 1)<<1…
13849 /* start cell */
13850 str = parts[0]; var cell = decode_cell(str);
13852 out.write_shift(4, cell.r);
13853 …out.write_shift(2, cell.c | ((str.charAt(0) == "$" ? 0 : 1)<<14) | ((str.match(/\$\d/) ? 0 : 1)<<1…
13856 /* end cell */
13857 str = parts[1]; cell = decode_cell(str);
13859 out.write_shift(4, cell.r);
13860 …out.write_shift(2, cell.c | ((str.charAt(0) == "$" ? 0 : 1)<<14) | ((str.match(/\$\d/) ? 0 : 1)<<1…
13882 /* start cell */
13883 var str = parts[0], cell = decode_cell(str);
13886 out.write_shift(4, cell.r);
13887 …out.write_shift(2, cell.c | ((str.charAt(0) == "$" ? 0 : 1)<<14) | ((str.match(/\$\d/) ? 0 : 1)<<1…
13889 /* end cell */
13890 str = parts[1]; cell = decode_cell(str);
13893 out.write_shift(4, cell.r);
13894 …out.write_shift(2, cell.c | ((str.charAt(0) == "$" ? 0 : 1)<<14) | ((str.match(/\$\d/) ? 0 : 1)<<1…
15172 function get_cell_style(styles/*:Array<any>*/, cell/*:Cell*/, opts) { argument
15173 var z = opts.revssf[cell.z != null ? cell.z : "General"];
15177 SSF__load(cell.z, i);
15179 opts.ssf[i] = cell.z;
15180 opts.revssf[cell.z] = z = i;
15499 function write_ws_xml_cell(cell/*:Cell*/, ref, ws, opts/*::, idx, wb*/)/*:string*/ { argument
15500 if(cell.c) ws['!comments'].push([ref, cell.c]);
15501 …if((cell.v === undefined || cell.t === "z" && !(opts||{}).sheetStubs) && typeof cell.f !== "string…
15503 var oldt = cell.t, oldv = cell.v;
15504 if(cell.t !== "z") switch(cell.t) {
15505 case 'b': vv = cell.v ? "1" : "0"; break;
15506 case 'n': vv = ''+cell.v; break;
15507 case 'e': vv = BErr[cell.v]; break;
15509 if(opts && opts.cellDates) vv = parseDate(cell.v, -1).toISOString();
15511 cell = dup(cell);
15512 cell.t = 'n';
15513 vv = ''+(cell.v = datenum(parseDate(cell.v)));
15515 if(typeof cell.z === 'undefined') cell.z = table_fmt[14];
15517 default: vv = cell.v; break;
15519 …var v = (cell.t == "z" || cell.v == null)? "" : writetag('v', escapexml(vv)), o = ({r:ref}/*:any*/…
15520 /* TODO: cell style */
15521 var os = get_cell_style(opts.cellXfs, cell, opts);
15523 switch(cell.t) {
15529 default: if(cell.v == null) { delete cell.t; break; }
15530 if(cell.v.length > 32767) throw new Error("Text length must not exceed 32767 characters");
15532 v = writetag('v', ''+get_sst_id(opts.Strings, cell.v, opts.revStrings));
15537 if(cell.t != oldt) { cell.t = oldt; cell.v = oldv; }
15538 if(typeof cell.f == "string" && cell.f) {
15539 var ff = cell.F && cell.F.slice(0, ref.length) == ref ? {t:"array", ref:cell.F} : null;
15540 v = writextag('f', escapexml(cell.f), ff) + (cell.v != null ? v : "");
15542 if(cell.l) {
15543 cell.l.display = escapexml(vv);
15544 ws['!links'].push([ref, cell.l]);
15546 if(cell.D) o.cm = 1;
15738 …*/ = [], r/*:Array<string>*/ = [], range = safe_decode_range(ws['!ref']), cell="", ref, rr = "", c…
15749 if((cell = write_ws_xml_cell(_cell, ref, ws, opts, idx, wb)) != null) r.push(cell);
15948 var cell = Array.isArray(ws) ? (ws[caddr.r]||[])[caddr.c] : ws[encode_cell(caddr)];
15949 if(cell) { if(first < 0) first = j; last = j; }
16007 var cell = parse_XLSBCell(data);
16008 return [cell];
16010 function write_BrtCellBlank(cell, ncell, o) { argument
16015 var cell = parse_XLSBShortCell(data);
16016 return [cell];
16018 function write_BrtShortBlank(cell, ncell, o) { argument
16025 var cell = parse_XLSBCell(data);
16027 return [cell, fBool, 'b'];
16029 function write_BrtCellBool(cell, ncell, o) { argument
16032 o.write_shift(1, cell.v ? 1 : 0);
16036 var cell = parse_XLSBShortCell(data);
16038 return [cell, fBool, 'b'];
16040 function write_BrtShortBool(cell, ncell, o) { argument
16043 o.write_shift(1, cell.v ? 1 : 0);
16049 var cell = parse_XLSBCell(data);
16051 return [cell, bError, 'e'];
16053 function write_BrtCellError(cell, ncell, o) { argument
16056 o.write_shift(1, cell.v);
16060 var cell = parse_XLSBShortCell(data);
16062 return [cell, bError, 'e'];
16064 function write_BrtShortError(cell, ncell, o) { argument
16067 o.write_shift(1, cell.v);
16076 var cell = parse_XLSBCell(data);
16078 return [cell, isst, 's'];
16080 function write_BrtCellIsst(cell, ncell, o) { argument
16087 var cell = parse_XLSBShortCell(data);
16089 return [cell, isst, 's'];
16091 function write_BrtShortIsst(cell, ncell, o) { argument
16100 var cell = parse_XLSBCell(data);
16102 return [cell, value, 'n'];
16104 function write_BrtCellReal(cell, ncell, o) { argument
16107 write_Xnum(cell.v, o);
16111 var cell = parse_XLSBShortCell(data);
16113 return [cell, value, 'n'];
16115 function write_BrtShortReal(cell, ncell, o) { argument
16118 write_Xnum(cell.v, o);
16124 var cell = parse_XLSBCell(data);
16126 return [cell, value, 'n'];
16128 function write_BrtCellRk(cell, ncell, o) { argument
16131 write_RkNumber(cell.v, o);
16135 var cell = parse_XLSBShortCell(data);
16137 return [cell, value, 'n'];
16139 function write_BrtShortRk(cell, ncell, o) { argument
16142 write_RkNumber(cell.v, o);
16148 var cell = parse_XLSBCell(data);
16150 return [cell, value, 'is'];
16155 var cell = parse_XLSBCell(data);
16157 return [cell, value, 'str'];
16159 function write_BrtCellSt(cell, ncell, o) { argument
16160 var data = cell.v == null ? "" : String(cell.v);
16161 if(o == null) o = new_buf(12 + 4 * cell.v.length);
16167 var cell = parse_XLSBShortCell(data);
16169 return [cell, value, 'str'];
16171 function write_BrtShortSt(cell, ncell, o) { argument
16172 var data = cell.v == null ? "" : String(cell.v);
16182 var cell = parse_XLSBCell(data);
16183 cell.r = opts['!row'];
16185 var o = [cell, value, 'b'];
16189 o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */
16198 var cell = parse_XLSBCell(data);
16199 cell.r = opts['!row'];
16201 var o = [cell, value, 'e'];
16205 o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */
16214 var cell = parse_XLSBCell(data);
16215 cell.r = opts['!row'];
16217 var o = [cell, value, 'n'];
16221 o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */
16230 var cell = parse_XLSBCell(data);
16231 cell.r = opts['!row'];
16233 var o = [cell, value, 'str'];
16237 o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */
16419 var row, p, cf, R, C, addr, sstr, rr, cell/*:Cell*/;
16566 cell = ((opts.dense ? s[R][C] : s[encode_col(C) + rr])/*:any*/);
16567 cell.f = stringify_formula(val[1], refguess, {r:row.r, c:C}, supbooks, opts);
16568 cell.F = encode_range(val[0]);
16573 cell = (opts.dense ? s[R][C] : s[encode_col(C) + rr]);
16574 cell.f = stringify_formula(val[1], refguess, {r:row.r, c:C}, supbooks, opts);
16706 function write_ws_bin_cell(ba/*:BufArray*/, cell/*:Cell*/, R/*:number*/, C/*:number*/, opts, ws/*:W… argument
16708 if(cell.c) ws['!comments'].push([encode_cell(o), cell.c]);
16709 if(cell.v === undefined) return false;
16711 switch(cell.t) {
16712 case 'b': vv = cell.v ? "1" : "0"; break;
16714 cell = dup(cell);
16715 cell.z = cell.z || table_fmt[14];
16716 cell.v = datenum(parseDate(cell.v)); cell.t = 'n';
16719 case 'n': case 'e': vv = ''+cell.v; break;
16720 default: vv = cell.v; break;
16722 /* TODO: cell style */
16723 o.s = get_cell_style(opts.cellXfs, cell, opts);
16724 if(cell.l) ws['!links'].push([encode_cell(o), cell.l]);
16725 switch(cell.t) {
16728 vv = get_sst_id(opts.Strings, (cell.v == null ? "" : String(cell.v)/*:any*/), opts.revStrings);
16730 if(last_seen) write_record(ba, 0x0012 /* BrtShortIsst */, write_BrtShortIsst(cell, o));
16731 else write_record(ba, 0x0007 /* BrtCellIsst */, write_BrtCellIsst(cell, o));
16734 if(last_seen) write_record(ba, 0x0011 /* BrtShortSt */, write_BrtShortSt(cell, o));
16735 else write_record(ba, 0x0006 /* BrtCellSt */, write_BrtCellSt(cell, o));
16740 if(cell.v == (cell.v | 0) && cell.v > -1000 && cell.v < 1000) {
16741 if(last_seen) write_record(ba, 0x000D /* BrtShortRk */, write_BrtShortRk(cell, o));
16742 else write_record(ba, 0x0002 /* BrtCellRk */, write_BrtCellRk(cell, o));
16744 if(last_seen) write_record(ba, 0x0010 /* BrtShortReal */, write_BrtShortReal(cell, o));
16745 else write_record(ba, 0x0005 /* BrtCellReal */, write_BrtCellReal(cell, o));
16749 if(last_seen) write_record(ba, 0x000F /* BrtShortBool */, write_BrtShortBool(cell, o));
16750 else write_record(ba, 0x0004 /* BrtCellBool */, write_BrtCellBool(cell, o));
16754 if(last_seen) write_record(ba, 0x000E /* BrtShortError */, write_BrtShortError(cell, o));
16755 else write_record(ba, 0x0003 /* BrtCellError */, write_BrtCellError(cell, o));
16758 if(last_seen) write_record(ba, 0x000C /* BrtShortBlank */, write_BrtShortBlank(cell, o));
16759 else write_record(ba, 0x0001 /* BrtCellBlank */, write_BrtCellBlank(cell, o));
16779 var cell = dense ? (ws[R]||[])[C] : ws[ref];
16780 if(!cell) { last_seen = false; continue; }
16781 /* write cell */
16782 last_seen = write_ws_bin_cell(ba, cell, R, C, opts, ws, last_seen);
17954 function safe_format_xlml(cell/*:Cell*/, nf, o) { argument
17955 if(cell.t === 'z') return;
17957 if(cell.t === 'e') { cell.w = cell.w || BErr[cell.v]; }
17959 if(cell.t === 'n') {
17960 if((cell.v|0) === cell.v) cell.w = cell.v.toString(10);
17961 else cell.w = SSF_general_num(cell.v);
17963 else cell.w = SSF_general(cell.v);
17965 else cell.w = xlml_format(nf||"General", cell.v);
17969 if(o.cellNF) cell.z = z;
17970 if(o.cellDates && cell.t == 'n' && fmt_is_date(z)) {
17971 …var _d = SSF_parse_date_code(cell.v); if(_d) { cell.t = 'd'; cell.v = new Date(_d.y, _d.m-1,_d.d,_…
17987 function parse_xlml_data(xml, ss, data, cell/*:any*/, base, styles, csty, row, arrayf, o) { argument
17988 var nf = "General", sid = cell.StyleID, S = {}; o = o || {};
18001 cell.t = 'b';
18002 cell.v = parsexmlbool(xml);
18005 cell.t = 's'; cell.r = xlml_fixstr(unescapexml(xml));
18006cell.v = (xml.indexOf("<") > -1 ? unescapexml(ss||xml).replace(/<.*?>/g, "") : cell.r); // todo: B…
18010 cell.v = (parseDate(xml) - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
18011 if(cell.v !== cell.v) cell.v = unescapexml(xml);
18012 else if(cell.v<60) cell.v = cell.v -1;
18016 if(cell.v === undefined) cell.v=+xml;
18017 if(!cell.t) cell.t = 'n';
18019 case 'Error': cell.t = 'e'; cell.v = RBErr[xml]; if(o.cellText !== false) cell.w = xml; break;
18021 if(xml == "" && ss == "") { cell.t = 'z'; }
18022 else { cell.t = 's'; cell.v = xlml_fixstr(ss||xml); }
18025 safe_format_xlml(cell, nf, o);
18027 if(cell.Formula) {
18028 var fstr = unescapexml(cell.Formula);
18031 cell.f = rc_to_a1(fstr, base);
18032 delete cell.Formula;
18033 if(cell.ArrayRange == "RC") cell.F = rc_to_a1("RC:RC", base);
18034 else if(cell.ArrayRange) {
18035 cell.F = rc_to_a1(cell.ArrayRange, base);
18036 arrayf.push([safe_decode_range(cell.F), cell.F]);
18042 cell.F = arrayf[i][1];
18049 cell.s = S;
18051 if(cell.StyleID !== undefined) cell.ixfe = cell.StyleID;
18103 var cell = ({}/*:any*/), row = {};// eslint-disable-line no-unused-vars variable
18127 …ndex), ss, dtag, state[state.length-1][0]==/*"Comment"*/"comment"?comment:cell, {c:c,r:r}, styles,…
18130 case 'cell' /*case 'Cell'*/:
18132 if(comments.length > 0) cell.c = comments;
18133 if((!opts.sheetRows || opts.sheetRows > r) && cell.v !== void 0) {
18136 cursheet[r][c] = cell;
18137 } else cursheet[encode_col(c) + encode_row(r)] = cell;
18139 if(cell.HRef) {
18140 cell.l = ({Target:unescapexml(cell.HRef)}/*:any*/);
18141 if(cell.HRefScreenTip) cell.l.Tooltip = cell.HRefScreenTip;
18142 delete cell.HRef; delete cell.HRefScreenTip;
18144 if(cell.MergeAcross || cell.MergeDown) {
18145 cc = c + (parseInt(cell.MergeAcross,10)|0);
18146 rr = r + (parseInt(cell.MergeDown,10)|0);
18149 if(!opts.sheetStubs) { if(cell.MergeAcross) c = cc + 1; else ++c; }
18150 else if(cell.MergeAcross || cell.MergeDown) {
18166 cell = xlml_parsexmltagobj(Rn[0]);
18167 if(cell.Index) c = +cell.Index - 1;
19004 function write_ws_xlml_cell(cell, ref/*:string*/, ws, opts, idx/*:number*/, wb, addr)/*:string*/{ argument
19005 if(!cell || (cell.v == undefined && cell.f == undefined)) return "";
19008 if(cell.f) attr["ss:Formula"] = "=" + escapexml(a1_to_rc(cell.f, addr));
19009 if(cell.F && cell.F.slice(0, ref.length) == ref) {
19010 var end = decode_cell(cell.F.slice(ref.length + 1));
19014 if(cell.l && cell.l.Target) {
19015 attr["ss:HRef"] = escapexml(cell.l.Target);
19016 if(cell.l.Tooltip) attr["x:HRefScreenTip"] = escapexml(cell.l.Tooltip);
19029 switch(cell.t) {
19031 case 'n': t = 'Number'; p = String(cell.v); break;
19032 case 'b': t = 'Boolean'; p = (cell.v ? "1" : "0"); break;
19033 case 'e': t = 'Error'; p = BErr[cell.v]; break;
19034 …case 'd': t = 'DateTime'; p = new Date(cell.v).toISOString(); if(cell.z == null) cell.z = cell.z |…
19035 case 's': t = 'String'; p = escapexlml(cell.v||""); break;
19037 /* TODO: cell style */
19038 var os = get_cell_style(opts.cellXfs, cell, opts);
19041 var _v = (cell.v != null ? p : "");
19042 var m = cell.t == 'z' ? "" : ('<Data ss:Type="' + t + '">' + _v + '</Data>');
19044 if((cell.c||[]).length > 0) m += write_ws_xlml_comment(cell.c);
19087 var ref = encode_cell(addr), cell = dense ? (ws[R]||[])[C] : ws[ref];
19088 row.push(write_ws_xlml_cell(cell, ref, ws, opts, idx, wb, addr));
19269 var process_cell_style = function pcs(cell, line/*:any*/, options) { argument
19278 var addcell = function addcell(cell/*:any*/, line/*:any*/, options/*:any*/) { argument
19280 if(options.sheetRows && cell.r >= options.sheetRows) return;
19281 if(options.cellStyles && line.XF && line.XF.data) process_cell_style(cell, line, options);
19283 lastcell = cell;
19284 last_cell = encode_cell(cell);
19286 if(cell.r < range.s.r) range.s.r = cell.r;
19287 if(cell.c < range.s.c) range.s.c = cell.c;
19288 if(cell.r + 1 > range.e.r) range.e.r = cell.r + 1;
19289 if(cell.c + 1 > range.e.c) range.e.c = cell.c + 1;
19292 if(arrayf[afi][0].s.c > cell.c || arrayf[afi][0].s.r > cell.r) continue;
19293 if(arrayf[afi][0].e.c < cell.c || arrayf[afi][0].e.r < cell.r) continue;
19295 if(arrayf[afi][0].s.c != cell.c || arrayf[afi][0].s.r != cell.r) delete line.f;
19296 if(line.f) line.f = "" + stringify_formula(arrayf[afi][1], range, cell, supbooks, opts);
19302 if(!out[cell.r]) out[cell.r] = [];
19303 out[cell.r][cell.c] = line;
19541 temp_val = make_cell(val.val, val.cell.ixfe, val.tt);
19548 … if(sharedf[_fe]) temp_val.f = ""+stringify_formula(val.formula,range,val.cell,supbooks, opts);
19550 } else temp_val.f = ""+stringify_formula(val.formula,range,val.cell,supbooks, opts);
19554 addcell(val.cell, temp_val, options);
19560 temp_val = make_cell(val, last_formula.cell.ixfe, 's');
19563 … temp_val.f = ""+stringify_formula(last_formula.formula, range, last_formula.cell, supbooks, opts);
19567 addcell(last_formula.cell, temp_val, options);
19587 sharedf[encode_cell(last_formula.cell)]= val[0];
19588 …cc = options.dense ? (out[last_formula.cell.r]||[])[last_formula.cell.c] : out[encode_cell(last_fo…
21199 /*::[*/0x0072/*::]*/: { /* n:"", */ }, // includes selected cell
21262 function write_ws_biff2_cell(ba/*:BufArray*/, cell/*:Cell*/, R/*:number*/, C/*:number*//*::, opts*/… argument
21263 if(cell.v != null) switch(cell.t) {
21265 var v = cell.t == 'd' ? datenum(parseDate(cell.v)) : cell.v;
21271 case 'b': case 'e': write_biff_rec(ba, 0x0005, write_BIFF2BERR(R, C, cell.v, cell.t)); return;
21274 …write_biff_rec(ba, 0x0004, write_BIFF2LABEL(R, C, cell.v == null ? "" : String(cell.v).slice(0,255…
21294 var cell = dense ? (ws[R]||[])[C] : ws[ref];
21295 if(!cell) continue;
21296 /* write cell */
21297 write_ws_biff2_cell(ba, cell, R, C, opts);
21379 function write_ws_biff8_cell(ba/*:BufArray*/, cell/*:Cell*/, R/*:number*/, C/*:number*/, opts) { argument
21380 var os = 16 + get_cell_style(opts.cellXfs, cell, opts);
21381 if(cell.v == null && !cell.bf) {
21385 if(cell.bf) write_biff_rec(ba, 0x0006 /* Formula */, write_Formula(cell, R, C, opts, os));
21386 else switch(cell.t) {
21388 var v = cell.t == 'd' ? datenum(parseDate(cell.v)) : cell.v;
21393 write_biff_rec(ba, 0x0205 /* BoolErr */, write_BoolErr(R, C, cell.v, os, opts, cell.t));
21398 var isst = get_sst_id(opts.Strings, cell.v == null ? "" : String(cell.v), opts.revStrings);
21400 …e write_biff_rec(ba, 0x0204 /* Label */, write_Label(R, C, (cell.v == null ? "" : String(cell.v)).…
21454 var cell = dense ? (ws[R]||[])[C] : ws[ref];
21455 if(!cell) continue;
21456 /* write cell */
21457 write_ws_biff8_cell(ba, cell, R, C, opts);
21458 if(b8 && cell.l) ws['!links'].push([ref, cell.l]);
21459 if(b8 && cell.c) comments.push([ref, cell.c]);
21629 var cell = cells[j].trim();
21630 if(!cell.match(/<t[dh]/i)) continue;
21631 var m = cell, cc = 0;
21638 var tag = parsexmltag(cell.slice(0, cell.indexOf(">")));
21681 var cell = o.dense ? (ws[R]||[])[C] : ws[coord]; variable
21683 …var w = (cell && cell.v != null) && (cell.h || escapehtml(cell.w || (format_cell(cell), cell.w) ||…
21688 else if(cell) {
21689 sp["data-t"] = cell && cell.t || 'z';
21690 if(cell.v != null) sp["data-v"] = cell.v;
21691 if(cell.z != null) sp["data-z"] = cell.z;
21692 …if(cell.l && (cell.l.Target || "#").charAt(0) != "#") w = '<a href="' + cell.l.Target +'">' + w + …
22159 case 'covered-table-cell': // 9.1.5 <table:covered-table-cell>
22167 case 'table-cell': case '数据':
22275 break; // 9.1.4 <table:table-cell>
22357 …if(styletag["family"] == "table-cell" && number_format_map[styletag["data-style-name"]]) styles[st…
22366 case 'table-cell-properties': break; // 17.18 <style:table-cell-properties>
22401 _Ref = ods_to_csf_3D(tag['cell-range-address']);
22534 case 'cell-range-source': break; // 9.3.1 <table:
22541 case 'source-cell-range': // 9.6.5
22822 "table:cell-range-address": odsref,
22823 "table:base-cell-address": odsref.replace(/[\.]?[^\.]*$/, ".$A$1")
22837 var null_cell_xml = ' <table:table-cell />\n';
22838 var covered_cell_xml = ' <table:covered-table-cell/>\n';
22871 var ref = encode_cell({r:R, c:C}), cell = dense ? (ws[R]||[])[C]: ws[ref];
22872 if(cell && cell.f) {
22873 ct['table:formula'] = escapexml(csf_to_ods_formula(cell.f));
22874 if(cell.F) {
22875 if(cell.F.slice(0, ref.length) == ref) {
22876 var _Fref = decode_range(cell.F);
22882 if(!cell) { o.push(null_cell_xml); continue; }
22883 switch(cell.t) {
22885 textp = (cell.v ? 'TRUE' : 'FALSE');
22887 ct['office:boolean-value'] = (cell.v ? 'true' : 'false');
22890 textp = (cell.w||String(cell.v||0));
22892 ct['office:value'] = (cell.v||0);
22895 textp = cell.v == null ? "" : cell.v;
22899 textp = (cell.w||(parseDate(cell.v).toISOString()));
22901 ct['office:date-value'] = (parseDate(cell.v).toISOString());
22908 if(cell.l && cell.l.Target) {
22909 var _tgt = cell.l.Target;
22915 if(nfs[cell.z]) ct["table:style-name"] = "ce" + nfs[cell.z].slice(1);
22916 … o.push(' ' + writextag('table:table-cell', writextag('text:p', text_p, {}), ct) + '\n');
22991 …o.push(' <style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default…
22993 …o.push('<style:style style:name="ce' + nfs[nf].slice(1) + '" style:family="table-cell" style:paren…
23059 …gs table:case-sensitive="false" table:search-criteria-must-apply-to-whole-cell="true" table:use-wi…
23577 function numbers_format_cell(cell, t, flags, ofmt, nfmt) { argument
23582 if (flags & (ver > 4 ? 8 : 4) && cell.t == "n" && ctype == 7) {
23589 var d = cell.v, dd = d;
23685 cell.w = dstr.join(dstyle == 0 ? ":" : " ");
23686 cell.z = zstr.join(dstyle == 0 ? '":"' : " ");
23688 cell.w = cell.w.replace(/:(\d\d\d)$/, ".$1");
23754 throw new Error("Unsupported cell type ".concat(buf[subarray](0, 4)));
23758 throw new Error("Unsupported cell type ".concat(buf[subarray](0, 4)));
23822 …throw new Error("Unsupported cell type ".concat(buf[1], " : ").concat(fields & 31, " : ").concat(b…
23836 function write_new_storage(cell, sst) { argument
23839 switch (cell.t) {
23842 writeDecimal128LE(out, l, cell.v);
23848 dv.setFloat64(l, cell.v ? 1 : 0, true);
23853 var s = cell.v == null ? "" : String(cell.v);
23863 throw "unsupported cell type " + cell.t;
23868 function write_old_storage(cell, sst) { argument
23871 switch (cell.t) {
23874 dv.setFloat64(l, cell.v, true);
23880 dv.setFloat64(l, cell.v ? 1 : 0, true);
23885 var s = cell.v == null ? "" : String(cell.v);
23895 throw "unsupported cell type " + cell.t;
23991 throw "NUMBERS Tile missing ".concat(type, " cell storage");
24027 x.cells.forEach(function(cell, C) { argument
24029 throw new Error("Duplicate cell r=".concat(x.R, " c=").concat(C));
24030 acc[x.R][C] = cell;
25035 ['cellNF', false], /* emit cell number format string as .z */
26213 var cell/*:Cell*/ = dense ? ROW[_C + C] : ws[ref];
26223 z = (cell != null && cell.z && fmt_is_date(cell.z)) ? cell.z : (o.dateNF || table_fmt[14]);
26226 if(!cell) {
26227 if(!dense) ws[ref] = cell = ({t:t, v:v}/*:any*/);
26228 else ROW[_C + C] = cell = ({t:t, v:v}/*:any*/);
26230 cell.t = t; cell.v = v;
26231 delete cell.w; delete cell.R;
26232 if(z) cell.z = z;
26234 if(z) cell.z = z;
26250 /* get cell, creating a stub if necessary */
26252 /* A1 cell address */
26262 /* cell address object */
26322 function cell_set_number_format(cell/*:Cell*/, fmt/*:string|number*/) { argument
26323 cell.z = fmt;
26324 return cell;
26327 /* set cell hyperlink */
26328 function cell_set_hyperlink(cell/*:Cell*/, target/*:string*/, tooltip/*:?string*/) { argument
26330 delete cell.l;
26332 cell.l = ({ Target: target }/*:Hyperlink*/);
26333 if(tooltip) cell.l.Tooltip = tooltip;
26335 return cell;
26337 function cell_set_internal_link(cell/*:Cell*/, range/*:string*/, tooltip/*:?string*/) { return cell… argument
26339 /* add to cell comments */
26340 function cell_add_comment(cell/*:Cell*/, text/*:string*/, author/*:?string*/) { argument
26341 if(!cell.c) cell.c = [];
26342 cell.c.push({t:text, a:author||"SheetJS"});
26350 var cell = ws_get_cell_stub(ws, R, C);
26351 cell.t = 'n';
26352 cell.F = rngstr;
26353 delete cell.v;
26355 cell.f = formula;
26356 if(dynamic) cell.D = true;