Browse Source

REPORT-9747

【10.0二轮回归】修改以前的模板无法更改
master
XiaXiang 7 years ago
parent
commit
be2cd9cf2e
  1. 3
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  2. 8
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

3
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -1010,9 +1010,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
private void activeTemplate(FILE tplFile, JTemplate jt) {
// 如果该模板已经打开,则进行激活就可以了
String fullName = StableUtils.pathJoin(new String[]{ProjectConstants.REPORTLETS_NAME, tplFile.getName()});
if (tplFile instanceof FileNodeFILE) {
fullName = ((FileNodeFILE) tplFile).getEnvPath() + "/" + tplFile.getPath();
}
// 如果是从文件夹打开的文件,不是从设计器文件树打开的文件,则直接取path就行
if (tplFile instanceof FileFILE) {
fullName = tplFile.getPath();

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

@ -49,6 +49,7 @@ import com.fr.log.FineLoggerFactory;
import com.fr.report.cell.Elem;
import com.fr.report.cell.cellattr.CellImage;
import com.fr.stable.ArrayUtils;
import com.fr.stable.OperatingSystem;
import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils;
import com.fr.stable.core.UUID;
@ -199,7 +200,12 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
}
public String getPath() {
return getEditingFILE().getPath();
String editingFileName = getEditingFILE().getPath();
if (OperatingSystem.isWindows()) {
return editingFileName.replaceAll("/", "\\\\");
} else {
return editingFileName.replaceAll("\\\\", "/");
}
}
protected abstract JComponent createCenterPane();

Loading…
Cancel
Save