1. renamed wxFontMapper::IsWxFontMapper() to IsDummy() (with reverse semantics)

2. added wxFontMapper::Reset() to only do the cast needed when deleting
   the font mapper object once
3. reset the dummy font mapper created during the app initialization in
   wxFontMapperModule and not in init.cpp


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39624 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-06-07 17:49:27 +00:00
parent 4e3e485bc8
commit d5bfbd9ab8
4 changed files with 49 additions and 29 deletions

View File

@@ -160,17 +160,17 @@ wxFontMapper::~wxFontMapper()
{
}
bool wxFontMapper::IsWxFontMapper()
{ return true; }
/* static */
wxFontMapper *wxFontMapper::Get()
{
wxFontMapperBase *fontmapper = wxFontMapperBase::Get();
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.") );
// Now return it anyway because there's a chance the GUI code might just
// 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;
}
wxFontEncoding