on mac using macroman only created once a successful wxCSConv, because the iconv' miss was entered as a failure into the cache, which then killed any subsequent attempt ..

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40411 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2006-08-01 09:37:42 +00:00
parent 050242339c
commit 3c67ec06a7

View File

@@ -3339,20 +3339,26 @@ wxMBConv *wxCSConv::DoCreate() const
}
const wxChar** names = wxFontMapperBase::GetAllEncodingNames(encoding);
for ( ; *names; ++names )
// CS : in case this does not return valid names (eg for MacRoman) encoding
// got a 'failure' entry in the cache all the same, although it just has to
// be created using a different method, so only store failed iconv creation
// attempts (or perhaps we shoulnd't do this at all ?)
if ( names[0] != NULL )
{
wxMBConv_iconv *conv = new wxMBConv_iconv(*names);
if ( conv->IsOk() )
for ( ; *names; ++names )
{
gs_nameCache[encoding] = *names;
return conv;
wxMBConv_iconv *conv = new wxMBConv_iconv(*names);
if ( conv->IsOk() )
{
gs_nameCache[encoding] = *names;
return conv;
}
delete conv;
}
delete conv;
gs_nameCache[encoding] = _T(""); // cache the failure
}
gs_nameCache[encoding] = _T(""); // cache the failure
}
#endif // wxUSE_FONTMAP
}