From 584282800ecd93c03a725f22d59dde4fec5a70b2 Mon Sep 17 00:00:00 2001 From: Lauri Nurmi Date: Tue, 28 Dec 2021 14:52:54 +0200 Subject: [PATCH] Don't log AddFontResourceEx() errors with wxLogSysError() According to AddFontResourceEx documentation[1], there is no extended error information available on failure, so any error logged by wxLogSysError() is unrelated to the call. In my experience, the sys error that was logged on failure (e.g. corrupted/unsupported but existing font file) was ERROR_FILE_NOT_FOUND, but the same error would be logged after a successful call also. [1] https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-addfontresourceexw Closes https://github.com/wxWidgets/wxWidgets/pull/2630 --- src/msw/font.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/font.cpp b/src/msw/font.cpp index 0bd240d79f..dab46163de 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -1123,7 +1123,7 @@ bool wxFontBase::AddPrivateFont(const wxString& filename) { if ( !AddFontResourceEx(filename.t_str(), FR_PRIVATE, 0) ) { - wxLogSysError(_("Font file \"%s\" couldn't be loaded"), filename); + wxLogError(_("Font file \"%s\" couldn't be loaded"), filename); return false; }