diff --git a/designer-base/src/main/java/com/fr/design/dialog/FineJOptionPane.java b/designer-base/src/main/java/com/fr/design/dialog/FineJOptionPane.java index 4a4424d9f5..c644550795 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/FineJOptionPane.java +++ b/designer-base/src/main/java/com/fr/design/dialog/FineJOptionPane.java @@ -1,6 +1,7 @@ package com.fr.design.dialog; import com.fr.invoke.Reflect; +import com.fr.stable.StringUtils; import javax.swing.Icon; import javax.swing.JDialog; @@ -279,8 +280,11 @@ public class FineJOptionPane extends JOptionPane { dialog.show(); dialog.dispose(); - Object value = pane.getInputValue(); + //点击取消按钮,返回null + if (StringUtils.equals((String) pane.getValue(), OPTION_OK_CANCEL[1])) + return null; + Object value = pane.getInputValue(); if (value == UNINITIALIZED_VALUE) { return null; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java index 74443e831c..52f1fe1f0c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java @@ -945,7 +945,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse // marks:判断是否重名 boolean isExisted = false; for (int i = 0; i < reportComposite.getEditingWorkBook().getReportCount(); i++) { - if (newName.equalsIgnoreCase(reportComposite.getEditingWorkBook().getReportName(i))) { + if (newName.equalsIgnoreCase(reportComposite.getEditingWorkBook().getReportName(i)) && i != selectedIndex) { isExisted = true; break; }