From 0b5471cc7044018bff293aedb3cb9a5bc439d77a Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 23 Jun 2020 14:00:10 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-34091=20=E6=B7=BB=E5=8A=A0=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cellquick/CellFormulaQuickEditor.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java index aa2fe06623..5c31edd077 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java @@ -106,10 +106,15 @@ public class CellFormulaQuickEditor extends CellQuickEditor { formulaButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { final UIFormula formulaPane = FormulaFactory.createFormulaPaneWhenReserveFormula(); - CellSelection cellSelection = (CellSelection)tc.getSelection(); - editingCellElement = tc.getEditingElementCase().getTemplateCellElement(cellSelection.getColumn(),cellSelection.getRow()); - BaseFormula baseFormula = (BaseFormula) editingCellElement.getValue(); - formulaPane.populate(baseFormula); + CellSelection cellSelection = (CellSelection) tc.getSelection(); + editingCellElement = tc.getEditingElementCase().getTemplateCellElement(cellSelection.getColumn(), cellSelection.getRow()); + Object object = editingCellElement.getValue(); + if (object instanceof BaseFormula) { + formulaPane.populate((BaseFormula) object); + } else { + String text = formulaTextField.getText(); + formulaPane.populate(BaseFormula.createFormulaBuilder().build(text)); + } formulaPane.showLargeWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() {