Skip to content

Commit

Permalink
Fixing a further issue with loading legacy layout files and then rest…
Browse files Browse the repository at this point in the history
…oring the default layout. The loading legacy file flag was still set internally.
  • Loading branch information
andrewauclair committed Aug 17, 2024
1 parent df19563 commit 5853c55
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 2 additions & 4 deletions docking-api/src/ModernDocking/api/LayoutPersistenceAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ else if (next == XMLStreamConstants.END_ELEMENT && reader.getLocalName().equals(
throw new DockingLayoutException(file, DockingLayoutException.FailureType.LOAD, e);
}
finally {
DockableProperties.setLoadingLegacyFile(false);

try {
if (reader != null) {
reader.close();
Expand Down Expand Up @@ -517,8 +519,6 @@ private Map<String, Property> readProperties(XMLStreamReader reader) throws XMLS
}
}
else {
DockableProperties.setLoadingLegacyFile(false);

while (reader.hasNext()) {
next = reader.nextTag();

Expand Down Expand Up @@ -625,8 +625,6 @@ else if (next == XMLStreamConstants.START_ELEMENT && reader.getLocalName().equal
}
}
else {
DockableProperties.setLoadingLegacyFile(false);

while (reader.hasNext()) {
next = reader.nextTag();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public static void configureProperties(DockableWrapper wrapper, Map<String, Prop
if (loadingLegacyFile) {
Property.StringProperty legacyProp = (Property.StringProperty) properties.get(property.name());
prop = parseProperty(prop.getName(), field.getType().getSimpleName().toString(), legacyProp.getValue());

properties.put(prop.getName(), prop);
}
DockableProperties.validateProperty(field, prop);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public String getClassName() {
* @return properties map
*/
public Map<String, Property> getProperties() {
return Collections.unmodifiableMap(properties);
return properties;
}

public void setProperties(Map<String, Property> properties) {
Expand Down

0 comments on commit 5853c55

Please sign in to comment.