- int valueId = ReadComponent( elementContent , callbacks ) ;
- if ( valueId != wxInvalidObjectID )
+ // we skip empty elements
+ if ( elementType->IsObjectType() )
+ {
+ int valueId = ReadComponent( elementContent , callbacks ) ;
+ if ( valueId != wxInvalidObjectID )
+ {
+ if ( pi->GetAccessor()->HasAdder() )
+ callbacks->AddToPropertyCollectionAsObject( objectID , classInfo , pi , valueId ) ;
+ // TODO for collections we must have a notation on taking over ownership or not
+ if ( elementType->GetKind() == wxT_OBJECT && valueId != wxNullObjectID )
+ callbacks->DestroyObject( valueId , GetObjectClassInfo( valueId ) ) ;
+ }
+ }
+ else