29
29
struct vcardcomponent_impl {
30
30
char id [5 ];
31
31
vcardcomponent_kind kind ;
32
- vcardproperty_version version ;
32
+ vcardproperty * versionp ;
33
33
char * x_name ;
34
34
pvl_list properties ;
35
35
pvl_elem property_iterator ;
@@ -67,7 +67,6 @@ static vcardcomponent *vcardcomponent_new_impl(vcardcomponent_kind kind)
67
67
strcpy (comp -> id , "comp" );
68
68
69
69
comp -> kind = kind ;
70
- comp -> version = VCARD_VERSION_NONE ;
71
70
comp -> properties = pvl_newlist ();
72
71
comp -> components = pvl_newlist ();
73
72
@@ -287,7 +286,7 @@ void vcardcomponent_add_property(vcardcomponent *comp, vcardproperty *property)
287
286
pvl_push (comp -> properties , property );
288
287
289
288
if (vcardproperty_isa (property ) == VCARD_VERSION_PROPERTY ) {
290
- comp -> version = vcardproperty_get_version ( property ) ;
289
+ comp -> versionp = property ;
291
290
}
292
291
}
293
292
@@ -308,7 +307,7 @@ void vcardcomponent_remove_property(vcardcomponent *comp, vcardproperty *propert
308
307
#endif
309
308
310
309
if (vcardproperty_isa (property ) == VCARD_VERSION_PROPERTY ) {
311
- comp -> version = VCARD_VERSION_NONE ;
310
+ comp -> versionp = 0 ;
312
311
}
313
312
314
313
for (itr = pvl_head (comp -> properties ); itr != 0 ; itr = next_itr ) {
@@ -1223,8 +1222,6 @@ void vcardcomponent_transform(vcardcomponent *impl,
1223
1222
} else {
1224
1223
comp_to_v3 (impl );
1225
1224
}
1226
-
1227
- impl -> version = version ;
1228
1225
}
1229
1226
1230
1227
for (itr = pvl_head (impl -> components ); itr != 0 ; itr = pvl_next (itr )) {
@@ -1240,18 +1237,16 @@ enum vcardproperty_version vcardcomponent_get_version(vcardcomponent *card)
1240
1237
{
1241
1238
icalerror_check_arg_rz (card != 0 , "card" );
1242
1239
1243
- if (card -> version == VCARD_VERSION_NONE ) {
1244
- vcardproperty * prop =
1240
+ if (card -> versionp == 0 ) {
1241
+ card -> versionp =
1245
1242
vcardcomponent_get_first_property (card , VCARD_VERSION_PROPERTY );
1246
1243
1247
- if (prop == 0 ) {
1244
+ if (card -> versionp == 0 ) {
1248
1245
return VCARD_VERSION_NONE ;
1249
1246
}
1250
-
1251
- card -> version = vcardproperty_get_version (prop );
1252
1247
}
1253
1248
1254
- return card -> version ;
1249
+ return vcardproperty_get_version ( card -> versionp ) ;
1255
1250
}
1256
1251
1257
1252
const char * vcardcomponent_get_uid (vcardcomponent * card )
0 commit comments