Still recovering from unintended consequences of setting EditCellUse

to NULL for a read-only view. . .  Changed the command "what" so that
it will not fail on a non-edit cell.  There are likely a few other
commands that should not fail on non-edit cells because they do not
alter anything.
This commit is contained in:
Tim Edwards 2022-05-03 18:03:27 -04:00
parent f760b038d6
commit 99384a63c7
2 changed files with 11 additions and 2 deletions

View File

@ -1 +1 @@
8.3.296
8.3.297

View File

@ -930,7 +930,7 @@ CmdWhat(w, cmd)
TxCommand *cmd; /* Information about the command. */
{
int i, locargc;
bool foundAny;
bool foundAny, editNull = FALSE;
bool doList = FALSE, doListAll = FALSE;
TileTypeBitMask layers, maskBits, *rMask;
CellUse *CheckUse;
@ -974,12 +974,21 @@ CmdWhat(w, cmd)
}
#endif
/* The "what" command should not fail if there is no edit cell */
if (EditCellUse == NULL)
{
editNull = TRUE;
EditCellUse = w->w_surfaceID;
}
/* Find all the selected paint and print out the layer names. */
TTMaskZero(&layers);
(void) SelEnumPaint(&DBAllButSpaceAndDRCBits, FALSE, (bool *) NULL,
cmdWhatPaintFunc, (ClientData) &layers);
if (editNull == TRUE) EditCellUse = (CellUse *)NULL;
if (!TTMaskIsZero(&layers))
{
/* If there are any stacked types in the list, decompose them */