Browse Source

REPORT-55243:改变报表引擎属性后,需要改变一下JTemplate的保存状态

research/11.0
fly.li 3 years ago
parent
commit
f4820d2769
  1. 13
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

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

@ -1615,9 +1615,8 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
worker.addSuccessCallback(new Runnable() { worker.addSuccessCallback(new Runnable() {
@Override @Override
public void run() { public void run() {
//在新建报表流程会走这个流程,应该进行预编译 boolean isChangedFile = !JTemplate.this.isSaved() && !DesignModeContext.isVcsMode();
if (!JTemplate.this.isSaved() && !DesignModeContext.isVcsMode()){ if (isChangedFile){
//这里要先调下面这行代码
callBackForSave(); callBackForSave();
CptCompileUtil.compile(JTemplate.this); CptCompileUtil.compile(JTemplate.this);
} }
@ -1626,11 +1625,11 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
if (ComparatorUtils.equals(JTemplate.this.template.getTemplateID(), if (ComparatorUtils.equals(JTemplate.this.template.getTemplateID(),
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().template.getTemplateID())) { HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().template.getTemplateID())) {
refreshToolArea(); refreshToolArea();
} }
DesignerFrameFileDealerPane.getInstance().refresh(); DesignerFrameFileDealerPane.getInstance().refresh();
} }
}); });
return worker; return worker;
} }
@ -1682,7 +1681,11 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
} }
if (!result) { if (!result) {
//在这里改变报表引擎属性 //在这里改变报表引擎属性
CptCompileUtil.changeFrEngineAttr(oldName, this); boolean ischanged = CptCompileUtil.changeFrEngineAttr(oldName, this);
if (ischanged){
//如果改变了属性,则需要重新预编译,因此设置jTemplate的保存状态为false
this.saved = false;
}
result = this.saveRealFile(); result = this.saveRealFile();
// 更换最近打开 // 更换最近打开
DesignerEnvManager.getEnvManager().replaceRecentOpenedFilePath(oldName, this.getPath()); DesignerEnvManager.getEnvManager().replaceRecentOpenedFilePath(oldName, this.getPath());

Loading…
Cancel
Save