Allow constructing wxGTK wxTextMeasure with NULL font.

The font is explicitly documented as being possibly NULL in the base class and
wxMSW handles NULL font just fine, so also handle it in the GTK version.

See #14706.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72844 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-11-01 17:15:15 +00:00
parent 18764039ab
commit e0da9e871a
4 changed files with 16 additions and 7 deletions

View File

@@ -53,6 +53,13 @@ wxTextMeasureBase::wxTextMeasureBase(const wxWindow *win, const wxFont *theFont)
m_useDCImpl = false;
}
wxFont wxTextMeasureBase::GetFont() const
{
return m_font ? *m_font
: m_win ? m_win->GetFont()
: m_dc->GetFont();
}
void wxTextMeasureBase::CallGetTextExtent(const wxString& string,
wxCoord *width,
wxCoord *height,