Browse Source

Merge remote-tracking branch 'origin/release/11.0' into release/11.0

release/11.0
Jimmy.Zheng 2 years ago
parent
commit
5f4d97764f
  1. 10
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java
  2. 1
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  3. 2
      designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedTemplateCellElementCase.java

10
designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java

@ -41,6 +41,8 @@ public class HistoryTemplateListCache implements CallbackEvent {
private List<JTemplate<?, ?>> historyList;
private JTemplate<?, ?> editingTemplate;
private JTemplate<?, ?> openingOrEditingTemplate;
public static HistoryTemplateListCache getInstance() {
return Holder.INSTANCE;
}
@ -99,6 +101,13 @@ public class HistoryTemplateListCache implements CallbackEvent {
}
}
public void setCurrentOpeningTemplate(JTemplate<?, ?> jt) {
this.openingOrEditingTemplate = jt;
}
public JTemplate<?, ?> getCurrentOpeningOrEditingTemplate() {
return openingOrEditingTemplate;
}
/**
* 需要使用 {@link JTemplate#isValid(JTemplate)} 来判断空
@ -116,6 +125,7 @@ public class HistoryTemplateListCache implements CallbackEvent {
*/
public void setCurrentEditingTemplate(JTemplate<?, ?> jt) {
this.editingTemplate = jt;
this.openingOrEditingTemplate = jt;
if (!JTemplate.isValid(jt)) {
return;

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

@ -190,6 +190,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
public JTemplate(T t, FILE file, boolean isNewFile, Parameter[] parameters) {
super(t);
HistoryTemplateListCache.getInstance().setCurrentOpeningTemplate(this);
if (isNewFile) {
// REPORT-58486: 必须在初始的UndoState创建前设置主题,使得初始的UndoState就包含了主题效果
setUpTheme4NewTemplate();

2
designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedTemplateCellElementCase.java

@ -32,7 +32,7 @@ public class DefaultThemedTemplateCellElementCase {
}
private static DefaultTemplateCellElement themingCellElement(DefaultTemplateCellElement cellElement) {
JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentOpeningOrEditingTemplate();
if (JTemplate.isValid(template)) {
TemplateTheme theme = template.getTemplateTheme();
ThemedCellStyle themedCellStyle = theme.getCellStyleList().getUse4Default();

Loading…
Cancel
Save