This commit is contained in:
2015-03-07 14:58:55 +01:00
parent f938e97f5a
commit 14f07233dd
9 changed files with 1994 additions and 2233 deletions
@@ -315,8 +315,6 @@ public class Main {
Stopwatch sw = Stopwatch.startNew();
if (bundle != null) {
//result.isBundle = true;
//result.bundleClass = bundle.getClass();
result.bundle = bundle;
result.name = new File(sourceInfo.getFileTitleOrName()).getName();
for (Entry<String, SeekableInputStream> streamEntry : bundle.getAll().entrySet()) {
@@ -328,7 +326,6 @@ public class Main {
startWork(AppStrings.translate("work.reading.swf"), p);
}
}, Configuration.parallelSpeedUp.get());
swf.bundle = bundle;
result.add(swf);
}
} else {
@@ -50,7 +50,6 @@ public abstract class MainFrameMenu {
private final MainFrame mainFrame;
private SWF swf;
private SWFBundle bundle;
public abstract boolean isInternalFlashViewerSelected();
@@ -69,20 +68,20 @@ public abstract class MainFrameMenu {
}
protected boolean save() {
if (swf != null) {
if (swf != null) {
boolean saved = false;
if(swf.bundle!=null){
if(!swf.bundle.isReadOnly()){
if (swf.swfList != null && swf.swfList.isBundle()) {
SWFBundle bundle = swf.swfList.bundle;
if (!bundle.isReadOnly()) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
swf.saveTo(baos);
saved = swf.bundle.putSWF(swf.getFileTitle(), new ByteArrayInputStream(baos.toByteArray()));
saved = bundle.putSWF(swf.getFileTitle(), new ByteArrayInputStream(baos.toByteArray()));
} catch (IOException ex) {
Logger.getLogger(MainFrameMenu.class.getName()).log(Level.SEVERE, "Cannot save SWF", ex);
}
}
}
else if (swf.binaryData != null) {
} else if (swf.binaryData != null) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
swf.saveTo(baos);
@@ -115,7 +114,7 @@ public abstract class MainFrameMenu {
protected boolean saveAs() {
if (swf != null) {
if (saveAs(swf,SaveFileMode.SAVEAS)) {
if (saveAs(swf, SaveFileMode.SAVEAS)) {
swf.clearModified();
}