FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Font code in control.d

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
baxissimo



Joined: 23 Oct 2006
Posts: 241
Location: Tokyo, Japan

PostPosted: Fri Jan 16, 2009 10:17 pm    Post subject: Font code in control.d Reply with quote

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.
Back to top
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Mon Jan 19, 2009 6:10 pm    Post subject: Re: Font code in control.d Reply with quote

You're right, it's always falling back to the old font. I committed the fix to svn.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group