mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
bug 322827: store names of x- properties, and use that name when serializing. r=daniel.boelze, dmose
This commit is contained in:
parent
4001b0411f
commit
a4b5da6c25
@ -212,6 +212,19 @@ icalcomponent* icalcomponent_new_clone(icalcomponent* old)
|
||||
|
||||
}
|
||||
|
||||
/** @brief Constructor
|
||||
*/
|
||||
icalcomponent*
|
||||
icalcomponent_new_x (const char* x_name)
|
||||
{
|
||||
icalcomponent* comp = icalcomponent_new_impl(ICAL_X_COMPONENT);
|
||||
if (!comp) {
|
||||
return 0;
|
||||
}
|
||||
comp->x_name = icalmemory_strdup(x_name);
|
||||
return comp;
|
||||
}
|
||||
|
||||
/*** @brief Destructor
|
||||
*/
|
||||
void
|
||||
@ -298,7 +311,11 @@ icalcomponent_as_ical_string (icalcomponent* impl)
|
||||
icalerror_check_arg_rz( (impl!=0), "component");
|
||||
icalerror_check_arg_rz( (kind!=ICAL_NO_COMPONENT), "component kind is ICAL_NO_COMPONENT");
|
||||
|
||||
kind_string = icalcomponent_kind_to_string(kind);
|
||||
if (kind != ICAL_X_COMPONENT) {
|
||||
kind_string = icalcomponent_kind_to_string(kind);
|
||||
} else {
|
||||
kind_string = impl->x_name;
|
||||
}
|
||||
|
||||
icalerror_check_arg_rz( (kind_string!=0),"Unknown kind of component");
|
||||
|
||||
|
@ -53,6 +53,7 @@ icalcomponent* icalcomponent_new(icalcomponent_kind kind);
|
||||
icalcomponent* icalcomponent_new_clone(icalcomponent* component);
|
||||
icalcomponent* icalcomponent_new_from_string(char* str);
|
||||
icalcomponent* icalcomponent_vanew(icalcomponent_kind kind, ...);
|
||||
icalcomponent* icalcomponent_new_x(const char* x_name);
|
||||
void icalcomponent_free(icalcomponent* component);
|
||||
|
||||
char* icalcomponent_as_ical_string(icalcomponent* component);
|
||||
|
@ -664,7 +664,12 @@ icalcomponent* icalparser_add_line(icalparser* parser,
|
||||
ICAL_XLICERRORTYPE_COMPONENTPARSEERROR);
|
||||
}
|
||||
|
||||
c = icalcomponent_new(comp_kind);
|
||||
|
||||
if (comp_kind != ICAL_X_COMPONENT) {
|
||||
c = icalcomponent_new(comp_kind);
|
||||
} else {
|
||||
c = icalcomponent_new_x(str);
|
||||
}
|
||||
|
||||
if (c == 0){
|
||||
c = icalcomponent_new(ICAL_XLICINVALID_COMPONENT);
|
||||
|
Loading…
Reference in New Issue
Block a user