X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/55d99c7a77789ff4904bf96eddca3715eb5af9b9..cc402e6431b66a8eb7d567caa55a1bece42902b7:/src/common/fontcmn.cpp?ds=inline diff --git a/src/common/fontcmn.cpp b/src/common/fontcmn.cpp index d448cd6238..7c3412b48d 100644 --- a/src/common/fontcmn.cpp +++ b/src/common/fontcmn.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "fontbase.h" #endif @@ -34,6 +34,12 @@ #endif // WX_PRECOMP #include "wx/gdicmn.h" + +#if defined(__WXMSW__) + #include "wx/msw/private.h" // includes windows.h for LOGFONT + #include "wx/msw/winundef.h" +#endif + #include "wx/fontutil.h" // for wxNativeFontInfo #include "wx/fontmap.h" @@ -125,25 +131,6 @@ bool wxFontBase::IsFixedWidth() const return GetFamily() == wxFONTFAMILY_TELETYPE; } -wxNativeFontInfo *wxFontBase::GetNativeFontInfo() const -{ -#ifdef wxNO_NATIVE_FONTINFO - wxNativeFontInfo *fontInfo = new wxNativeFontInfo(); - - fontInfo->SetPointSize(GetPointSize()); - fontInfo->SetFamily((wxFontFamily)GetFamily()); - fontInfo->SetStyle((wxFontStyle)GetStyle()); - fontInfo->SetWeight((wxFontWeight)GetWeight()); - fontInfo->SetUnderlined(GetUnderlined()); - fontInfo->SetFaceName(GetFaceName()); - fontInfo->SetEncoding(GetEncoding()); - - return fontInfo; -#else - return (wxNativeFontInfo *)NULL; -#endif -} - void wxFontBase::DoSetNativeFontInfo(const wxNativeFontInfo& info) { #ifdef wxNO_NATIVE_FONTINFO @@ -162,11 +149,10 @@ void wxFontBase::DoSetNativeFontInfo(const wxNativeFontInfo& info) wxString wxFontBase::GetNativeFontInfoDesc() const { wxString fontDesc; - wxNativeFontInfo *fontInfo = GetNativeFontInfo(); + const wxNativeFontInfo *fontInfo = GetNativeFontInfo(); if ( fontInfo ) { fontDesc = fontInfo->ToString(); - delete fontInfo; } return fontDesc; @@ -175,11 +161,10 @@ wxString wxFontBase::GetNativeFontInfoDesc() const wxString wxFontBase::GetNativeFontInfoUserDesc() const { wxString fontDesc; - wxNativeFontInfo *fontInfo = GetNativeFontInfo(); + const wxNativeFontInfo *fontInfo = GetNativeFontInfo(); if ( fontInfo ) { fontDesc = fontInfo->ToUserString(); - delete fontInfo; } return fontDesc; @@ -356,7 +341,7 @@ wxString wxNativeFontInfo::ToString() const void wxNativeFontInfo::Init() { - pointSize = wxNORMAL_FONT->GetPointSize(); + pointSize = 0; family = wxFONTFAMILY_DEFAULT; style = wxFONTSTYLE_NORMAL; weight = wxFONTWEIGHT_NORMAL;