tag saving fix

This commit is contained in:
honfika@gmail.com
2015-05-03 13:03:48 +02:00
parent 1de608207f
commit 39243bdea2
5 changed files with 19 additions and 0 deletions

View File

@@ -659,6 +659,7 @@ public final class SWF implements SWFContainerItem, Timelined {
if (hasEndTag) {
sos.writeUI16(0);
}
sos.close();
os.write(Utf8Helper.getBytes(getHeaderBytes(compression, gfx)));
os.write(version);
@@ -711,6 +712,7 @@ public final class SWF implements SWFContainerItem, Timelined {
} else if (compression == SWFCompression.ZLIB) {
os = new DeflaterOutputStream(os);
}
os.write(data);
} finally {
if (os != null) {
@@ -2028,11 +2030,13 @@ public final class SWF implements SWFContainerItem, Timelined {
ret++;
}
}
for (ASMSource src : actionsMap.keySet()) {
actionsMap.get(src).removeNops();
src.setActions(actionsMap.get(src));
src.setModified();
}
deobfuscation.deobfuscateInstanceNames(false, deobfuscated, renameType, tags, selected);
return ret;
}

View File

@@ -282,6 +282,14 @@ public class DefineSpriteTag extends CharacterTag implements DrawableTag, Timeli
super.setModified(value);
}
@Override
public void createOriginalData() {
super.createOriginalData();
for (Tag subTag : subTags) {
subTag.createOriginalData();
}
}
public static void clearCache() {
rectCache.clear();
}

View File

@@ -120,6 +120,7 @@ public abstract class MainFrameMenu {
}
if (saved) {
swf.clearModified();
mainFrame.getPanel().refreshTree(swf);
}
return true;

View File

@@ -56,6 +56,7 @@ import com.jpexs.decompiler.flash.tags.base.SoundStreamHeadTypeTag;
import com.jpexs.decompiler.flash.tags.base.TextTag;
import com.jpexs.decompiler.flash.tags.gfx.DefineCompactedFont;
import com.jpexs.decompiler.flash.timeline.Frame;
import com.jpexs.decompiler.flash.timeline.TagScript;
import com.jpexs.decompiler.flash.timeline.Timelined;
import com.jpexs.decompiler.flash.treeitems.TreeItem;
import com.jpexs.decompiler.flash.types.GLYPHENTRY;
@@ -1142,6 +1143,10 @@ public class PreviewPanel extends JSplitPane {
return;
}
if (item instanceof TagScript) {
item = ((TagScript) item).getTag();
}
if (item instanceof Tag) {
genericEditButton.setVisible(false);
genericSaveButton.setVisible(true);

View File

@@ -758,6 +758,7 @@ public class ActionPanel extends JPanel implements SearchListener<ActionSearchRe
src.setActions(ASMParser.parse(0, true, text, src.getSwf().version, false));
}
src.setModified();
mainPanel.refreshTree(src.getSwf());
setSource(this.src, false);
View.showMessageDialog(this, AppStrings.translate("message.action.saved"), AppStrings.translate("dialog.message.title"), JOptionPane.INFORMATION_MESSAGE, Configuration.showCodeSavedMessage);
saveButton.setVisible(false);