From 6fc353d1ff7bdc532f24f29789c81b1a5de97799 Mon Sep 17 00:00:00 2001 From: flowerField Date: Wed, 27 Jan 2021 15:10:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix=20=E5=8D=95=E5=85=83=E6=A0=BC=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E8=AE=A1=E7=AE=97=E5=BC=95=E7=94=A8=E8=87=AA=E5=B7=B1?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/menuButton.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/controllers/menuButton.js b/src/controllers/menuButton.js index f6c50f6..820bb10 100644 --- a/src/controllers/menuButton.js +++ b/src/controllers/menuButton.js @@ -4226,23 +4226,25 @@ const menuButton = { let cell = null; if(type == "c"){ - cell = d[ed_m][fix]; + cell = d[ed_m + 1][fix]; } else{ - cell = d[fix][ed_m]; + cell = d[fix][ed_m + 1]; } + /* 备注:在搜寻的时候排除自己以解决单元格函数引用自己的问题 */ if(cell != null && cell.v != null && cell.v.toString().length > 0){ - let c = ed_m; + let c = ed_m + 1; if(type == "c"){ - cell = d[ed_m][fix]; + cell = d[ed_m + 1][fix]; } else{ - cell = d[fix][ed_m]; + cell = d[fix][ed_m + 1]; } while ( cell != null && cell.v != null && cell.v.toString().length > 0) { + c++; let len = null; @@ -4274,10 +4276,10 @@ const menuButton = { } else{ if(type == "c"){ - _this.backFormulaInput(d, ed_m, fix, [st_m, ed_m], [fix ,fix], formula); + _this.backFormulaInput(d, ed_m + 1, fix, [st_m, ed_m], [fix ,fix], formula); } else{ - _this.backFormulaInput(d, fix, ed_m, [fix ,fix], [st_m, ed_m], formula); + _this.backFormulaInput(d, fix, ed_m + 1, [fix ,fix], [st_m, ed_m], formula); } } } From 1512aa8c4cf37547856daacf12750fe6df00daf7 Mon Sep 17 00:00:00 2001 From: flowerField Date: Wed, 27 Jan 2021 15:24:49 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E5=8F=B3=E5=AF=B9=E9=BD=90=20&&=20=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E4=B8=BA0=E6=97=B6=E5=AD=98=E5=9C=A8=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/global/format.js | 4 +++- src/global/setdata.js | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/global/format.js b/src/global/format.js index c7e653f..7fdcefd 100644 --- a/src/global/format.js +++ b/src/global/format.js @@ -934,6 +934,7 @@ var make_ssf = function make_ssf(SSF) { SSF.is_date = fmt_is_date; function eval_fmt(fmt, v, opts, flen) { + let tempV = v; var out = [], o = "", i = 0, @@ -1350,7 +1351,8 @@ var make_ssf = function make_ssf(SSF) { out[i].v = write_num(out[i].t, out[i].v, myv); out[i].t = 't'; } - var retval = ""; + // var retval = ""; + var retval = tempV === 0 ? "0" : ""; for (i = 0; i !== out.length; ++i) if (out[i] != null) retval += out[i].v; return retval; diff --git a/src/global/setdata.js b/src/global/setdata.js index accc31f..d93fd73 100644 --- a/src/global/setdata.js +++ b/src/global/setdata.js @@ -150,6 +150,9 @@ function setcellvalue(r, c, d, v) { // cell.m = mask[0].toString(); } } + + /* 如果是公式计算之后得到的结果:总是设置对齐方式为右对齐 */ + cell.ht = cell.ht || 2; } else if(cell.ct != null && cell.ct.fa == "@"){ cell.m = vupdateStr;