Patch forTCustomMaskEdit to correct behaviour when input not matches the mask and the editor is already hidden
Original Reporter info from Mantis: Lutz Maendle @lmaendle
-
Reporter name: Lutz Mändle
Original Reporter info from Mantis: Lutz Maendle @lmaendle
- Reporter name: Lutz Mändle
Description:
When using the mask edit capabilities in a TDBGrid the problem arises, that when the input not matches the mask, the DoExit procedure calls SetFocus, but the TDBGrid logic has already hidden the InplaceEditor. Then two exceptions are fired consecutively which leads to an application crash.
The first exception comes from the SetFocus call on a hidden control, the second exception comes from the MaskEdit logic, to signal that the input not matches the mask.
The attached patch checks whether the editor can get the focus and avoids the first exception.
Mantis conversion info:
- Mantis ID: 30482
- Version: 1.6
- Fixed in revision: r52837 (#5bf9ffa8)
- Target version: 1.8
- LazTarget: 1.6.2