[comp.sys.mac] TransSkel, TransEdit bugs

dubois@uwmacc.UUCP (Paul DuBois) (01/22/87)

Owen Hartnett reported a couple of bugs to me that he discovered
while porting the Trans stuff to Lightspeed Pascal.

In TransEdit, an Open of an existing file followed by a Save
results in an FSOpen attempt on an uninitialized SFReply record.
Fix:
	in TransEdit.c, in the SaveFile function, after the
SyncAllGlobals call, put this line:
		tmpFile = editFile;
---
In the TranSkel ManyWind demo, there should be a SetPort to the window
to be painted right before the case statement that selects the color
(this is in ManyWind.c).
Without it, the window that gets painted won't always be the front
window.  (This bug did not occur in earlier versions of TransSkel due
to a kludge that was present in handling of activate procedures.  When
I fixed the kludge, it broke ManyWind.)
---
I've also discovered a bug in the window zooming code.  Seems that
ZoomWindow expects the port to be set to the window that's getting zoomed.
This won't be the case if under the following circumstances:

	put up any window
	put up a zoomable window in front.
	dispose of the first window (SkelRmveWind).
	click in the zoombox of the second window.
	crash.

Reason:
	in the third step, SkelRmveWind calls the window handler's
clobber proc.  All handler procs set the port to the window being
handled first.  The clobber proc processor, in addition, resets the
port to the screen port after calling the window's clobber proc, to
avoid a dangling port.  Thus, clicking in the zoom box at the fourth
step results in zooming a window when the current port is the screen
port.  Various unfortunate things occur.

Fix:
	put a SetPort to the window being zoomed right before the
ZoomWindow statement in DoZoom in TransSkel.c.

Users of Owen's port should do this, too.

---
Paul DuBois     UUCP: {allegra,ihnp4,seismo}!uwvax!uwmacc!dubois    |
                ARPA: dubois@easter                               --+--
                      dubois@rhesus                                 |
                                                                    |
"Don't we have enough madmen around here already?"
                                 I Samuel 21:15