From cfdae7ac2256f85d671042acf8d67c13980aaa8d Mon Sep 17 00:00:00 2001 From: "Java.Edge" Date: Mon, 11 May 2020 10:15:04 +0800 Subject: [PATCH] REPORT-30922 bugfix --- .../design/headerfooter/HFAttributesEditDialog.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java b/designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java index 152f8fd28..2b81db2b9 100644 --- a/designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java +++ b/designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java @@ -26,12 +26,14 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.style.FRFontPane; import com.fr.design.style.FormatPane; import com.fr.general.ComparatorUtils; +import com.fr.general.date.FineDateFormat; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.text.Format; import java.util.ArrayList; /** @@ -274,10 +276,16 @@ public class HFAttributesEditDialog extends BasicPane { ((NumberOfPageHFElement) hfElement).setFRFont(this.frFontPane.update()); } else if (ComparatorUtils.equals(this.hfElement.getClass(),DateHFElement.class)) { ((DateHFElement) hfElement).setFRFont(this.frFontPane.update()); - ((DateHFElement) hfElement).setFormat(this.formatPane.update()); + Format format = this.formatPane.update(); + if (format instanceof FineDateFormat) { + ((DateHFElement) hfElement).setFormat(format); + } } else if (ComparatorUtils.equals(this.hfElement.getClass(),TimeHFElement.class)) { ((TimeHFElement) hfElement).setFRFont(this.frFontPane.update()); - ((TimeHFElement) hfElement).setFormat(this.formatPane.update()); + Format format = this.formatPane.update(); + if (format instanceof FineDateFormat) { + ((TimeHFElement) hfElement).setFormat(format); + } } else if (ComparatorUtils.equals(this.hfElement.getClass(),ImageHFElement.class)) { ((ImageHFElement) hfElement).setImage(this.imagePane.update()); } else if (ComparatorUtils.equals(this.hfElement.getClass(),NewLineHFElement.class)) {