- wxASSERT_MSG(fontmapper->IsWxFontMapper(), wxT("GUI code requested a wxFontMapper but we only have a wxFontMapperBase."));
+ wxASSERT_MSG( !fontmapper->IsDummy(),
+ wxT("GUI code requested a wxFontMapper but we only have a wxFontMapperBase.") );
+
- // only want to call wxFontMapperBase functions.
- return (wxFontMapper*)fontmapper;
+ // only want to call wxFontMapperBase functions and it's better than
+ // crashing by returning NULL
+ return (wxFontMapper *)fontmapper;
{
// we tried to find a match with facename -- now try without it
fontinfo = GetConfig()->Read(encName);
}
{
// we tried to find a match with facename -- now try without it
fontinfo = GetConfig()->Read(encName);
}
*info = retData.EncodingInfo();
info->encoding = retData.GetEncoding();
#if wxUSE_CONFIG && wxUSE_FILECONFIG
// remember this in the config
*info = retData.EncodingInfo();
info->encoding = retData.GetEncoding();
#if wxUSE_CONFIG && wxUSE_FILECONFIG
// remember this in the config
- wxFontMapperPathChanger path(this,
- FONTMAPPER_FONT_FROM_ENCODING_PATH);
- if ( path.IsOk() )
+ wxFontMapperPathChanger path2(this,
+ FONTMAPPER_FONT_FROM_ENCODING_PATH);
+ if ( path2.IsOk() )
- wxFontMapperPathChanger path(this,
- FONTMAPPER_FONT_FROM_ENCODING_PATH);
- if ( path.IsOk() )
+ wxFontMapperPathChanger path2(this,
+ FONTMAPPER_FONT_FROM_ENCODING_PATH);
+ if ( path2.IsOk() )
wxNativeEncodingInfo info;
if ( !GetAltForEncoding(encoding, &info, facename, interactive) )
return false;
wxNativeEncodingInfo info;
if ( !GetAltForEncoding(encoding, &info, facename, interactive) )
return false;