mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-31 03:08:27 +08:00
GP-2173 - fixed undo closing an unsaved data type editor window
This commit is contained in:
+17
-10
@@ -358,14 +358,21 @@ public class DataTypeEditorManager
|
|||||||
DataTypeManager dataTypeManager = editor.getDataTypeManager();
|
DataTypeManager dataTypeManager = editor.getDataTypeManager();
|
||||||
DataTypeManager programDataTypeManager = domainObject.getDataTypeManager();
|
DataTypeManager programDataTypeManager = domainObject.getDataTypeManager();
|
||||||
if (dataTypeManager == programDataTypeManager) {
|
if (dataTypeManager == programDataTypeManager) {
|
||||||
DataTypePath dtPath = editor.getDtPath();
|
/*
|
||||||
CategoryPath categoryPath = dtPath.getCategoryPath();
|
|
||||||
String name = dtPath.getDataTypeName();
|
It is not clear why this check was added. It seem reasonable to always let the
|
||||||
DataType dataType = programDataTypeManager.getDataType(categoryPath, name);
|
editor know about the event. With this code enabled, editors with new, unsaved
|
||||||
if (dataType == null || dataType.isDeleted()) {
|
types will be closed.
|
||||||
dismissEditor(editor);
|
|
||||||
continue;
|
DataTypePath dtPath = editor.getDtPath();
|
||||||
}
|
CategoryPath categoryPath = dtPath.getCategoryPath();
|
||||||
|
String name = dtPath.getDataTypeName();
|
||||||
|
DataType dataType = programDataTypeManager.getDataType(categoryPath, name);
|
||||||
|
if (dataType == null || dataType.isDeleted()) {
|
||||||
|
dismissEditor(editor);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
*/
|
||||||
editor.domainObjectRestored(domainObject);
|
editor.domainObjectRestored(domainObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -519,8 +526,8 @@ public class DataTypeEditorManager
|
|||||||
PluginTool tool = plugin.getTool();
|
PluginTool tool = plugin.getTool();
|
||||||
DTMEditFunctionSignatureDialog editSigDialog = new DTMEditFunctionSignatureDialog(
|
DTMEditFunctionSignatureDialog editSigDialog = new DTMEditFunctionSignatureDialog(
|
||||||
plugin.getTool(), "Edit Function Signature", category, functionDefinition);
|
plugin.getTool(), "Edit Function Signature", category, functionDefinition);
|
||||||
editSigDialog.setHelpLocation(
|
editSigDialog
|
||||||
new HelpLocation("DataTypeManagerPlugin", "Function_Definition"));
|
.setHelpLocation(new HelpLocation("DataTypeManagerPlugin", "Function_Definition"));
|
||||||
tool.showDialog(editSigDialog);
|
tool.showDialog(editSigDialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user