initialize m_hFont in the beginning of wxFontRefData::Init() to avoid freeing invalid font handle in SetXXX() called afterwards; removed hard TABs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60235 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -321,26 +321,26 @@ void wxFontRefData::Init(int pointSize,
|
|||||||
const wxString& faceName,
|
const wxString& faceName,
|
||||||
wxFontEncoding encoding)
|
wxFontEncoding encoding)
|
||||||
{
|
{
|
||||||
m_sizeUsingPixels = sizeUsingPixels;
|
|
||||||
if ( m_sizeUsingPixels )
|
|
||||||
SetPixelSize(pixelSize);
|
|
||||||
else
|
|
||||||
SetPointSize(pointSize);
|
|
||||||
|
|
||||||
SetStyle(style);
|
|
||||||
SetWeight(weight);
|
|
||||||
SetUnderlined(underlined);
|
|
||||||
|
|
||||||
m_hFont = NULL;
|
m_hFont = NULL;
|
||||||
|
|
||||||
// set the family/facename
|
m_sizeUsingPixels = sizeUsingPixels;
|
||||||
SetFamily(family);
|
if ( m_sizeUsingPixels )
|
||||||
if ( !faceName.empty() )
|
SetPixelSize(pixelSize);
|
||||||
SetFaceName(faceName);
|
else
|
||||||
|
SetPointSize(pointSize);
|
||||||
|
|
||||||
|
SetStyle(style);
|
||||||
|
SetWeight(weight);
|
||||||
|
SetUnderlined(underlined);
|
||||||
|
|
||||||
|
// set the family/facename
|
||||||
|
SetFamily(family);
|
||||||
|
if ( !faceName.empty() )
|
||||||
|
SetFaceName(faceName);
|
||||||
|
|
||||||
// deal with encoding now (it may override the font family and facename
|
// deal with encoding now (it may override the font family and facename
|
||||||
// so do it after setting them)
|
// so do it after setting them)
|
||||||
SetEncoding(encoding);
|
SetEncoding(encoding);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFontRefData::Init(const wxNativeFontInfo& info, WXHFONT hFont)
|
void wxFontRefData::Init(const wxNativeFontInfo& info, WXHFONT hFont)
|
||||||
|
Reference in New Issue
Block a user