From: Stefan Csomor Date: Tue, 26 Aug 2003 01:12:29 +0000 (+0000) Subject: unicode fixes X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c681bd248f610c0dafecf6a6b413d889ef700eeb?ds=inline;hp=b1f6de838e6d29596a8cec55a59dd3a5c3f02233 unicode fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23232 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/xti.h b/include/wx/xti.h index eab6f435e3..274fa55249 100644 --- a/include/wx/xti.h +++ b/include/wx/xti.h @@ -492,17 +492,22 @@ private : class WXDLLIMPEXP_BASE wxCollectionTypeInfo : public wxTypeInfo { public : - wxCollectionTypeInfo( wxTypeInfo *elementType , converterToString_t to , converterFromString_t from , const wxString &name) : + wxCollectionTypeInfo( const wxString &elementName , converterToString_t to , converterFromString_t from , const wxString &name) : wxTypeInfo( wxT_COLLECTION , to , from , name ) - { m_elementType = elementType ;} + { m_elementTypeName = elementName ; m_elementType = NULL ;} #if wxUSE_UNICODE - wxCollectionTypeInfo( wxTypeInfo *elementType , converterToString_t to , converterFromString_t from , const char *name ) : + wxCollectionTypeInfo( const char *elementName , converterToString_t to , converterFromString_t from , const char *name ) : wxTypeInfo( wxT_COLLECTION , to , from , name ) - { m_elementType = elementType ;} + { m_elementTypeName = wxString::FromAscii( elementName ) ; m_elementType = NULL ;} #endif - const wxTypeInfo* GetElementType() const { return m_elementType ; } + const wxTypeInfo* GetElementType() const + { + if ( m_elementType == NULL ) + m_elementType = wxTypeInfo::FindType( m_elementTypeName ) ; + return m_elementType ; } private : - wxTypeInfo * m_elementType ; + mutable wxTypeInfo * m_elementType ; + wxString m_elementTypeName ; } ; // a delegate is an exposed event source @@ -525,7 +530,7 @@ template const wxTypeInfo* wxGetTypeInfo( T * ) { return wxTypeInfo: wxCustomTypeInfo s_typeInfo##e(typeid(e).name() , &toString , &fromString) ; #define WX_COLLECTION_TYPE_INFO( element , collection ) \ - wxCollectionTypeInfo s_typeInfo##collection( (wxTypeInfo*) wxGetTypeInfo( (element *) NULL) , NULL , NULL , typeid(collection).name() ) ; + wxCollectionTypeInfo s_typeInfo##collection( typeid(element).name() , NULL , NULL , typeid(collection).name() ) ; // sometimes a compiler invents specializations that are nowhere called, use this macro to satisfy the refs diff --git a/src/common/xti.cpp b/src/common/xti.cpp index 34a04c3383..1d6042308f 100644 --- a/src/common/xti.cpp +++ b/src/common/xti.cpp @@ -280,7 +280,7 @@ wxTypeInfo *wxTypeInfo::FindType(const wxChar *typeName) } #if wxUSE_UNICODE -wxClassTypeInfo::wxClassTypeInfo( wxTypeKind kind , wxClassInfo* classInfo , converterToString_t to , converterFromString_t from , const char *name) : +wxClassTypeInfo::wxClassTypeInfo( wxTypeKind kind , wxClassInfo* classInfo , converterToString_t to , converterFromString_t from , const char *6name) : wxTypeInfo( kind , to , from , name) { wxASSERT_MSG( kind == wxT_OBJECT_PTR || kind == wxT_OBJECT , wxT("Illegal Kind for Enum Type")) ; m_classInfo = classInfo ;} #endif