diff --git a/VERSION b/VERSION index cc6f30d2..84fa2b89 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.501 +8.3.502 diff --git a/database/DBcellname.c b/database/DBcellname.c index faf10fc6..e493a3cf 100644 --- a/database/DBcellname.c +++ b/database/DBcellname.c @@ -224,7 +224,7 @@ DBCellDelete(cellname, force) { HashEntry *entry; CellDef *celldef; - CellUse *celluse; + CellUse *celluse, *lastuse; bool result; entry = HashLookOnly(&dbCellDefTable, cellname); @@ -259,6 +259,29 @@ DBCellDelete(cellname, force) return FALSE; } + /* 2nd pass: If there are instances of the cell in */ + /* internal cells like SelectDef, etc., then remove the use */ + /* from the definition. */ + + lastuse = NULL; + celluse = celldef->cd_parents; + while (celluse != (CellUse *) NULL) + { + if (celluse->cu_parent != (CellDef *)NULL) + { + if ((celluse->cu_parent->cd_flags & CDINTERNAL) == CDINTERNAL) + { + DBDeleteCell(celluse); + celluse = lastuse; + } + } + lastuse = celluse; + if (lastuse == NULL) + celluse = celldef->cd_parents; + else + celluse = celluse->cu_nextuse; + } + /* Cleared to delete. . . now prompt user if the cell has changes. */ /* Last chance to save! */