diff --git a/VERSION b/VERSION index 96a4cc24..8e0c470c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.195 +8.3.196 diff --git a/commands/CmdLQ.c b/commands/CmdLQ.c index 26e1f225..73f4a26a 100644 --- a/commands/CmdLQ.c +++ b/commands/CmdLQ.c @@ -1372,7 +1372,7 @@ CmdPort(w, cmd) bool nonEdit = FALSE, doQuiet = FALSE; Label *lab, *sl; Rect editBox, tmpArea; - CellDef *editDef = EditCellUse->cu_def; + CellDef *editDef; static char *cmdPortOption[] = { @@ -1462,6 +1462,12 @@ CmdPort(w, cmd) PORT_SHAPE_THRU }; + windCheckOnlyWindow(&w, DBWclientID); + if (w == (MagWindow *) NULL) + editDef = EditCellUse->cu_def; + else + editDef = ((CellUse *) w->w_surfaceID)->cu_def; + argstart = 1; argc = cmd->tx_argc; @@ -2239,9 +2245,7 @@ CmdProperty(w, cmd) windCheckOnlyWindow(&w, DBWclientID); if (w == (MagWindow *) NULL) - { def = EditCellUse->cu_def; - } else def = ((CellUse *) w->w_surfaceID)->cu_def; diff --git a/dbwind/DBWtools.c b/dbwind/DBWtools.c index 31df5c9a..16cbb6be 100644 --- a/dbwind/DBWtools.c +++ b/dbwind/DBWtools.c @@ -304,12 +304,31 @@ bool ToolGetEditBox(rect) Rect *rect; { + CellDef *editDef; + if (boxRootDef == NULL) { TxError("Box must be present\n"); return FALSE; } - if (EditRootDef != boxRootDef) + + /* Added 8/4/2021---Don't require that EditRootDef be non-NULL. */ + + if (EditRootDef == NULL) + { + MagWindow *w; + w = ToolGetBoxWindow(rect, NULL); + + windCheckOnlyWindow(&w, DBWclientID); + if (w == (MagWindow *) NULL) + editDef = EditCellUse->cu_def; + else + editDef = ((CellUse *) w->w_surfaceID)->cu_def; + } + else + editDef = EditRootDef; + + if (editDef != boxRootDef) { TxError("The box isn't in a window on the edit cell.\n"); return FALSE;