Case of default font name not ignored in object inspector
Original Reporter info from Mantis: wp @wpam
-
Reporter name:
Original Reporter info from Mantis: wp @wpam
- Reporter name:
Description:
The IDE does NOT ignore the case of the "default" font:
- Open a new project
- Add two labels
- Both labels have the same font.
- Don't touch the first label, it will be left for comparison. It will have the font "default" all the time.
- Go to the Font.Name property of the second label and select one of the fonts proposed in the combobox.
- See the font of the second label changing.
- Go back to the Font.Name property of the second label and type in "default", all in lower-case
- Notice that the property jumps to "Default", and the appearance of both labels is different.
- If the Object Inspector would ignore the case of the font name then both labels should have the same font!
- Go back to the Font.Name property of the second label and edit the first character from "D" to "d", i.e. the font name really is "default" now
- Now both labels look the same.
This makes changing of fonts of components or forms unnecessarily complicated if they have hard-coded font names and you want to return to the default font (some Turbo Power components are such candidates...)
Additional information:
The attached patch fixes the string comparison in TWin32WidgetSet.CreateFontIndirect. (Note, it does not use the new function IsFontNameDefault, introduced in report # 31940, because the string comparison here is not against the constant string 'default', but against DefFontData.Name).
The patch is not complete, though, because still the uppercase font name 'Default' is in the fontname combobox of the object inspector after the steps described above. Therefore, the property is highlighted in the OI as not being a default value (although, of course, it actually is).
Mantis conversion info:
- Mantis ID: 31963
- OS: Windows
- OS Build: win10
- Platform: Windows
- Version: 1.9 (SVN)
- Fixed in revision: r55221 (#31045c96)