From bdceb6ababca43118a94f09ea99440b8e1195047 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Fri, 20 Jul 2018 16:34:48 +0800 Subject: [PATCH 1/2] 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 cff8675c4..22b9ab7c0 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 d6d3f627f..15fc359eb 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 eae3e81dc..3e3211259 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) { From 7675f2ad2775156c40488a0a3564fee773631e43 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Fri, 20 Jul 2018 16:37:36 +0800 Subject: [PATCH 2/2] REPORT-9845 & REPORT-9849 & REPORT-9883 --- .../main/java/com/fr/design/file/HistoryTemplateListPane.java | 1 - 1 file changed, 1 deletion(-) 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 22b9ab7c0..7e2f34593 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,7 +22,6 @@ 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;