From 1ab541f0a62735f5f531b17f6c85f6095166ee4b Mon Sep 17 00:00:00 2001 From: RichieJi Date: Wed, 13 Dec 2017 14:26:08 +0800 Subject: [PATCH] =?UTF-8?q?=20=E5=88=87=E6=8D=A2=E7=9A=84=E4=B8=80?= =?UTF-8?q?=E4=B8=AAbUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/quickeditor/cellquick/CellFormulaQuickEditor.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java index 96f92d58b5..246f7599c0 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java @@ -46,6 +46,7 @@ import java.awt.event.KeyEvent; public class CellFormulaQuickEditor extends CellQuickEditor { //文本域 private UITextField formulaTextField; + private BaseFormula formula; //编辑状态 private boolean isEditing = false; @@ -104,11 +105,15 @@ public class CellFormulaQuickEditor extends CellQuickEditor { public void actionPerformed(ActionEvent evt) { String text = formulaTextField.getText(); final UIFormula formulaPane = FormulaFactory.createFormulaPane(); - formulaPane.populate(BaseFormula.createFormulaBuilder().build(text)); + if (formula != null) { + formula.setContent(text); + } + formulaPane.populate(formula); formulaPane.showLargeWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { BaseFormula fm = formulaPane.update(); + formula = fm; if (fm.getContent().length() <= 1) { formulaTextField.setText(DEFAULT_FORMULA); } else { @@ -181,7 +186,7 @@ public class CellFormulaQuickEditor extends CellQuickEditor { if (value == null) { str = StringUtils.EMPTY; } else if (value instanceof BaseFormula) { - BaseFormula formula = (BaseFormula) value; + formula = (BaseFormula) value; str = formula.getContent(); reserveInResult = formula.isReserveInResult(); reserveOnWriteOrAnaly = formula.isReserveOnWriteOrAnaly();