From d355af34200f3658120b383bd5d16d203e121328 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 18 Sep 2018 14:12:55 +0200 Subject: [PATCH] Fix compilation of generic wxNativeFontInfo::FromString() There is no need to use ConvertFromLegacyWeightIfNecessary() here as the string representation is not supposed to contain the legacy weight constants. And it was also used incorrectly, resulting in build errors for e.g. wxDFB. --- src/common/fontcmn.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/fontcmn.cpp b/src/common/fontcmn.cpp index b088f2adb3..c660707091 100644 --- a/src/common/fontcmn.cpp +++ b/src/common/fontcmn.cpp @@ -776,9 +776,9 @@ bool wxNativeFontInfo::FromString(const wxString& s) token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) return false; - weight = ConvertFromLegacyWeightIfNecessary(l); - if ( weight <= wxFONTWEIGHT_INVALID || weight > wxFONTWEIGHT_MAX ) + if ( l <= wxFONTWEIGHT_INVALID || l > wxFONTWEIGHT_MAX ) return false; + weight = static_cast(l); token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) )