]> git.saurik.com Git - wxWidgets.git/commitdiff
unicode fixes
authorStefan Csomor <csomor@advancedconcepts.ch>
Tue, 26 Aug 2003 01:12:29 +0000 (01:12 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Tue, 26 Aug 2003 01:12:29 +0000 (01:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23232 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/xti.h
src/common/xti.cpp

index eab6f435e34915a9dede22094327d6825e346007..274fa55249039f2eeb139b9157ed05d556a7fd90 100644 (file)
@@ -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<typename T> 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
 
index 34a04c3383e22a722ac0f4a0b6b3371082e233e9..1d6042308fb6309c471b289ff1246b0d49a5013d 100644 (file)
@@ -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