Browse Source

Pull request #7402: KERNEL-9928 重构水印加载 && REPORT-65192

Merge in DESIGN/design from ~HOKY.HE/design-hoky:release/11.0 to release/11.0

* commit 'd062899bf7f024f870cf37eff66b5479d96cfb04':
  REPORT-65192 公式合法性检测错误字符位置返回不正确 1.如果返回错误位置,则模糊处理
  KERNEL-9928 重构水印加载 1.改成常量
bugfix/11.0
Hoky.He 3 years ago
parent
commit
f32b0cc67d
  1. 10
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java
  2. 2
      designer-base/src/main/java/com/fr/design/formula/exception/function/FormulaCheckWrongFunction.java
  3. 3
      designer-base/src/main/java/com/fr/design/report/WatermarkSettingPane.java

10
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;
}

2
designer-base/src/main/java/com/fr/design/formula/exception/function/FormulaCheckWrongFunction.java

@ -74,7 +74,7 @@ public class FormulaCheckWrongFunction implements Function<Exception, FormulaChe
invalidFormula = invalidFormula.substring(0, invalidFormula.indexOf(","));
}
int index = formulaText.indexOf(invalidFormula);
return Math.max(index, 0);
return index;
}
}

3
designer-base/src/main/java/com/fr/design/report/WatermarkSettingPane.java

@ -1,5 +1,6 @@
package com.fr.design.report;
import com.fr.base.iofile.attr.WaterMarkProvideConstant;
import com.fr.base.iofile.attr.WatermarkAttr;
import com.fr.design.dialog.AbstractTemplateServerSettingPane;
import com.fr.report.core.ReportUtils;
@ -42,7 +43,7 @@ public class WatermarkSettingPane extends AbstractTemplateServerSettingPane {
}
public void populate(WatermarkAttr watermark) {
if (watermark.getWaterMarkProvider().equals("TEMPLATE")) {
if (watermark.getWaterMarkProvider().equals(WaterMarkProvideConstant.TEMPLATE)) {
chooseComboBox.setSelectedIndex(SINGLE_SET);
watermarkPane.populate(watermark);
} else {

Loading…
Cancel
Save