Fix confusion with LOGFONT{A,W} parameters to MSW GetTheme[Sys]Font().
Change the signature of GetThemeFont() and GetThemeSysFont() methods of wxUxThemeEngine to take an artificial wxUxThemeFont::Ptr type instead of LOGFONT which allows the broken code to compile correctly and even work in Unicode builds but crashed in ANSI ones under Windows Vista/7 as these functions expect a LOGFONTW and not LOGFONTA even in non-Unicode build under these systems. This generalizes the previous fix/workaround for the same problem in wxStaticBox so remove it now and use wxUxThemeFont both there and in wxMenuItem to avoid crashes when using owner-drawn menus in ANSI build. Closes #12364. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65955 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -367,9 +367,9 @@ void MenuDrawData::Init()
|
||||
|
||||
Offset = -14;
|
||||
|
||||
wxNativeFontInfo fontInfo;
|
||||
theme->GetThemeSysFont(hTheme, TMT_MENUFONT, &fontInfo.lf);
|
||||
Font = wxFont(fontInfo);
|
||||
wxUxThemeFont themeFont;
|
||||
theme->GetThemeSysFont(hTheme, TMT_MENUFONT, themeFont.GetPtr());
|
||||
Font = wxFont(themeFont.GetLOGFONT());
|
||||
|
||||
Theme = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user