From e4451a865a930cec2e9e034e5c3a3a43dc92d02b Mon Sep 17 00:00:00 2001 From: RichieJi Date: Thu, 14 Dec 2017 09:54:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E7=82=B9=E5=B0=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/grid/GridUI.java | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/designer/src/com/fr/grid/GridUI.java b/designer/src/com/fr/grid/GridUI.java index 2215fc2b79..9a972db7b1 100644 --- a/designer/src/com/fr/grid/GridUI.java +++ b/designer/src/com/fr/grid/GridUI.java @@ -779,17 +779,10 @@ public class GridUI extends ComponentUI { private void paintGridSelectionForFormula(Graphics2D g2d, ElementCase report, CellSelection cs) { // denny: 标记公式用到的单元格 - if (report.getCellValue(cs.getColumn(), cs.getRow()) instanceof BaseFormula) { - BaseFormula tmpFormula = (BaseFormula) report - .getCellValue(cs.getColumn(), cs.getRow()); - String statement = tmpFormula.getContent(); - // denny: 获得公式中包含的所有单元格 - ColumnRow[] columnRowArray = new ColumnRow[0]; - try { - columnRowArray = CalculatorUtils.relatedColumnRowArray(statement.substring(1)); - } catch (ANTLRException ae) { - // do nothing. - } + Object cellValue = report.getCellValue(cs.getColumn(), cs.getRow()); + if (cellValue instanceof BaseFormula) { + BaseFormula tmpFormula = (BaseFormula) cellValue; + ColumnRow[] columnRowArray = tmpFormula.getRelatedColumnRows(); Area formulaCellArea = null; for (int i = 0; i < columnRowArray.length; i++) { ColumnRow columnRow = columnRowArray[i];