]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/font.cpp
Fix hangups when using sockets under OS X.
[wxWidgets.git] / src / osx / carbon / font.cpp
index c7998cd5a70ab6227b255f29a53da2291149d06f..c37e0c8f1e72c35fdd426f660bcd759d4504fbb9 100644 (file)
@@ -442,7 +442,7 @@ void wxFontRefData::MacFindFont()
             kATSUQDCondensedTag ,
             kATSUQDExtendedTag ,
         };
-        ByteCount atsuSizes[sizeof(atsuTags) / sizeof(ATSUAttributeTag)] =
+        ByteCount atsuSizes[WXSIZEOF(atsuTags)] =
         {
             sizeof( ATSUFontID ) ,
             sizeof( Fixed ) ,
@@ -460,7 +460,7 @@ void wxFontRefData::MacFindFont()
         Fixed atsuSize = IntToFixed( m_info.m_pointSize );
         ATSUVerticalCharacterType kHorizontal = kATSUStronglyHorizontal;
         FMFontStyle addQDStyle = m_info.m_atsuAdditionalQDStyles;
-        ATSUAttributeValuePtr    atsuValues[sizeof(atsuTags) / sizeof(ATSUAttributeTag)] =
+        ATSUAttributeValuePtr    atsuValues[WXSIZEOF(atsuTags)] =
         {
             &m_info.m_atsuFontID ,
             &atsuSize ,
@@ -474,7 +474,7 @@ void wxFontRefData::MacFindFont()
 
         status = ::ATSUSetAttributes(
                                      (ATSUStyle)m_macATSUStyle,
-                                     sizeof(atsuTags) / sizeof(ATSUAttributeTag) ,
+                                     WXSIZEOF(atsuTags),
                                      atsuTags, atsuSizes, atsuValues);
 
         wxASSERT_MSG( status == noErr , wxT("couldn't modify ATSU style") );
@@ -1058,7 +1058,10 @@ void wxNativeFontInfo::EnsureValid()
         // ATSUFontID and FMFont are equivalent
         FMFontStyle intrinsicStyle = 0 ;
         OSStatus status = FMGetFontFromFontFamilyInstance( m_qdFontFamily , m_qdFontStyle , (FMFont*)&m_atsuFontID , &intrinsicStyle);
-        wxASSERT_MSG( status == noErr , wxT("couldn't get an ATSUFont from font family") );
+        if ( status != noErr )
+        {
+            wxFAIL_MSG( wxT("couldn't get an ATSUFont from font family") );
+        }
         m_atsuAdditionalQDStyles = m_qdFontStyle & (~intrinsicStyle );
         m_atsuFontValid = true;
     }
@@ -1144,7 +1147,7 @@ bool wxNativeFontInfo::FromString(const wxString& s)
 {
     long l;
 
-    wxStringTokenizer tokenizer(s, _T(";"));
+    wxStringTokenizer tokenizer(s, wxT(";"));
 
     wxString token = tokenizer.GetNextToken();
     //
@@ -1195,7 +1198,7 @@ wxString wxNativeFontInfo::ToString() const
 {
     wxString s;
 
-    s.Printf(_T("%d;%d;%d;%d;%d;%d;%s;%d"),
+    s.Printf(wxT("%d;%d;%d;%d;%d;%d;%s;%d"),
              0,                                 // version
              m_pointSize,
              m_family,