mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-08-28 17:15:13 +02:00
Corrected the last commit for fixing the "drc count" command option,
which had been changed a few months back to remove the individual cell count and only list the top level cell. The behavior has been changed a bit so that "list" returns values for the top level cell only, but "listall" returns a complete list. "drc list count total" gives the DRC count for the top cell, but "drc listall count total" gives the DRC count for everything (probably not very useful). Also: Implemented a behavior by request to automatically removed the (UNNAMED) cell whenever a new cell is loaded and the (UNNAMED) cell has not been modified.
This commit is contained in:
+21
-1
@@ -289,13 +289,14 @@ DBWloadWindow(window, name, ignoreTech, expand, dereference)
|
||||
bool expand; /* Indicates whether or not to expand the cell */
|
||||
bool dereference; /* If TRUE, ignore path references in the input */
|
||||
{
|
||||
CellDef *newEditDef;
|
||||
CellDef *newEditDef, *deleteDef;
|
||||
CellUse *newEditUse;
|
||||
void DisplayWindow();
|
||||
int res, newEdit, error_val;
|
||||
int xadd, yadd;
|
||||
Rect loadBox;
|
||||
char *rootname;
|
||||
bool isUnnamed;
|
||||
int UnexpandFunc(); /* forward declaration */
|
||||
|
||||
loadBox.r_xbot = loadBox.r_ybot = 0;
|
||||
@@ -305,6 +306,19 @@ DBWloadWindow(window, name, ignoreTech, expand, dereference)
|
||||
newEdit = !WindSearch((WindClient) DBWclientID, (ClientData) NULL,
|
||||
(Rect *) NULL, dbwLoadFunc, (ClientData) window);
|
||||
|
||||
/* The (UNNAMED) cell generally gets in the way, so delete it if */
|
||||
/* any new cell is loaded and (UNNAMED) has no contents. */
|
||||
|
||||
if (window->w_surfaceID == (ClientData)NULL)
|
||||
deleteDef = NULL;
|
||||
else
|
||||
{
|
||||
deleteDef = ((CellUse *)window->w_surfaceID)->cu_def;
|
||||
if (strcmp(deleteDef->cd_name, "(UNNAMED)") ||
|
||||
deleteDef->cd_flags & (CDMODIFIED|CDBOXESCHANGED|CDSTAMPSCHANGED))
|
||||
deleteDef = NULL;
|
||||
}
|
||||
|
||||
if ((name == (char *) NULL) || (name[0] == '\0'))
|
||||
{
|
||||
/*
|
||||
@@ -503,6 +517,12 @@ DBWloadWindow(window, name, ignoreTech, expand, dereference)
|
||||
if (newEdit)
|
||||
DBWAreaChanged(newEditDef, &newEditDef->cd_bbox, DBW_ALLWINDOWS,
|
||||
&DBAllButSpaceBits);
|
||||
|
||||
/* If the cell before loading was (UNNAMED) and it was */
|
||||
/* never modified, then delete it now. */
|
||||
|
||||
if (deleteDef != NULL)
|
||||
DBCellDelete(deleteDef->cd_name, TRUE);
|
||||
}
|
||||
|
||||
/* This function is called for each cell whose expansion status changed.
|
||||
|
||||
Reference in New Issue
Block a user