partially fixed passing wxUniChar as vararg argument (non-ASCII characters are still broken in UTF8 build, other cases work)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46266 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2007-06-02 12:45:19 +00:00
parent ba98e032a7
commit 24d68c95ad

View File

@@ -18,9 +18,9 @@
#include "wx/cpp.h"
#include "wx/chartype.h"
#include "wx/wxcrt.h"
#include "wx/strconv.h"
#include "wx/buffer.h"
#include "wx/unichar.h"
class WXDLLIMPEXP_BASE wxCStrData;
class WXDLLIMPEXP_BASE wxString;
@@ -419,6 +419,35 @@ WX_ARG_NORMALIZER_FORWARD(wxStdWideString, const wxStdWideString&);
#endif // wxUSE_STD_STRING
// versions for wxUniChar, wxUniCharRef:
#if !wxUSE_UTF8_LOCALE_ONLY
template<>
struct wxArgNormalizerWchar<const wxUniChar&>
: public wxArgNormalizerWchar<wxChar/*FIXME-UTF8: should be wchar_t after ANSI removal*/>
{
wxArgNormalizerWchar(const wxUniChar& s)
: wxArgNormalizerWchar<wxChar>((wxChar)s) {}
};
#endif // !wxUSE_UTF8_LOCALE_ONLY
#if wxUSE_UNICODE_UTF8
template<>
struct wxArgNormalizerUtf8<const wxUniChar&>
: public wxArgNormalizerUtf8<char>
{
wxArgNormalizerUtf8(const wxUniChar& s)
// FIXME-UTF8: this is lossy, we need to convert to string, but that
// requires format string update
: wxArgNormalizerUtf8<char>((const char)s) {}
};
#endif // wxUSE_UNICODE_UTF8
WX_ARG_NORMALIZER_FORWARD(wxUniChar, const wxUniChar&);
WX_ARG_NORMALIZER_FORWARD(const wxUniCharRef&, const wxUniChar&);
WX_ARG_NORMALIZER_FORWARD(wxUniCharRef, const wxUniChar&);
#undef WX_ARG_NORMALIZER_FORWARD
#undef _WX_ARG_NORMALIZER_FORWARD_IMPL