Fixed missing help; fixed action enablement

This commit is contained in:
dragonmacher 2025-06-05 20:35:28 -04:00
parent 4a65e9af3b
commit ac00cf7e30
2 changed files with 10 additions and 7 deletions

View file

@ -1365,7 +1365,7 @@
</BLOCKQUOTE>
</BLOCKQUOTE>
<H2><A name="Edit_Field"></A>Quick Editing of a Structure or Union Field</H2>
<H2><A name="Edit_Field"></A><A name="Quick_Edit_Field">Quick Editing of a Structure or Union Field</H2>
<BLOCKQUOTE>
<P>As a convenience, a structure or union field can be edited directly from the listing without
bringing up the entire structure or union editor. To edit a field, click anywhere on the line

View file

@ -842,8 +842,15 @@ public class DataPlugin extends Plugin implements DataService {
private boolean canEditField(ListingActionContext context) {
ProgramLocation location = context.getLocation();
int[] componentPath = location.getComponentPath();
return componentPath != null && componentPath.length > 0;
int[] path = location.getComponentPath();
if (path == null || path.length == 0) {
return false;
}
Program program = context.getProgram();
Address address = location.getAddress();
DataTypeComponent dtc = DataTypeUtils.getDataTypeComponent(program, address, path);
return dtc != null;
}
private void editField(ListingActionContext context) {
@ -854,10 +861,6 @@ public class DataPlugin extends Plugin implements DataService {
int[] path = location.getComponentPath();
DataTypeComponent dtc = DataTypeUtils.getDataTypeComponent(program, address, path);
if (dtc == null) {
return;
}
DataType parent = dtc.getParent();
Composite composite = (Composite) parent;
int ordinal = dtc.getOrdinal();