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:
@@ -106,10 +106,17 @@ static wxNativeFont wxLoadQueryFont(int pointSize,
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// convert to/from the string representation: format is
|
||||
// registry-encoding[-facename]
|
||||
// encodingid;registry;encoding[;facename]
|
||||
bool wxNativeEncodingInfo::FromString(const wxString& s)
|
||||
{
|
||||
wxStringTokenizer tokenizer(s, _T("-"));
|
||||
wxStringTokenizer tokenizer(s, _T(";"));
|
||||
// cannot use "-" because it may be part of encoding name
|
||||
|
||||
wxString encid = tokenizer.GetNextToken();
|
||||
long enc;
|
||||
if ( !encid.ToLong(&enc) )
|
||||
return FALSE;
|
||||
encoding = (wxFontEncoding)enc;
|
||||
|
||||
xregistry = tokenizer.GetNextToken();
|
||||
if ( !xregistry )
|
||||
@@ -128,10 +135,10 @@ bool wxNativeEncodingInfo::FromString(const wxString& s)
|
||||
wxString wxNativeEncodingInfo::ToString() const
|
||||
{
|
||||
wxString s;
|
||||
s << xregistry << _T('-') << xencoding;
|
||||
s << (long)encoding << _T(';') << xregistry << _T(';') << xencoding;
|
||||
if ( !!facename )
|
||||
{
|
||||
s << _T('-') << facename;
|
||||
s << _T(';') << facename;
|
||||
}
|
||||
|
||||
return s;
|
||||
|
Reference in New Issue
Block a user