the wxConvUI hack in wxMsgCatalog should only be done in ANSI build

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@51264 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2008-01-17 18:01:23 +00:00
parent 980abc9e64
commit 19d59a461f

View File

@@ -958,8 +958,10 @@ private:
class wxMsgCatalog class wxMsgCatalog
{ {
public: public:
#if !wxUSE_UNICODE
wxMsgCatalog() { m_conv = NULL; } wxMsgCatalog() { m_conv = NULL; }
~wxMsgCatalog(); ~wxMsgCatalog();
#endif
// load the catalog from disk (szDirPrefix corresponds to language) // load the catalog from disk (szDirPrefix corresponds to language)
bool Load(const wxChar *szDirPrefix, const wxChar *szName, bool Load(const wxChar *szDirPrefix, const wxChar *szName,
@@ -978,9 +980,11 @@ private:
wxMessagesHash m_messages; // all messages in the catalog wxMessagesHash m_messages; // all messages in the catalog
wxString m_name; // name of the domain wxString m_name; // name of the domain
#if !wxUSE_UNICODE
// the conversion corresponding to this catalog charset if we installed it // the conversion corresponding to this catalog charset if we installed it
// as the global one // as the global one
wxCSConv *m_conv; wxCSConv *m_conv;
#endif
wxPluralFormsCalculatorPtr m_pluralFormsCalculator; wxPluralFormsCalculatorPtr m_pluralFormsCalculator;
}; };
@@ -1407,6 +1411,7 @@ void wxMsgCatalogFile::FillHash(wxMessagesHash& hash,
// wxMsgCatalog class // wxMsgCatalog class
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#if !wxUSE_UNICODE
wxMsgCatalog::~wxMsgCatalog() wxMsgCatalog::~wxMsgCatalog()
{ {
if ( m_conv ) if ( m_conv )
@@ -1421,6 +1426,7 @@ wxMsgCatalog::~wxMsgCatalog()
delete m_conv; delete m_conv;
} }
} }
#endif // !wxUSE_UNICODE
bool wxMsgCatalog::Load(const wxChar *szDirPrefix, const wxChar *szName, bool wxMsgCatalog::Load(const wxChar *szDirPrefix, const wxChar *szName,
const wxChar *msgIdCharset, bool bConvertEncoding) const wxChar *msgIdCharset, bool bConvertEncoding)
@@ -1434,7 +1440,7 @@ bool wxMsgCatalog::Load(const wxChar *szDirPrefix, const wxChar *szName,
file.FillHash(m_messages, msgIdCharset, bConvertEncoding); file.FillHash(m_messages, msgIdCharset, bConvertEncoding);
#if wxUSE_WCHAR_T #if !wxUSE_UNICODE && wxUSE_WCHAR_T
// we should use a conversion compatible with the message catalog encoding // we should use a conversion compatible with the message catalog encoding
// in the GUI if we don't convert the strings to the current conversion but // in the GUI if we don't convert the strings to the current conversion but
// as the encoding is global, only change it once, otherwise we could get // as the encoding is global, only change it once, otherwise we could get
@@ -1450,7 +1456,7 @@ bool wxMsgCatalog::Load(const wxChar *szDirPrefix, const wxChar *szName,
wxConvUI = wxConvUI =
m_conv = new wxCSConv(file.GetCharset()); m_conv = new wxCSConv(file.GetCharset());
} }
#endif // wxUSE_WCHAR_T #endif // !wxUSE_UNICODE && wxUSE_WCHAR_T
return true; return true;
} }