This commit is contained in:
honfika@gmail.com
2015-03-07 14:58:55 +01:00
parent f938e97f5a
commit 14f07233dd
9 changed files with 1994 additions and 2233 deletions

View File

@@ -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();
}