Corrected an issue with "flatten -doinplace" with no cell name

argument, which is supposed to flatten all selected instances.
After flattening, instead of deleting the instance from the
cell, it deleted the instance from the selection, leaving the
one in the cell.
This commit is contained in:
Tim Edwards
2023-07-28 15:25:42 -04:00
parent 89f1c4ee67
commit 6b5bd149fc
4 changed files with 70 additions and 5 deletions
+5 -3
View File
@@ -553,12 +553,13 @@ DBFlatCopyMaskHints(scx, xMask, targetUse)
*/
void
DBFlattenInPlace(use, dest, xMask, dolabels, toplabels)
DBFlattenInPlace(use, dest, xMask, dolabels, toplabels, doclear)
CellUse *use; /* Cell use to flatten */
CellUse *dest; /* Cell use to flatten into */
int xMask; /* Search mask for flattening */
bool dolabels; /* Option to flatten labels */
bool toplabels; /* Option to selectively flatten top-level labels */
bool doclear; /* Delete the original use if TRUE */
{
Label *lab;
SearchContext scx;
@@ -678,7 +679,8 @@ DBFlattenInPlace(use, dest, xMask, dolabels, toplabels)
lab->lab_flags &= ~LABEL_GENERATE;
/* Remove the use from the parent def */
DBDeleteCell(scx.scx_use);
if (doclear)
DBDeleteCell(scx.scx_use);
/* Was: &scx.scx_use->cu_def->cd_bbox */
DBWAreaChanged(dest->cu_def, &scx.scx_use->cu_bbox,
@@ -730,7 +732,7 @@ dbCellFlattenCellsFunc(scx, clientData)
toplabels = fad->fad_toplabels;
use = scx->scx_use;
DBFlattenInPlace(use, dest, xMask, dolabels, toplabels);
DBFlattenInPlace(use, dest, xMask, dolabels, toplabels, FALSE);
return 2;
}