Don't destroy wxFont from its GetFaceName() in wxMSW.
wxFont::GetFaceName() could destroy the HFONT used by the font accidentally, avoid it by not invalidating the font when caching its face name. Closes #16273. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76592 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -661,6 +661,7 @@ wxMSW:
|
|||||||
- Don't fail when using large paper sizes in print preview.
|
- Don't fail when using large paper sizes in print preview.
|
||||||
- Fix wxRichMessageDialog return value for dialog with only "OK" button.
|
- Fix wxRichMessageDialog return value for dialog with only "OK" button.
|
||||||
- Fix precision loss in wxGraphicsContext::{Draw,Stroke}Lines() (tibo_).
|
- Fix precision loss in wxGraphicsContext::{Draw,Stroke}Lines() (tibo_).
|
||||||
|
- Fix destroying the font from wxFont::GetFaceName() in some cases (aebailey82).
|
||||||
|
|
||||||
wxOSX:
|
wxOSX:
|
||||||
|
|
||||||
|
@@ -149,7 +149,8 @@ public:
|
|||||||
{
|
{
|
||||||
// cache the face name, it shouldn't change unless the family
|
// cache the face name, it shouldn't change unless the family
|
||||||
// does and wxNativeFontInfo::SetFamily() resets the face name
|
// does and wxNativeFontInfo::SetFamily() resets the face name
|
||||||
const_cast<wxFontRefData *>(this)->SetFaceName(facename);
|
// Don't call this->SetFaceName(), because it deletes the HFONT.
|
||||||
|
const_cast<wxNativeFontInfo &>(m_nativeFontInfo).SetFaceName(facename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user