Remove wxCreateFontFromLogFont() and wxFillLogFont()

These functions are not really useful as converting between wxFont and
LOGFONT can be done trivially by passing via wxNativeFontInfo and, in
fact, wxCreateFontFromLogFont() managed to do the conversion wrongly by
forgetting to update wxNativeFontInfo::pointSize member when changing
wxNativeFontInfo::lf.

This fixes one unit test failure after the latest changes, although not
yet the other one, see the upcoming commit for this.
This commit is contained in:
Vadim Zeitlin
2018-12-30 16:25:41 +01:00
parent 90186f7740
commit 72a225924d
5 changed files with 10 additions and 42 deletions

View File

@@ -264,35 +264,3 @@ wxFontEncoding wxGetFontEncFromCharSet(int cs)
return fontEncoding;
}
// ----------------------------------------------------------------------------
// wxFont <-> LOGFONT conversion
// ----------------------------------------------------------------------------
void wxFillLogFont(LOGFONT *logFont, const wxFont *font)
{
wxNativeFontInfo fi;
// maybe we already have LOGFONT for this font?
const wxNativeFontInfo *pFI = font->GetNativeFontInfo();
if ( !pFI )
{
// use wxNativeFontInfo methods to build a LOGFONT for this font
fi.InitFromFont(*font);
pFI = &fi;
}
// transfer all the data to LOGFONT
*logFont = pFI->lf;
}
wxFont wxCreateFontFromLogFont(const LOGFONT *logFont)
{
wxNativeFontInfo info;
info.lf = *logFont;
return wxFont(info);
}