|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
package com.fr.design.utils; |
|
|
|
|
|
|
|
|
|
import com.fr.base.extension.FileExtension; |
|
|
|
|
import com.fr.base.io.BaseBook; |
|
|
|
|
import com.fr.design.file.HistoryTemplateListCache; |
|
|
|
|
import com.fr.design.file.TemplateTreePane; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
@ -17,9 +16,9 @@ import com.fr.stable.CoreConstants;
|
|
|
|
|
import com.fr.stable.ProductConstants; |
|
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
|
import com.fr.workspace.server.lock.TplOperator; |
|
|
|
|
import java.io.ByteArrayOutputStream; |
|
|
|
|
import java.io.OutputStream; |
|
|
|
|
|
|
|
|
|
import javax.swing.SwingWorker; |
|
|
|
|
import java.io.OutputStream; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author hades |
|
|
|
@ -65,12 +64,7 @@ public class TemplateUtils {
|
|
|
|
|
if (!needOpen) { |
|
|
|
|
// 从当前编辑模板中生成备份文件
|
|
|
|
|
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); |
|
|
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
|
|
BaseBook target = template.getTarget(); |
|
|
|
|
if (target != null) { |
|
|
|
|
target.export(outputStream); |
|
|
|
|
content = outputStream.toByteArray(); |
|
|
|
|
} |
|
|
|
|
content = template.exportData(); |
|
|
|
|
} else { |
|
|
|
|
content = WorkContext.getWorkResource().readFully(oldPath); |
|
|
|
|
} |
|
|
|
|