X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e74d06a33b48f4335bf628da028c2a02676a92a6..6d94009faa51ae4018e08ced13cfdfe575b03f08:/src/common/fontmap.cpp diff --git a/src/common/fontmap.cpp b/src/common/fontmap.cpp index 87b28c7bd2..be05e44b85 100644 --- a/src/common/fontmap.cpp +++ b/src/common/fontmap.cpp @@ -163,14 +163,17 @@ wxFontMapper::~wxFontMapper() { } +bool wxFontMapper::IsWxFontMapper() +{ return true; } + /* static */ -// Declared as returning wxFontMapper when wxUSE_GUI=1. Unfortunately, it's -// only implemented in wxBase library. Note that if the last resort -// is taken and GUI code tries to treat it as a real wxFontMapper -// then you'd be in trouble. wxFontMapper *wxFontMapper::Get() { - return (wxFontMapper*)wxFontMapperBase::Get(); + wxFontMapperBase *fontmapper = wxFontMapperBase::Get(); + wxASSERT_MSG(fontmapper->IsWxFontMapper(), 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; } wxFontEncoding