Fix document loading/saving

This commit is contained in:
Sampo Niskanen 2015-01-06 20:45:10 +02:00
parent a1f6782195
commit 79fd36dc9f
2 changed files with 4 additions and 2 deletions

View File

@ -219,6 +219,8 @@ public class OpenRocketSaver extends RocketSaver {
*/
private int calculateNecessaryFileVersion(OpenRocketDocument document, StorageOptions opts) {
/*
* NOTE: Remember to update the supported versions in DocumentConfig as well!
*
* File version 1.7 is required for:
* - simulation extensions
*
@ -553,7 +555,7 @@ public class OpenRocketSaver extends RocketSaver {
} else if (value instanceof Number) {
writeln("<entry " + keyAttr + "type=\"number\">" + value + "</entry>");
} else if (value instanceof String) {
writeln("<entry " + keyAttr + "type=\"string\">" + value + "</entry>");
writeln("<entry " + keyAttr + "type=\"string\">" + TextUtil.escapeXML((String) value) + "</entry>");
} else if (value instanceof List) {
List<?> list = (List<?>) value;
writeln("<entry " + keyAttr + "type=\"list\">");

View File

@ -48,7 +48,7 @@ import net.sf.openrocket.util.Reflection;
class DocumentConfig {
/* Remember to update OpenRocketSaver as well! */
public static final String[] SUPPORTED_VERSIONS = { "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6" };
public static final String[] SUPPORTED_VERSIONS = { "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7" };
/**
* Divisor used in converting an integer version to the point-represented version.