baxissimo
Joined: 23 Oct 2006 Posts: 241 Location: Tokyo, Japan
|
Posted: Fri Jan 16, 2009 10:17 pm Post subject: Font code in control.d |
|
|
This code doesn't look right to me:
Code: |
private static Font _createCompatibleFont()
{
Font result;
//result = _createOldFont();
try
{
OSVERSIONINFOA osi;
osi.dwOSVersionInfoSize = osi.sizeof;
if(GetVersionExA(&osi) && osi.dwMajorVersion >= 5)
{
// "MS Shell Dlg" / "MS Shell Dlg 2" not always supported.
result = new Font("MS Shell Dlg 2", result.getSize(GraphicsUnit.POINT), GraphicsUnit.POINT);
}
}
catch
{
}
|
Since 'result' is uninitialized, the code in the try{} will always fail because it attempts to call result.getSize(...), even though 'result' is always null at that point. |
|