From be62fdc518de6ee984c0212a9de7e86313e03b12 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 5 Feb 2007 22:01:44 +0000 Subject: [PATCH] backport from HEAD: don't assert about font face errors, just log it and use the default git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@44375 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/font.cpp | 14 ++++++++++++-- src/mac/carbon/utils.cpp | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/mac/carbon/font.cpp b/src/mac/carbon/font.cpp index 7766ff4e53..9b5e4bb5a7 100644 --- a/src/mac/carbon/font.cpp +++ b/src/mac/carbon/font.cpp @@ -263,6 +263,11 @@ void wxFontRefData::MacFindFont() #ifndef __LP64__ wxMacStringToPascal( m_faceName , qdFontName ); m_macFontFamily = FMGetFontFamilyFromName( qdFontName ); + if ( m_macFontFamily == kInvalidFontFamily ) + { + wxLogDebug( wxT("ATSFontFamilyFindFromName failed for %s"), m_faceName ); + m_macFontFamily = GetAppFont(); + } #endif } } @@ -283,8 +288,13 @@ void wxFontRefData::MacFindFont() { wxMacCFStringHolder cf( m_faceName, wxLocale::GetSystemEncoding() ); ATSFontFamilyRef atsfamily = ATSFontFamilyFindFromName( cf , kATSOptionFlagsDefault ); - wxASSERT_MSG( atsfamily != (ATSFontFamilyRef) -1 , wxT("ATSFontFamilyFindFromName failed") ); - m_macFontFamily = FMGetFontFamilyFromATSFontFamilyRef( atsfamily ); + if ( atsfamily == (ATSFontFamilyRef) -1 ) + { + wxLogDebug( wxT("ATSFontFamilyFindFromName failed for %s"), m_faceName ); + m_macFontFamily = GetAppFont(); + } + else + m_macFontFamily = FMGetFontFamilyFromATSFontFamilyRef( atsfamily ); } } diff --git a/src/mac/carbon/utils.cpp b/src/mac/carbon/utils.cpp index 85a38d0b49..d491c42b04 100644 --- a/src/mac/carbon/utils.cpp +++ b/src/mac/carbon/utils.cpp @@ -863,6 +863,7 @@ void wxMacControl::Init() void wxMacControl::Dispose() { + wxASSERT_MSG( m_controlRef != NULL , wxT("Control Handle already NULL, Dispose called twice ?") ); wxASSERT_MSG( IsValidControlHandle(m_controlRef) , wxT("Invalid Control Handle (maybe already released) in Dispose") ); // we cannot check the ref count here anymore, as autorelease objects might delete their refs later