Changed: Quotes in tree node parameter values that need them

This commit is contained in:
Jindra Petřík
2025-07-21 23:44:35 +02:00
parent 41118564b3
commit 468e4f0efa
9 changed files with 41 additions and 15 deletions
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.annotations.Conditional;
import com.jpexs.decompiler.flash.types.annotations.SWFVersion;
import com.jpexs.helpers.ByteArrayRange;
import com.jpexs.helpers.Helper;
import java.io.IOException;
import java.util.Map;
@@ -93,7 +94,7 @@ public class FrameLabelTag extends Tag {
public Map<String, String> getNameProperties() {
Map<String, String> ret = super.getNameProperties();
if (!name.isEmpty()) {
ret.put("name", name);
ret.put("name", "\"" + Helper.escapePCodeString(name) + "\"");
}
return ret;
}
@@ -33,6 +33,7 @@ import com.jpexs.decompiler.flash.types.SHAPE;
import com.jpexs.decompiler.flash.types.TEXTRECORD;
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
import com.jpexs.helpers.ByteArrayRange;
import com.jpexs.helpers.Helper;
import com.jpexs.helpers.SerializableImage;
import java.awt.Color;
import java.awt.Font;
@@ -394,7 +395,7 @@ public abstract class FontTag extends DrawableTag implements AloneTag {
ret.put("chid", "" + getCharacterId());
String fontName = getFontNameIntag();
if (fontName != null) {
ret.put("fn", fontName);
ret.put("fn", "\"" + Helper.escapePCodeString(fontName) + "\"");
}
return ret;
}
@@ -29,6 +29,7 @@ import com.jpexs.decompiler.flash.treeitems.TreeItem;
import com.jpexs.decompiler.flash.types.RGB;
import com.jpexs.decompiler.flash.types.RGBA;
import com.jpexs.decompiler.flash.types.SOUNDINFO;
import com.jpexs.helpers.Helper;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@@ -161,7 +162,7 @@ public class Frame implements TreeItem, Exportable {
List<String> labels = new ArrayList<>();
for (Tag t : innerTags) {
if (t instanceof FrameLabelTag) {
labels.add(((FrameLabelTag) t).name);
labels.add("\"" + Helper.escapePCodeString(((FrameLabelTag) t).name) + "\"");
}
}
if (!labels.isEmpty()) {