- 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;
long value = n == -1 ? (long)wxFONTENCODING_UNKNOWN : (long)encoding;
if ( !config->Write(charset, value) )
{
long value = n == -1 ? (long)wxFONTENCODING_UNKNOWN : (long)encoding;
if ( !config->Write(charset, value) )
{
{
// 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);
}
{
// ask the user if he wants to override found alternative encoding
msg.Printf(_("No font for displaying text in encoding '%s' found,\nbut an alternative encoding '%s' is available.\nDo you want to use this encoding (otherwise you will have to choose another one)?"),
{
// ask the user if he wants to override found alternative encoding
msg.Printf(_("No font for displaying text in encoding '%s' found,\nbut an alternative encoding '%s' is available.\nDo you want to use this encoding (otherwise you will have to choose another one)?"),
*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;