From d062899bf7f024f870cf37eff66b5479d96cfb04 Mon Sep 17 00:00:00 2001 From: Hoky <303455184@qq.com> Date: Thu, 30 Dec 2021 17:00:08 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-65192=20=E5=85=AC=E5=BC=8F=E5=90=88?= =?UTF-8?q?=E6=B3=95=E6=80=A7=E6=A3=80=E6=B5=8B=E9=94=99=E8=AF=AF=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=BD=8D=E7=BD=AE=E8=BF=94=E5=9B=9E=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=201.=E5=A6=82=E6=9E=9C=E8=BF=94=E5=9B=9E=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BD=8D=E7=BD=AE=EF=BC=8C=E5=88=99=E6=A8=A1=E7=B3=8A?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/formula/FormulaPane.java | 10 +++++++--- .../exception/function/FormulaCheckWrongFunction.java | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index 74bf3fe76f..904cdf00b0 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -867,8 +867,12 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { if (checkResult.isValid()) { showMessageDialog(checkResult.getTips(), checkResult.isValid()); } else { - String position = Toolkit.i18nText("Fine-Design_Basic_Formula_The") + (checkResult.getFormulaCoordinates().getColumns()) - + Toolkit.i18nText("Fine-Design_Basic_Formula_Error_Position") + " "; + int columns = checkResult.getFormulaCoordinates().getColumns(); + String position = StringUtils.EMPTY; + if (columns >= 0) { + position = Toolkit.i18nText("Fine-Design_Basic_Formula_The") + columns + + Toolkit.i18nText("Fine-Design_Basic_Formula_Error_Position") + " "; + } int confirmDialog = FineJOptionPane.showConfirmDialog( FormulaPane.this, position + messageTips, @@ -879,7 +883,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { new String[]{Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Result"), Toolkit.i18nText("Fine-Design_Basic_Formula_Continue")}, Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Result")); if (confirmDialog == 0) { - formulaTextArea.setCaretPosition(checkResult.getFormulaCoordinates().getColumns()); + formulaTextArea.setCaretPosition(Math.max(columns, 0)); formulaTextArea.requestFocus(); return false; } diff --git a/designer-base/src/main/java/com/fr/design/formula/exception/function/FormulaCheckWrongFunction.java b/designer-base/src/main/java/com/fr/design/formula/exception/function/FormulaCheckWrongFunction.java index 5328ca56ef..417e9b37a6 100644 --- a/designer-base/src/main/java/com/fr/design/formula/exception/function/FormulaCheckWrongFunction.java +++ b/designer-base/src/main/java/com/fr/design/formula/exception/function/FormulaCheckWrongFunction.java @@ -74,7 +74,7 @@ public class FormulaCheckWrongFunction implements Function