Browse Source

REPORT-73996-新建frm预览空白

【问题原因】
1. 重复创建新Form、WorkBook对象,导致显示和保存用的对象是不同的
2. 代码合并问题导致JTemplate中checkAndResetTheme未能删除
3. 修复undo没有同步主题色的问题

【改动思路】
同上
release/11.0
Starryi 2 years ago
parent
commit
b93c490229
  1. 6
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  2. 6
      designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java
  3. 1
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  4. 1
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

6
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -201,7 +201,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
} 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<T extends BaseBook, U extends BaseUndoState<?>>
}
addCenterPane();
isNewCreateTpl = isNewFile;
if (isNewCreateTpl) {
// REPORT-58486: 必须在初始的UndoState创建前设置主题,使得初始的UndoState就包含了主题效果
setUpTheme4NewTemplate();
}
this.undoState = createUndoState();
initAndStartPlugin();

6
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);
}
}
}

1
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -664,6 +664,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
try {
Form undoForm = (Form) u.getForm().clone();
undoForm.checkAndResetTheme();
undoForm = (Form) FineColorSynchronizer.flush(undoForm, undoForm.getTemplateTheme());
if (this.index == FORM_TAB) {
//JForm的target重置
this.setTarget(undoForm);

1
designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

@ -794,6 +794,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
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) {

Loading…
Cancel
Save