From 1fee6e257780f17b4d53b48aa0e7d2ac69664595 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Mar 2008 13:14:58 +0000 Subject: [PATCH] remove wxTextAttr::CreateFont(); return wxNullFont from GetFont() if we have no font attributes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/textctrl.h | 5 +---- src/common/textcmn.cpp | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h index 926e6c226b..23f9a46549 100644 --- a/include/wx/textctrl.h +++ b/include/wx/textctrl.h @@ -278,9 +278,6 @@ public: // Partial equality test taking flags into account bool EqPartial(const wxTextAttr& attr, int flags) const; - // Create font from font attributes. - wxFont CreateFont() const; - // Get attributes from font. bool GetFontAttributes(const wxFont& font, int flags = wxTEXT_ATTR_FONT); @@ -337,7 +334,7 @@ public: const wxString& GetFontFaceName() const { return m_fontFaceName; } wxFontEncoding GetFontEncoding() const { return m_fontEncoding; } - wxFont GetFont() const { return CreateFont(); } + wxFont GetFont() const; const wxString& GetCharacterStyleName() const { return m_characterStyleName; } const wxString& GetParagraphStyleName() const { return m_paragraphStyleName; } diff --git a/src/common/textcmn.cpp b/src/common/textcmn.cpp index 1e0a0a0f56..c69ba3aea1 100644 --- a/src/common/textcmn.cpp +++ b/src/common/textcmn.cpp @@ -297,8 +297,11 @@ bool wxTextAttr::EqPartial(const wxTextAttr& attr, int flags) const } // Create font from font attributes. -wxFont wxTextAttr::CreateFont() const +wxFont wxTextAttr::GetFont() const { + if ( !HasFont() ) + return wxNullFont; + int fontSize = 10; if (HasFontSize()) fontSize = GetFontSize();