diff --git a/CHANGELOG.md b/CHANGELOG.md index 13d81149f..7a467ece6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. ### Fixed - [#2319] AS3 Compound assignments problems in some cases - [#2319] AS3 direct editation - class gets removed after pressing cancel +- [#2320] AS3 direct editation - modified flag of scripts vanishes after editing other script with and having error ## [21.1.0] - 2024-09-23 ### Added @@ -3574,6 +3575,7 @@ Major version of SWF to XML export changed to 2. [alpha 8]: https://github.com/jindrapetrik/jpexs-decompiler/compare/alpha7...alpha8 [alpha 7]: https://github.com/jindrapetrik/jpexs-decompiler/releases/tag/alpha7 [#2319]: https://www.free-decompiler.com/flash/issues/2319 +[#2320]: https://www.free-decompiler.com/flash/issues/2320 [#943]: https://www.free-decompiler.com/flash/issues/943 [#1812]: https://www.free-decompiler.com/flash/issues/1812 [#2287]: https://www.free-decompiler.com/flash/issues/2287 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java index 2789dc976..b35e5e236 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java @@ -131,8 +131,10 @@ import java.io.OutputStream; import java.util.AbstractMap; import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.Stack; import java.util.logging.Level; import java.util.logging.Logger; @@ -3013,6 +3015,12 @@ public class ActionScript3Parser { ActionScript3Parser parser = new ActionScript3Parser(abcIndex); boolean success = false; ABC originalAbc = ((ABCContainerTag) ((Tag) abc.parentTag).cloneTag()).getABC(); + Set modifiedScripts = new HashSet<>(); + for (int i = 0; i < abc.script_info.size(); i++) { + if (abc.script_info.get(i).isModified()) { + modifiedScripts.add(i); + } + } try { parser.addScript(src, fileName, classPos, scriptIndex, documentClass, abc); success = true; @@ -3027,6 +3035,12 @@ public class ActionScript3Parser { abc.script_info = originalAbc.script_info; abc.bodies = originalAbc.bodies; abc.resetMethodIndexing(); + + for (int i = 0; i < abc.script_info.size(); i++) { + if (modifiedScripts.contains(i)) { + abc.script_info.get(i).setModified(true); + } + } } } }