Browse Source

Pull request #5403: REPORT-57251 修复设计器无法打开环境之外cptx的问题

Merge in DESIGN/design from ~LOY/design:release/11.0 to release/11.0

* commit '6c4cb1c89b5d3774d10366cd880a1be1dbf6e438':
  REPORT-57251 修复设计器无法打开环境之外cptx的问题
fix-lag
loy 3 years ago
parent
commit
92c0050a80
  1. 14
      designer-realize/src/main/java/com/fr/nx/app/designer/CptxApp.java

14
designer-realize/src/main/java/com/fr/nx/app/designer/CptxApp.java

@ -4,6 +4,7 @@ import com.fr.base.extension.FileExtension;
import com.fr.design.mainframe.AbstractAppProvider;
import com.fr.design.mainframe.JTemplate;
import com.fr.file.FILE;
import com.fr.log.FineLoggerFactory;
import com.fr.main.impl.WorkBook;
import com.fr.nx.cptx.utils.CptxFileUtils;
@ -35,16 +36,17 @@ public class CptxApp extends AbstractAppProvider<WorkBook> {
*/
@Override
public JTemplate<WorkBook, ?> openTemplate(FILE tplFile) {
WorkBook workBook = CptxFileUtils.getWorkBook(CptxFileUtils.getFormatPath(tplFile.getPath()));
if (workBook == null) {
workBook = new WorkBook();
}
return new JStreamBook(workBook, tplFile);
return new JStreamBook(asIOFile(tplFile), tplFile);
}
@Override
public WorkBook asIOFile(FILE file) {
WorkBook workBook = CptxFileUtils.getWorkBook(CptxFileUtils.getFormatPath(file.getPath()));
WorkBook workBook = null;
try {
workBook = CptxFileUtils.getWorkBook(file.asInputStream());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
if (workBook == null) {
workBook = new WorkBook();
}

Loading…
Cancel
Save