wxNativeEncoding::To/FromString now stores wxFontEncoding info as well (don't worry, wxFontMapper stores data under different name now)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5460 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2000-01-16 22:53:19 +00:00
parent 62ea506eaf
commit 1e1d0be191
5 changed files with 55 additions and 13 deletions

View File

@@ -42,12 +42,18 @@
// ----------------------------------------------------------------------------
// convert to/from the string representation: format is
// facename[;charset]
// encodingid;facename[;charset]
bool wxNativeEncodingInfo::FromString(const wxString& s)
{
wxStringTokenizer tokenizer(s, _T(";"));
wxString encid = tokenizer.GetNextToken();
long enc;
if ( !encid.ToLong(&enc) )
return FALSE;
encoding = (wxFontEncoding)enc;
facename = tokenizer.GetNextToken();
if ( !facename )
return FALSE;
@@ -74,7 +80,10 @@ bool wxNativeEncodingInfo::FromString(const wxString& s)
wxString wxNativeEncodingInfo::ToString() const
{
wxString s(facename);
wxString s;
s << (long)encoding << _T(';') << facename;
// TODO: what is this for OS/2?
/*
if ( charset != ANSI_CHARSET )