mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 01:39:21 +02:00
Merge remote-tracking branch 'origin/GP-1-dragonmacher-edit-action-fix' into Ghidra_11.4
This commit is contained in:
commit
54ba166144
2 changed files with 10 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue