Problem: 1660391

Title: (KeyEvent)Command-period key combo will not dismiss (Cancel) dialogs anymore

Received: Jun 3 1997 2:20PM


Command-period key combo will not dismiss (Cancel) dialogs anymore. The problem appears to be in TDispatcher::KeyEventToComponents where it calls event->fText.Empty() (thus blasting the length byte of the CStr2) it then copies the keycode back into the string but does not set the length byte. I assume this was broken in the conversion from char to CStr2...

Steps to reproduce problem:

Build DemoDialogs bring up one of the dialog boxes with a Cancel button. Hitting escape cancels out OK (since it goes through a different code path) but hitting Command-Period does not (TDialogBehavior still has the code in to supposedly support this but when it gets the event it does a string compare against "." and since the length byte of event->fText is 0 this fails).


Fix:

This has been fixed. A statement was added to TDispatcher::KeyEventToComponents that sets the length byte of the string (see suggested fix in 1615672, last item).