mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-35339 - NPE: PropertyParser.loadLayoutProperties
This commit is contained in:
+10
-10
@@ -272,12 +272,12 @@ public class PropertyParser {
|
||||
if (margin != null) {
|
||||
List<Property> children = margin.getChildren(null);
|
||||
|
||||
children.add(PropertyTable.extractProperty(properties, "marginLeft"));
|
||||
children.add(PropertyTable.extractProperty(properties, "marginTop"));
|
||||
children.add(PropertyTable.extractProperty(properties, "marginRight"));
|
||||
children.add(PropertyTable.extractProperty(properties, "marginBottom"));
|
||||
children.add(PropertyTable.extractProperty(properties, "marginStart"));
|
||||
children.add(PropertyTable.extractProperty(properties, "marginEnd"));
|
||||
PropertyTable.moveProperty(properties, "marginLeft", children, -1);
|
||||
PropertyTable.moveProperty(properties, "marginTop", children, -1);
|
||||
PropertyTable.moveProperty(properties, "marginRight", children, -1);
|
||||
PropertyTable.moveProperty(properties, "marginBottom", children, -1);
|
||||
PropertyTable.moveProperty(properties, "marginStart", children, -1);
|
||||
PropertyTable.moveProperty(properties, "marginEnd", children, -1);
|
||||
|
||||
if (model != null) {
|
||||
for (Property child : children) {
|
||||
@@ -303,10 +303,10 @@ public class PropertyParser {
|
||||
}
|
||||
});
|
||||
|
||||
PropertyTable.top(properties, "layout:margin");
|
||||
PropertyTable.top(properties, "layout:gravity");
|
||||
PropertyTable.top(properties, "layout:height");
|
||||
PropertyTable.top(properties, "layout:width");
|
||||
PropertyTable.moveProperty(properties, "layout:margin", properties, 0);
|
||||
PropertyTable.moveProperty(properties, "layout:gravity", properties, 0);
|
||||
PropertyTable.moveProperty(properties, "layout:height", properties, 0);
|
||||
PropertyTable.moveProperty(properties, "layout:width", properties, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+8
-3
@@ -371,10 +371,15 @@ public final class PropertyTable extends JBTable implements ComponentSelectionLi
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static void top(List<Property> properties, String name) {
|
||||
Property property = extractProperty(properties, name);
|
||||
public static void moveProperty(List<Property> source, String name, List<Property> destination, int index) {
|
||||
Property property = extractProperty(source, name);
|
||||
if (property != null) {
|
||||
properties.add(0, property);
|
||||
if (index == -1) {
|
||||
destination.add(property);
|
||||
}
|
||||
else {
|
||||
destination.add(index, property);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user