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;
|
return;
|
||||||
}
|
}
|
||||||
/* create the new def */
|
/* create the new def */
|
||||||
if (newdef = DBCellLookDef(destname))
|
newdef = DBCellLookDef(destname);
|
||||||
|
if ((newdef != NULL) && (dobox == FALSE))
|
||||||
{
|
{
|
||||||
TxError("%s already exists\n",destname);
|
TxError("%s already exists\n",destname);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
newdef = DBCellNewDef(destname);
|
else if (newdef == NULL)
|
||||||
ASSERT(newdef, "CmdFlatten");
|
{
|
||||||
DBCellSetAvail(newdef);
|
newdef = DBCellNewDef(destname);
|
||||||
|
ASSERT(newdef, "CmdFlatten");
|
||||||
|
DBCellSetAvail(newdef);
|
||||||
|
}
|
||||||
newuse = DBCellNewUse(newdef, (char *) NULL);
|
newuse = DBCellNewUse(newdef, (char *) NULL);
|
||||||
(void) StrDup(&(newuse->cu_id), "Flattened cell");
|
(void) StrDup(&(newuse->cu_id), "Flattened cell");
|
||||||
DBSetTrans(newuse, &GeoIdentityTransform);
|
DBSetTrans(newuse, &GeoIdentityTransform);
|
||||||
|
|
@ -2063,5 +2067,6 @@ CmdFlatten(w, cmd)
|
||||||
if (xMask != CU_DESCEND_ALL)
|
if (xMask != CU_DESCEND_ALL)
|
||||||
DBCellCopyAllCells(&scx, xMask, flatDestUse, (Rect *)NULL);
|
DBCellCopyAllCells(&scx, xMask, flatDestUse, (Rect *)NULL);
|
||||||
|
|
||||||
|
DBCellDeleteUse(flatDestUse);
|
||||||
UndoEnable();
|
UndoEnable();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue