improve parse_dom_table merge cell logic performance

This commit is contained in:
ThomasChan 2019-09-19 20:26:56 +08:00
parent eafc07926b
commit 760c55d533
4 changed files with 4 additions and 4 deletions

@ -19188,7 +19188,7 @@ function parse_dom_table(table/*:HTMLElement*/, _opts/*:?any*/)/*:Worksheet*/ {
}
/* TODO: figure out how to extract nonstandard mso- style */
CS = +elt.colSpan || 1;
if((RS = +elt.rowSpan)>0 || CS>1) merges.push({s:{r:R,c:C},e:{r:R + (RS||1) - 1, c:C + CS - 1}});
if((RS = +elt.rowSpan)>1 || CS>1) merges.push({s:{r:R,c:C},e:{r:R + (RS||1) - 1, c:C + CS - 1}});
o/*:Cell*/ = {t:'s', v:v};
_t/*:string*/ = elt.getAttribute("t") || "";
if(v != null) {

2
xlsx.js generated

@ -19072,7 +19072,7 @@ function parse_dom_table(table, _opts) {
}
/* TODO: figure out how to extract nonstandard mso- style */
CS = +elt.colSpan || 1;
if((RS = +elt.rowSpan)>0 || CS>1) merges.push({s:{r:R,c:C},e:{r:R + (RS||1) - 1, c:C + CS - 1}});
if((RS = +elt.rowSpan)>1 || CS>1) merges.push({s:{r:R,c:C},e:{r:R + (RS||1) - 1, c:C + CS - 1}});
o = {t:'s', v:v};
_t = elt.getAttribute("t") || "";
if(v != null) {

@ -7407,7 +7407,7 @@ function parse_dom_table(table/*:HTMLElement*/, _opts/*:?any*/)/*:Worksheet*/ {
}
/* TODO: figure out how to extract nonstandard mso- style */
CS = +elt.colSpan || 1;
if((RS = +elt.rowSpan)>0 || CS>1) merges.push({s:{r:R,c:C},e:{r:R + (RS||1) - 1, c:C + CS - 1}});
if((RS = +elt.rowSpan)>1 || CS>1) merges.push({s:{r:R,c:C},e:{r:R + (RS||1) - 1, c:C + CS - 1}});
o/*:Cell*/ = {t:'s', v:v};
_t/*:string*/ = elt.getAttribute("t") || "";
if(v != null) {

@ -7316,7 +7316,7 @@ function parse_dom_table(table, _opts) {
}
/* TODO: figure out how to extract nonstandard mso- style */
CS = +elt.colSpan || 1;
if((RS = +elt.rowSpan)>0 || CS>1) merges.push({s:{r:R,c:C},e:{r:R + (RS||1) - 1, c:C + CS - 1}});
if((RS = +elt.rowSpan)>1 || CS>1) merges.push({s:{r:R,c:C},e:{r:R + (RS||1) - 1, c:C + CS - 1}});
o = {t:'s', v:v};
_t = elt.getAttribute("t") || "";
if(v != null) {