mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 09:50:51 +00:00
2nd tag saving problem fixed
This commit is contained in:
@@ -451,6 +451,7 @@ public final class SWF implements TreeItem, Timelined {
|
||||
public void clearModified() {
|
||||
for (Tag tag : tags) {
|
||||
if (tag.isModified()) {
|
||||
tag.createOriginalData();
|
||||
tag.setModified(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public abstract class Tag implements NeedsCharacters, Exportable, ContainerItem,
|
||||
* Original tag data
|
||||
*/
|
||||
@Internal
|
||||
private final ByteArrayRange originalData;
|
||||
private ByteArrayRange originalData;
|
||||
|
||||
public String getTagName() {
|
||||
return tagName;
|
||||
@@ -394,6 +394,15 @@ public abstract class Tag implements NeedsCharacters, Exportable, ContainerItem,
|
||||
modified = value;
|
||||
}
|
||||
|
||||
public void createOriginalData() {
|
||||
byte[] data = getData();
|
||||
byte[] headerData = getHeader(data);
|
||||
byte[] tagData = new byte[data.length + headerData.length];
|
||||
System.arraycopy(headerData, 0, tagData, 0, headerData.length);
|
||||
System.arraycopy(data, 0, tagData, headerData.length, data.length);
|
||||
originalData = new ByteArrayRange(tagData, 0, tagData.length);
|
||||
}
|
||||
|
||||
public boolean isModified() {
|
||||
return modified;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user