Modified the "flatten" command so that when used with "-dobox", it

is not necessary that the target cell not exist.  That allows a
layout to be flattened into a destination in pieces.  Also found
that the "flatten" command never frees memory for the CellUse it
creates for the copy, so fixed that as well.
This commit is contained in:
Tim Edwards
2021-06-23 17:41:32 -04:00
parent e36560fb90
commit b0ed7f09a9
2 changed files with 10 additions and 5 deletions
+1 -1
View File
@@ -1 +1 @@
8.3.181
8.3.182
+9 -4
View File
@@ -2008,14 +2008,18 @@ CmdFlatten(w, cmd)
return;
}
/* create the new def */
if (newdef = DBCellLookDef(destname))
newdef = DBCellLookDef(destname);
if ((newdef != NULL) && (dobox == FALSE))
{
TxError("%s already exists\n",destname);
return;
}
newdef = DBCellNewDef(destname);
ASSERT(newdef, "CmdFlatten");
DBCellSetAvail(newdef);
else if (newdef == NULL)
{
newdef = DBCellNewDef(destname);
ASSERT(newdef, "CmdFlatten");
DBCellSetAvail(newdef);
}
newuse = DBCellNewUse(newdef, (char *) NULL);
(void) StrDup(&(newuse->cu_id), "Flattened cell");
DBSetTrans(newuse, &GeoIdentityTransform);
@@ -2063,5 +2067,6 @@ CmdFlatten(w, cmd)
if (xMask != CU_DESCEND_ALL)
DBCellCopyAllCells(&scx, xMask, flatDestUse, (Rect *)NULL);
DBCellDeleteUse(flatDestUse);
UndoEnable();
}