diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 7d1461bf37..a76d92913c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -201,7 +201,7 @@ public abstract class JTemplate> } else if (!DesignModeContext.isVcsMode() && !DesignModeContext.isAuthorityEditing() && !DesignModeContext.isDuchampMode()) { DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.NORMAL); } - this.template = t; + this.template = getTarget(); this.previewType = parserPreviewProvider(t.getPreviewType()); this.editingFILE = file; this.setLayout(FRGUIPaneFactory.createBorderLayout()); @@ -213,10 +213,6 @@ public abstract class JTemplate> } addCenterPane(); isNewCreateTpl = isNewFile; - if (isNewCreateTpl) { - // REPORT-58486: 必须在初始的UndoState创建前设置主题,使得初始的UndoState就包含了主题效果 - setUpTheme4NewTemplate(); - } this.undoState = createUndoState(); initAndStartPlugin(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java index 310a051a4e..15895c06a8 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java @@ -39,11 +39,7 @@ public final class JTemplateFactory { String[] defaultAppExtensions = app.defaultExtensions(); for (String defaultAppExtension : defaultAppExtensions) { if (defaultAppExtension.equalsIgnoreCase(fileExtension)) { - JTemplate jt = app.openTemplate(file); - if (jt != null) { - jt.checkAndResetTheme(); - return jt; - } + return app.openTemplate(file); } } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 0f5b903078..831d245d1a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -664,6 +664,7 @@ public class JForm extends JTemplate implements BaseJForm { try { WorkBook undoWorkBook = (WorkBook) u.getWorkBook().clone(); undoWorkBook.checkAndResetTheme(); + undoWorkBook = (WorkBook) FineColorSynchronizer.flush(undoWorkBook, undoWorkBook.getTemplateTheme()); this.setTarget(undoWorkBook); if (!DesignerMode.isAuthorityEditing()) { if (u.getAuthorityType() != BaseUndoState.NORMAL_STATE) {