Modified the cell load routine to avoid creating an "undo" record

for loading a cell after displaying an unmodified "(UNNAMED)" cell,
because "(UNNAMED)" will be deleted, leaving the undo record
invalid and causing a crash if it is attempted to be invoked.
This commit is contained in:
Tim Edwards 2021-05-23 12:07:31 -04:00
parent 0809dddbe0
commit 5e02726f7f
2 changed files with 4 additions and 4 deletions

View File

@ -1 +1 @@
8.3.167
8.3.168

View File

@ -326,6 +326,7 @@ DBWloadWindow(window, name, flags)
{
deleteDef = ((CellUse *)window->w_surfaceID)->cu_def;
if (strcmp(deleteDef->cd_name, "(UNNAMED)") ||
(GrDisplayStatus == DISPLAY_SUSPEND) ||
deleteDef->cd_flags & (CDMODIFIED|CDBOXESCHANGED|CDSTAMPSCHANGED))
deleteDef = NULL;
}
@ -497,7 +498,7 @@ DBWloadWindow(window, name, flags)
if (newEdit)
{
if (EditCellUse && EditRootDef)
if ((EditCellUse && EditRootDef) && (deleteDef == NULL))
{
DBWUndoOldEdit(EditCellUse, EditRootDef,
&EditToRootTransform, &RootToEditTransform);
@ -555,8 +556,7 @@ DBWloadWindow(window, name, flags)
/* this doesn't happen within suspendall ... resumeall. */
if (deleteDef != NULL)
if (GrDisplayStatus != DISPLAY_SUSPEND)
DBCellDelete(deleteDef->cd_name, TRUE);
DBCellDelete(deleteDef->cd_name, TRUE);
}
/* This function is called for each cell whose expansion status changed.