Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle !rows array #188

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions bits/45_styutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ function find_mdw(collw, coll) {
if(MDW === MAX_MDW) MDW = DEF_MDW;
}
}

function px2pt(px) { return px * 72 / 96; }
14 changes: 13 additions & 1 deletion bits/67_wsxml.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,19 @@ function write_ws_xml_data(ws, opts, idx, wb) {
if(ws[ref] === undefined) continue;
if((cell = write_ws_xml_cell(ws[ref], ref, ws, opts, idx, wb)) != null) r.push(cell);
}
if(r.length > 0) o[o.length] = (writextag('row', r.join(""), {r:rr}));
if(r.length > 0) {
// 18.3.1.73 row
var params = {r:rr};
if(typeof ws['!rows'] !== 'undefined' && ws['!rows'].length > R) {
var row = ws['!rows'][R];
if (row.hidden) params.hidden = 1;
var height = -1;
if (row.hpx) height = px2pt(row.hpx);
else if (row.hpt) height = row.hpt;
if (height > -1) { params.ht = height; params.customHeight = 1; }
};
o[o.length] = (writextag('row', r.join(""), params));
}
}
return o.join("");
}
Expand Down