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:
parent
e36560fb90
commit
b0ed7f09a9
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue