|
|
@ -190,6 +190,10 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>> |
|
|
|
|
|
|
|
|
|
|
|
public JTemplate(T t, FILE file, boolean isNewFile, Parameter[] parameters) { |
|
|
|
public JTemplate(T t, FILE file, boolean isNewFile, Parameter[] parameters) { |
|
|
|
super(t); |
|
|
|
super(t); |
|
|
|
|
|
|
|
if (isNewFile) { |
|
|
|
|
|
|
|
// REPORT-58486: 必须在初始的UndoState创建前设置主题,使得初始的UndoState就包含了主题效果
|
|
|
|
|
|
|
|
setUpTheme4NewTemplate(); |
|
|
|
|
|
|
|
} |
|
|
|
beforeInit(); |
|
|
|
beforeInit(); |
|
|
|
// 判断是否切换设计器状态到禁止拷贝剪切
|
|
|
|
// 判断是否切换设计器状态到禁止拷贝剪切
|
|
|
|
if (t.getAttrMark(DesignBanCopyAttrMark.XML_TAG) != null) { |
|
|
|
if (t.getAttrMark(DesignBanCopyAttrMark.XML_TAG) != null) { |
|
|
@ -1894,10 +1898,10 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>> |
|
|
|
|
|
|
|
|
|
|
|
protected void setUpTheme4NewTemplate() { |
|
|
|
protected void setUpTheme4NewTemplate() { |
|
|
|
TemplateTheme theme = getUsingTemplateThemeConfig().cachedFetchTheme4NewTemplate(); |
|
|
|
TemplateTheme theme = getUsingTemplateThemeConfig().cachedFetchTheme4NewTemplate(); |
|
|
|
TemplateThemeAttrMark themeAttrMark = template.getAttrMark(TemplateThemeAttrMark.XML_TAG); |
|
|
|
TemplateThemeAttrMark themeAttrMark = getTarget().getAttrMark(TemplateThemeAttrMark.XML_TAG); |
|
|
|
if (themeAttrMark == null) { |
|
|
|
if (themeAttrMark == null) { |
|
|
|
themeAttrMark = new TemplateThemeAttrMark(); |
|
|
|
themeAttrMark = new TemplateThemeAttrMark(); |
|
|
|
template.addAttrMark(themeAttrMark); |
|
|
|
getTarget().addAttrMark(themeAttrMark); |
|
|
|
} |
|
|
|
} |
|
|
|
themeAttrMark.setName(theme.getName()); |
|
|
|
themeAttrMark.setName(theme.getName()); |
|
|
|
themeAttrMark.setDark(theme.isDark()); |
|
|
|
themeAttrMark.setDark(theme.isDark()); |
|
|
|