From 760c55d533b05f60c3fa3290e8b468f00f974a45 Mon Sep 17 00:00:00 2001 From: ThomasChan Date: Thu, 19 Sep 2019 20:26:56 +0800 Subject: [PATCH] improve parse_dom_table merge cell logic performance --- xlsx.flow.js | 2 +- xlsx.js | 2 +- xlsx.mini.flow.js | 2 +- xlsx.mini.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xlsx.flow.js b/xlsx.flow.js index 18e3d81..5dd0e1c 100644 --- a/xlsx.flow.js +++ b/xlsx.flow.js @@ -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) { diff --git a/xlsx.js b/xlsx.js index 004bf20..0344342 100644 --- a/xlsx.js +++ b/xlsx.js @@ -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) { diff --git a/xlsx.mini.flow.js b/xlsx.mini.flow.js index 3fb78c6..b8f9bad 100644 --- a/xlsx.mini.flow.js +++ b/xlsx.mini.flow.js @@ -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) { diff --git a/xlsx.mini.js b/xlsx.mini.js index 18e0617..5389244 100644 --- a/xlsx.mini.js +++ b/xlsx.mini.js @@ -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) {