From bdceb6ababca43118a94f09ea99440b8e1195047 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Fri, 20 Jul 2018 16:34:48 +0800 Subject: [PATCH] REPORT-9845 & REPORT-9849 & REPORT-9883 --- .../java/com/fr/design/file/HistoryTemplateListPane.java | 6 ++++-- .../main/java/com/fr/grid/selection/FloatSelection.java | 6 +++++- .../fr/quickeditor/floatquick/FloatStringQuickEditor.java | 7 ++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java index cff8675c4c..22b9ab7c0b 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java @@ -22,6 +22,7 @@ import com.fr.general.Inter; import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; import com.fr.workspace.WorkContext; @@ -246,8 +247,9 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C */ public int contains(String filename) { for (int i = 0; i < historyList.size(); i++) { - String historyPath = historyList.get(i).getPath(); - if (ComparatorUtils.equals(historyPath, filename)) { + String historyPath = historyList.get(i).getPath().replaceAll("/", "\\\\"); + //文件路径是全路径,历史路径是reportlets/模板名 + if (filename.endsWith(historyPath)) { return i; } } diff --git a/designer-realize/src/main/java/com/fr/grid/selection/FloatSelection.java b/designer-realize/src/main/java/com/fr/grid/selection/FloatSelection.java index d6d3f627f6..15fc359eb3 100644 --- a/designer-realize/src/main/java/com/fr/grid/selection/FloatSelection.java +++ b/designer-realize/src/main/java/com/fr/grid/selection/FloatSelection.java @@ -235,7 +235,11 @@ public class FloatSelection extends Selection { public QuickEditor getQuickEditor(TargetComponent tc) { ElementCasePane ePane = (ElementCasePane) tc; FloatElement selectedFloat = ePane.getEditingElementCase().getFloatElement(selectedFloatName); - Object value = selectedFloat.getValue(); + Object value = null; + //处理撤销时npe + if(selectedFloat != null) { + value = selectedFloat.getValue(); + } value = value == null ? "" : value; value = value instanceof Number ? value.toString() : value; QuickEditor editor = ActionFactory.getFloatEditor(value.getClass()); diff --git a/designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java index eae3e81dc0..3e3211259b 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java @@ -90,7 +90,12 @@ public class FloatStringQuickEditor extends FloatQuickEditor { @Override protected void refreshDetails() { String str; - Object value = floatElement.getValue(); + Object value = null; + //处理撤销时npe + if (floatElement != null){ + value = floatElement.getValue(); + } + if (value == null) { str = StringUtils.EMPTY; } else if (value instanceof BaseFormula) {