git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23935
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// do create m_convReal (unconditionally)
wxMBConv *DoCreate() const;
// do create m_convReal (unconditionally)
wxMBConv *DoCreate() const;
+ // set the name (may be only called when m_name == NULL), makes copy of
+ // charset string
void SetName(const wxChar *charset);
void SetName(const wxChar *charset);
-// find a valid value for the encoding
-void wxCSConv::SetEncoding()
-{
-#if wxUSE_INTL
- m_encoding = wxLocale::GetSystemEncoding();
-#else
- m_encoding = wxFONTENCODING_SYSTEM;
-#endif
-}
-
wxCSConv::wxCSConv(const wxChar *charset)
{
Init();
if ( charset )
{
wxCSConv::wxCSConv(const wxChar *charset)
{
Init();
if ( charset )
{
- // not used
- m_encoding = wxFONTENCODING_SYSTEM;
-
- else // no charset specified
- {
- SetEncoding();
- }
+
+ m_encoding = wxFONTENCODING_SYSTEM;
}
wxCSConv::wxCSConv(wxFontEncoding encoding)
{
}
wxCSConv::wxCSConv(wxFontEncoding encoding)
{
- if ( encoding == wxFONTENCODING_MAX ||
- encoding == wxFONTENCODING_DEFAULT )
+ if ( encoding == wxFONTENCODING_MAX || encoding == wxFONTENCODING_DEFAULT )
{
wxFAIL_MSG( _T("invalid encoding value in wxCSConv ctor") );
{
wxFAIL_MSG( _T("invalid encoding value in wxCSConv ctor") );
- if ( encoding == wxFONTENCODING_SYSTEM )
- {
- SetEncoding();
- }
- else // have valid encoding, use it
- {
- m_encoding = encoding;
- }
if ( m_deferred )
{
wxCSConv *self = (wxCSConv *)this; // const_cast
if ( m_deferred )
{
wxCSConv *self = (wxCSConv *)this; // const_cast
+
+#if wxUSE_INTL
+ // if we don't have neither the name nor the encoding, use the default
+ // encoding for this system
+ if ( !m_name && m_encoding == wxFONTENCODING_SYSTEM )
+ {
+ self->m_encoding = wxLocale::GetSystemEncoding();
+ }
+#endif // wxUSE_INTL
+
self->m_convReal = DoCreate();
self->m_deferred = false;
}
self->m_convReal = DoCreate();
self->m_deferred = false;
}