|
|
@ -779,17 +779,10 @@ public class GridUI extends ComponentUI { |
|
|
|
|
|
|
|
|
|
|
|
private void paintGridSelectionForFormula(Graphics2D g2d, ElementCase report, CellSelection cs) { |
|
|
|
private void paintGridSelectionForFormula(Graphics2D g2d, ElementCase report, CellSelection cs) { |
|
|
|
// denny: 标记公式用到的单元格
|
|
|
|
// denny: 标记公式用到的单元格
|
|
|
|
if (report.getCellValue(cs.getColumn(), cs.getRow()) instanceof BaseFormula) { |
|
|
|
Object cellValue = report.getCellValue(cs.getColumn(), cs.getRow()); |
|
|
|
BaseFormula tmpFormula = (BaseFormula) report |
|
|
|
if (cellValue instanceof BaseFormula) { |
|
|
|
.getCellValue(cs.getColumn(), cs.getRow()); |
|
|
|
BaseFormula tmpFormula = (BaseFormula) cellValue; |
|
|
|
String statement = tmpFormula.getContent(); |
|
|
|
ColumnRow[] columnRowArray = tmpFormula.getRelatedColumnRows(); |
|
|
|
// denny: 获得公式中包含的所有单元格
|
|
|
|
|
|
|
|
ColumnRow[] columnRowArray = new ColumnRow[0]; |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
columnRowArray = CalculatorUtils.relatedColumnRowArray(statement.substring(1)); |
|
|
|
|
|
|
|
} catch (ANTLRException ae) { |
|
|
|
|
|
|
|
// do nothing.
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Area formulaCellArea = null; |
|
|
|
Area formulaCellArea = null; |
|
|
|
for (int i = 0; i < columnRowArray.length; i++) { |
|
|
|
for (int i = 0; i < columnRowArray.length; i++) { |
|
|
|
ColumnRow columnRow = columnRowArray[i]; |
|
|
|
ColumnRow columnRow = columnRowArray[i]; |
|
|
|