Commit 75b80b88 authored by Evan W. Patton's avatar Evan W. Patton Committed by Jeffrey Schiller

Remove Column and Row properties from Form

Change-Id: I986ce001d40ff7ea4423e7a21d29e3fad3e2eabc
parent 01f7807f
......@@ -47,8 +47,8 @@ public abstract class MockVisibleComponent extends MockComponent {
protected static final String PROPERTY_NAME_VISIBLE = "Visible";
protected static final String PROPERTY_NAME_WIDTH = "Width";
protected static final String PROPERTY_NAME_HEIGHT = "Height";
protected static final String PROPERTY_NAME_COLUMN = "Column";
protected static final String PROPERTY_NAME_ROW = "Row";
public static final String PROPERTY_NAME_COLUMN = "Column";
public static final String PROPERTY_NAME_ROW = "Row";
// Note: the values below are duplicated in Component.java
// If you change them here, change them there!
......
......@@ -25,6 +25,7 @@ import com.google.appinventor.client.editor.simple.components.FormChangeListener
import com.google.appinventor.client.editor.simple.components.MockComponent;
import com.google.appinventor.client.editor.simple.components.MockContainer;
import com.google.appinventor.client.editor.simple.components.MockForm;
import com.google.appinventor.client.editor.simple.components.MockVisibleComponent;
import com.google.appinventor.client.editor.simple.components.utils.PropertiesUtil;
import com.google.appinventor.client.editor.simple.palette.DropTargetProvider;
import com.google.appinventor.client.editor.simple.palette.SimpleComponentDescriptor;
......@@ -637,6 +638,16 @@ public final class YaFormEditor extends SimpleEditor implements FormChangeListen
String componentName = properties.get("$Name").asString().getString();
mockComponent.changeProperty("Name", componentName);
if (mockComponent instanceof MockForm) {
// A bug in an early version of multiselect resulted in Form gaining Row and Column
// properties, which are reserved for visible components that can appear in TableArrangements.
// Form doesn't have these properties, so we need to clean up the properties. The remove
// call here is idempotent--if the property is present, it is removed. If not present, the
// map remains unchanged.
properties.remove(MockVisibleComponent.PROPERTY_NAME_ROW);
properties.remove(MockVisibleComponent.PROPERTY_NAME_COLUMN);
}
// Set component properties
for (String name : properties.keySet()) {
if (name.charAt(0) != '$') { // Ignore special properties (name, type and nested components)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment