From 4be459d98e77618024f3a2fcce6151613f7ac013 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 12 Sep 2018 17:41:09 +0200 Subject: [PATCH] Use wxNativeFontInfo ctor instead of manually setting its fields This will be important when new fields are added to wxNativeFontInfo as the ctor will be extended to initialize them, while this code wouldn't do it. No real changes yet. --- src/msw/settings.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/msw/settings.cpp b/src/msw/settings.cpp index e1aef8efbe..4b8534f18b 100644 --- a/src/msw/settings.cpp +++ b/src/msw/settings.cpp @@ -149,8 +149,7 @@ wxFont wxCreateFontFromStockObject(int index) LOGFONT lf; if ( ::GetObject(hFont, sizeof(LOGFONT), &lf) != 0 ) { - wxNativeFontInfo info; - info.lf = lf; + wxNativeFontInfo info(lf); font.Create(info); } else @@ -182,8 +181,8 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index) // for most (simple) controls, e.g. buttons and such but other // controls may prefer to use lfStatusFont or lfCaptionFont if it // is more appropriate for them - wxNativeFontInfo info; - info.lf = wxMSWImpl::GetNonClientMetrics().lfMessageFont; + const wxNativeFontInfo + info(wxMSWImpl::GetNonClientMetrics().lfMessageFont); gs_fontDefault = new wxFont(info); }