From e74d06a33b48f4335bf628da028c2a02676a92a6 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sat, 26 Mar 2005 08:34:51 +0000 Subject: [PATCH] Fix for link error git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33071 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/fontmap.h | 9 +++------ src/common/fontmap.cpp | 10 ++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/include/wx/fontmap.h b/include/wx/fontmap.h index 2dee4a244b..d8149fab21 100644 --- a/include/wx/fontmap.h +++ b/include/wx/fontmap.h @@ -60,14 +60,8 @@ public: virtual ~wxFontMapperBase(); // return instance of the wxFontMapper singleton -#if wxUSE_GUI - // GUI code needs to know it's a wxFontMapper because there - // are additional methods in the subclass. - static wxFontMapper *Get(); -#else // wxBase code only cares that it's a wxFontMapperBase static wxFontMapperBase *Get(); -#endif // set the singleton to 'mapper' instance and return previous one static wxFontMapper *Set(wxFontMapper *mapper); @@ -235,6 +229,9 @@ public: // the title for the dialogs (note that default is quite reasonable) void SetDialogTitle(const wxString& title) { m_titleDialog = title; } + // GUI code needs to know it's a wxFontMapper because there + // are additional methods in the subclass. + static wxFontMapper *Get(); protected: // GetAltForEncoding() helper: tests for the existence of the given diff --git a/src/common/fontmap.cpp b/src/common/fontmap.cpp index be6bf5703f..87b28c7bd2 100644 --- a/src/common/fontmap.cpp +++ b/src/common/fontmap.cpp @@ -163,6 +163,16 @@ wxFontMapper::~wxFontMapper() { } +/* 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(); +} + wxFontEncoding wxFontMapper::CharsetToEncoding(const wxString& charset, bool interactive) { -- 2.45.2