@@ -5458,6 +5458,10 @@ function process_col(coll/*:ColInfo*/) {
5458
5458
if(coll.customWidth) delete coll.customWidth;
5459
5459
}
5460
5460
5461
+ var DEF_DPI = 96, DPI = DEF_DPI;
5462
+ function px2pt(px) { return px * 72 / DPI; }
5463
+ function pt2px(pt) { return pt * DPI / 72; }
5464
+
5461
5465
/* [MS-EXSPXML3] 2.4.54 ST_enmPattern */
5462
5466
var XLMLPatternTypeMap = {
5463
5467
"None": "none",
@@ -9193,7 +9197,7 @@ return function parse_ws_xml_data(sdata, s, opts, guess, themes, styles) {
9193
9197
}; })();
9194
9198
9195
9199
function write_ws_xml_data(ws/*:Worksheet*/, opts, idx/*:number*/, wb/*:Workbook*/, rels)/*:string*/ {
9196
- var o = [], r = [], range = safe_decode_range(ws['!ref']), cell, ref, rr = "", cols = [], R=0, C=0;
9200
+ var o = [], r = [], range = safe_decode_range(ws['!ref']), cell, ref, rr = "", cols = [], R=0, C=0, rows = ws['!rows'] ;
9197
9201
for(C = range.s.c; C <= range.e.c; ++C) cols[C] = encode_col(C);
9198
9202
for(R = range.s.r; R <= range.e.r; ++R) {
9199
9203
r = [];
@@ -9203,7 +9207,18 @@ function write_ws_xml_data(ws/*:Worksheet*/, opts, idx/*:number*/, wb/*:Workbook
9203
9207
if(ws[ref] === undefined) continue;
9204
9208
if((cell = write_ws_xml_cell(ws[ref], ref, ws, opts, idx, wb)) != null) r.push(cell);
9205
9209
}
9206
- if(r.length > 0) o[o.length] = (writextag('row', r.join(""), {r:rr}));
9210
+ if(r.length > 0) {
9211
+ var params = {r:rr}
9212
+ if(rows && rows[R]) {
9213
+ var row = rows[R];
9214
+ if(row.hidden) params.hidden = 1;
9215
+ var height = -1;
9216
+ if (row.hpx) height = px2pt(row.hpx);
9217
+ else if (row.hpt) height = row.hpt;
9218
+ if (height > -1) { params.ht = height; params.customHeight = 1; }
9219
+ }
9220
+ o[o.length] = (writextag('row', r.join(""), params));
9221
+ }
9207
9222
}
9208
9223
return o.join("");
9209
9224
}
@@ -9225,7 +9240,7 @@ function write_ws_xml(idx/*:number*/, opts, wb/*:Workbook*/, rels)/*:string*/ {
9225
9240
o[o.length] = (writextag('dimension', null, {'ref': ref}));
9226
9241
9227
9242
/* TODO: store in WB, process styles */
9228
- if(opts.sheetFormat) o[o.length] = (writextag('sheetFormatPr', null, {defaultRowHeight:opts.sheetFormat.defaultRowHeight||'16', baseColWidth:opts.sheetFormat.baseColWidth||'10' }))
9243
+ if(opts.sheetFormat) o[o.length] = (writextag('sheetFormatPr', null, {defaultRowHeight:opts.sheetFormat.defaultRowHeight||'16', baseColWidth:opts.sheetFormat.baseColWidth||'10' }));
9229
9244
9230
9245
if(ws['!cols'] !== undefined && ws['!cols'].length > 0) o[o.length] = (write_ws_xml_cols(ws, ws['!cols']));
9231
9246
o[sidx = o.length] = '<sheetData/>';
0 commit comments