small tests added here and there

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5621 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-01-24 00:15:26 +00:00
parent 8614c46755
commit 3e2dd3db30
2 changed files with 88 additions and 63 deletions

View File

@@ -502,21 +502,22 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event))
if (!wxTheFontMapper->IsEncodingAvailable(fontenc))
{
// try to find some similar encoding:
wxFontEncoding enc2;
if (wxTheFontMapper->GetAltForEncoding(fontenc, &enc2,
wxEmptyString /*facename*/, FALSE /*interactive*/))
wxFontEncoding encAlt;
if ( wxTheFontMapper->GetAltForEncoding(fontenc, &encAlt) )
{
wxEncodingConverter conv;
if (conv.Init(fontenc, enc2))
if (conv.Init(fontenc, encAlt))
{
fontenc = enc2;
fontenc = encAlt;
m_textctrl -> SetValue(conv.Convert(m_textctrl -> GetValue()));
}
else
{
wxLogWarning("Cannot convert from '%s' to '%s'.",
wxFontMapper::GetEncodingDescription(fontenc).c_str(),
wxFontMapper::GetEncodingDescription(enc2).c_str());
wxFontMapper::GetEncodingDescription(encAlt).c_str());
}
}
else
wxLogWarning("No fonts for encoding '%s' on this system.",