Object Inspector: Generated method name may contain invalid chars
Original Reporter info from Mantis: Ask
-
Reporter name: Alexander S. Klenin
Original Reporter info from Mantis: Ask
- Reporter name: Alexander S. Klenin
Description:
After a double-click on empty event in object inspector,
TMethodPropertyEditor.GetFormMethodName function is called.
For nested properties, it calls PropertyHook.GetObjectName, which,
in turn, calls TCollectionItem.DisplayName (!).
For many TCollectionItem descendants, DisplayName is generated from
something like Caption, so may contain arbitrary characters.
GetFormMethodName then tries to filter the name, but does this
by trying to exclude 'bad' characters instead of only admitting 'good' ones.
Attached patch tries to solve both issues.
Note that although filtering change is, strictly speaking,
unnecessary after the fix to GetObjectName,
it is IMO still good from the standpoint of general code correctness.
Steps to reproduce:
- open tachart/demo/basic/demo.lpi
- set Chart1.BottomAxis.Caption to "Bottom Axis"
- double-click Chart1.BottomAxis.OnMartText event
Mantis conversion info:
- Mantis ID: 14652
- Version: 0.9.29 (SVN)
- Fixed in revision: 21854 (#937fddda).