From 70e8d9f69c7704e26b7663ff81a56a24eeefbaf3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 5 Nov 2002 01:22:25 +0000 Subject: [PATCH] fix for compilation with wxUSE_WCHAR_T==0 (bug 615084) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17723 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/listctrl.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index d09769234d..c5916ef7b1 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -104,10 +104,19 @@ public: private: wxMB2WXbuf *m_buf; -#else +#else // !wxUSE_UNICODE wxLV_ITEM(LV_ITEMW &item) { m_item = new LV_ITEM((LV_ITEM&)item); + + // the code below doesn't compile without wxUSE_WCHAR_T and as I don't + // know if it's useful to have it at all (do we ever get Unicode + // notifications in ANSI mode? I don't think so...) I'm not going to + // write alternative implementation right now + // + // but if it is indeed used, we should simply directly use + // ::WideCharToMultiByte() here +#if wxUSE_WCHAR_T if ( (item.mask & LVIF_TEXT) && item.pszText ) { #ifdef __WXWINE__ @@ -119,12 +128,13 @@ private: m_item->pszText = (wxChar*)m_buf->data(); } else +#endif // wxUSE_WCHAR_T m_buf = NULL; } wxLV_ITEM(LV_ITEMA &item) : m_buf(NULL), m_item(&item) {} private: wxWC2WXbuf *m_buf; -#endif +#endif // wxUSE_UNICODE/!wxUSE_UNICODE LV_ITEM *m_item; };