Fixed #1877 Recalculate dependent characters and frames on removing / editing item

This commit is contained in:
Jindra Petřík
2022-11-18 18:42:37 +01:00
parent 792df04427
commit 03ddda8e19
4 changed files with 17 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ All notable changes to this project will be documented in this file.
- [#1840] AS3 - Allow to compile object literal keys with nonstring/numbers in obfuscated code
- [#1840] AS3 Direct editation - Type mismatched for a trait
- [#1840] Proper if..continue..break handling
- [#1877] Recalculate dependent characters and frames on removing / editing item
### Changed
- GFX - DefineExternalImage2 no longer handled as character
@@ -2616,6 +2617,7 @@ All notable changes to this project will be documented in this file.
[#1757]: https://www.free-decompiler.com/flash/issues/1757
[#1807]: https://www.free-decompiler.com/flash/issues/1807
[#1840]: https://www.free-decompiler.com/flash/issues/1840
[#1877]: https://www.free-decompiler.com/flash/issues/1877
[#1867]: https://www.free-decompiler.com/flash/issues/1867
[#1868]: https://www.free-decompiler.com/flash/issues/1868
[#1649]: https://www.free-decompiler.com/flash/issues/1649

View File

@@ -2838,12 +2838,13 @@ public final class SWF implements SWFContainerItem, Timelined {
externalImages2 = null;
timeline = null;
cyclicCharacters = null;
dependentCharacters = null;
dependentFrames = null;
clearReadOnlyListCache();
clearImageCache();
clearShapeCache();
clearScriptCache();
clearAbcListCache();
clearAllStaticCache();
}
public static void uncache(ASMSource src) {

View File

@@ -1172,6 +1172,8 @@ public class GenericTagTreePanel extends GenericTagPanel {
((Timelined)parentCharacter).resetTimeline();
}
}
swf.computeDependentCharacters();
swf.computeDependentFrames();
return true;
}

View File

@@ -1393,6 +1393,10 @@ public class TagTreeContextMenu extends JPopupMenu {
targetSwf.updateCharacters();
sourceSwf.resetTimelines(sourceSwf);
targetSwf.resetTimelines(targetSwf);
sourceSwf.computeDependentCharacters();
targetSwf.computeDependentCharacters();
sourceSwf.computeDependentFrames();
targetSwf.computeDependentFrames();
timelined.setFrameCount(timelined.getTimeline().getFrameCount());
@@ -2321,9 +2325,11 @@ public class TagTreeContextMenu extends JPopupMenu {
tagsToRemoveBySwf.get(swf).add(tag);
}
for (SWF swf : tagsToRemoveBySwf.keySet()) {
swf.removeTags(tagsToRemoveBySwf.get(swf), removeDependencies);
swf.computeDependentCharacters();
swf.computeDependentFrames();
}
for (SWF swf : swfsToClearCache) {
@@ -2935,6 +2941,8 @@ public class TagTreeContextMenu extends JPopupMenu {
sourceSwf.clearImageCache();
sourceSwf.clearShapeCache();
sourceSwf.updateCharacters();
sourceSwf.computeDependentCharacters();
sourceSwf.computeDependentFrames();
sourceSwf.resetTimelines(sourceSwf);
}
}
@@ -2943,6 +2951,8 @@ public class TagTreeContextMenu extends JPopupMenu {
targetSwf.clearImageCache();
targetSwf.clearShapeCache();
targetSwf.updateCharacters();
targetSwf.computeDependentCharacters();
targetSwf.computeDependentFrames();
targetSwf.resetTimelines(targetSwf);
mainPanel.refreshTree(targetSwf);