Used appropriate functions to get string values from calendar file. This fixes bug #109924 & #112117
git-svn-id: svn://10.0.0.236/trunk@111570 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -922,7 +922,7 @@ void oeICalEventImpl::ParseIcalComponent( icalcomponent *vcalendar )
|
||||
//id
|
||||
icalproperty *prop = icalcomponent_get_first_property( vevent, ICAL_UID_PROPERTY );
|
||||
assert( prop != 0);
|
||||
const char *tmpstr = icalproperty_get_value_as_string( prop );
|
||||
const char *tmpstr = icalproperty_get_uid( prop );
|
||||
m_id = atol( tmpstr );
|
||||
|
||||
//title
|
||||
@@ -930,7 +930,7 @@ void oeICalEventImpl::ParseIcalComponent( icalcomponent *vcalendar )
|
||||
nsMemory::Free( m_title );
|
||||
prop = icalcomponent_get_first_property( vevent, ICAL_SUMMARY_PROPERTY );
|
||||
if ( prop != 0) {
|
||||
tmpstr = icalproperty_get_value_as_string( prop );
|
||||
tmpstr = icalproperty_get_summary( prop );
|
||||
SetTitle( tmpstr );
|
||||
} else
|
||||
m_title = nsnull;
|
||||
@@ -940,7 +940,7 @@ void oeICalEventImpl::ParseIcalComponent( icalcomponent *vcalendar )
|
||||
nsMemory::Free( m_description );
|
||||
prop = icalcomponent_get_first_property( vevent, ICAL_DESCRIPTION_PROPERTY );
|
||||
if ( prop != 0) {
|
||||
tmpstr = icalproperty_get_value_as_string( prop );
|
||||
tmpstr = icalproperty_get_description( prop );
|
||||
SetDescription( tmpstr );
|
||||
} else
|
||||
m_description = nsnull;
|
||||
@@ -950,7 +950,7 @@ void oeICalEventImpl::ParseIcalComponent( icalcomponent *vcalendar )
|
||||
nsMemory::Free( m_location );
|
||||
prop = icalcomponent_get_first_property( vevent, ICAL_LOCATION_PROPERTY );
|
||||
if ( prop != 0) {
|
||||
tmpstr = icalproperty_get_value_as_string( prop );
|
||||
tmpstr = icalproperty_get_location( prop );
|
||||
SetLocation( tmpstr );
|
||||
} else
|
||||
m_location = nsnull;
|
||||
@@ -960,7 +960,7 @@ void oeICalEventImpl::ParseIcalComponent( icalcomponent *vcalendar )
|
||||
nsMemory::Free( m_category );
|
||||
prop = icalcomponent_get_first_property( vevent, ICAL_CATEGORIES_PROPERTY );
|
||||
if ( prop != 0) {
|
||||
tmpstr = (char *)icalproperty_get_value_as_string( prop );
|
||||
tmpstr = (char *)icalproperty_get_categories( prop );
|
||||
SetCategory( tmpstr );
|
||||
} else
|
||||
m_category= nsnull;
|
||||
@@ -968,8 +968,8 @@ void oeICalEventImpl::ParseIcalComponent( icalcomponent *vcalendar )
|
||||
//isprivate
|
||||
prop = icalcomponent_get_first_property( vevent, ICAL_CLASS_PROPERTY );
|
||||
if ( prop != 0) {
|
||||
tmpstr = icalproperty_get_value_as_string( prop );
|
||||
if( strcmp( tmpstr, "PUBLIC" ) == 0 )
|
||||
icalproperty_class tmpcls = icalproperty_get_class( prop );
|
||||
if( tmpcls == ICAL_CLASS_PUBLIC )
|
||||
m_isprivate= false;
|
||||
else
|
||||
m_isprivate= true;
|
||||
|
||||
@@ -333,7 +333,6 @@ END:VCALENDAR\n\
|
||||
icalcomponent_add_property( icalevent, category );
|
||||
|
||||
icalproperty *classp = icalproperty_new_class( ICAL_CLASS_PRIVATE );
|
||||
// icalproperty *classp = icalproperty_new_class( "PRIVATE" );
|
||||
icalcomponent_add_property( icalevent, classp );
|
||||
|
||||
start.year = 2001; start.month = 8; start.day = 15;
|
||||
@@ -455,27 +454,27 @@ END:VCALENDAR\n\
|
||||
//
|
||||
tmpprop = icalcomponent_get_first_property( fetchedevent, ICAL_UID_PROPERTY );
|
||||
assert( tmpprop != 0 );
|
||||
printf("id: %s\n", icalproperty_get_value_as_string( tmpprop ) );
|
||||
printf("id: %s\n", icalproperty_get_uid( tmpprop ) );
|
||||
//
|
||||
tmpprop = icalcomponent_get_first_property( fetchedevent, ICAL_SUMMARY_PROPERTY );
|
||||
assert( tmpprop != 0 );
|
||||
printf("Title: %s\n", icalproperty_get_value_as_string( tmpprop ) );
|
||||
printf("Title: %s\n", icalproperty_get_summary( tmpprop ) );
|
||||
//
|
||||
tmpprop = icalcomponent_get_first_property( fetchedevent, ICAL_CATEGORIES_PROPERTY );
|
||||
assert( tmpprop != 0 );
|
||||
printf("Category: %s\n", icalproperty_get_value_as_string( tmpprop ) );
|
||||
printf("Category: %s\n", icalproperty_get_categories( tmpprop ) );
|
||||
//
|
||||
tmpprop = icalcomponent_get_first_property( fetchedevent, ICAL_DESCRIPTION_PROPERTY );
|
||||
assert( tmpprop != 0 );
|
||||
printf("Description: %s\n", icalproperty_get_value_as_string( tmpprop ) );
|
||||
printf("Description: %s\n", icalproperty_get_description( tmpprop ) );
|
||||
//
|
||||
tmpprop = icalcomponent_get_first_property( fetchedevent, ICAL_LOCATION_PROPERTY );
|
||||
assert( tmpprop != 0 );
|
||||
printf("Location: %s\n", icalproperty_get_value_as_string( tmpprop ) );
|
||||
printf("Location: %s\n", icalproperty_get_location( tmpprop ) );
|
||||
//
|
||||
tmpprop = icalcomponent_get_first_property( fetchedevent, ICAL_CLASS_PROPERTY );
|
||||
assert( tmpprop != 0 );
|
||||
printf("Class: %s\n", icalproperty_get_value_as_string( tmpprop ) );
|
||||
printf("Class: %s\n", (icalproperty_get_class( tmpprop ) == ICAL_CLASS_PUBLIC) ? "PUBLIC" : "PRIVATE" );
|
||||
//
|
||||
tmpprop = icalcomponent_get_first_property( fetchedevent, ICAL_DTSTART_PROPERTY );
|
||||
assert( tmpprop != 0 );
|
||||
@@ -509,7 +508,7 @@ END:VCALENDAR\n\
|
||||
|
||||
icalfileset_commit(stream);
|
||||
printf("Event updated\n");
|
||||
printf( "New Title: %s\n", icalproperty_get_value_as_string( tmpprop ) );
|
||||
printf( "New Title: %s\n", icalproperty_get_summary( tmpprop ) );
|
||||
|
||||
fetchedcal = icalfileset_fetch( stream, uidstr );
|
||||
assert( fetchedcal != 0 );
|
||||
@@ -861,7 +860,7 @@ oeICalImpl::SearchBySQL( const char *sqlstr, nsISimpleEnumerator **resultList )
|
||||
icalproperty *prop = icalcomponent_get_first_property( vevent, ICAL_UID_PROPERTY );
|
||||
assert( prop != 0);
|
||||
|
||||
eventEnum->AddEventId( atol( icalproperty_get_value_as_string( prop ) ) );
|
||||
eventEnum->AddEventId( atol( icalproperty_get_uid( prop ) ) );
|
||||
}
|
||||
|
||||
icalfileset_free(stream);
|
||||
|
||||
Reference in New Issue
Block a user