First effort on reading multiple VEVENTS in one VCALENDAR component: Bug 135192

This commit is contained in:
mostafah%oeone.com 2002-04-04 00:19:44 +00:00
Родитель d378f5131e
Коммит 9495d63b21
2 изменённых файлов: 21 добавлений и 18 удалений

Просмотреть файл

@ -897,9 +897,9 @@ NS_IMETHODIMP oeICalEventImpl::ParseIcalString(const char *aNewVal)
printf( "ParseIcalString( %s )\n", aNewVal );
#endif
icalcomponent *vcalendar = icalparser_parse_string( aNewVal );
ParseIcalComponent( vcalendar );
icalcomponent_free( vcalendar );
icalcomponent *vevent = icalparser_parse_string( aNewVal );
ParseIcalComponent( vevent );
icalcomponent_free( vevent );
return NS_OK;
}
@ -974,16 +974,15 @@ NS_IMETHODIMP oeICalEventImpl::SetSnoozeTime( PRTime snoozetime )
return NS_OK;
}
void oeICalEventImpl::ParseIcalComponent( icalcomponent *vcalendar )
void oeICalEventImpl::ParseIcalComponent( icalcomponent *vevent )
{
#ifdef ICAL_DEBUG_ALL
printf( "ParseIcalComponent()\n" );
#endif
icalcomponent *vevent = icalcomponent_get_first_component( vcalendar, ICAL_VEVENT_COMPONENT );
if ( !vevent ) {
#ifdef ICAL_DEBUG
printf( "oeICalEventImpl::ParseIcalComponent() failed: VEVENT not found!\n" );
printf( "oeICalEventImpl::ParseIcalComponent() failed: vevent is NULL!\n" );
#endif
return;
}

Просмотреть файл

@ -658,20 +658,24 @@ oeICalImpl::SetServer( const char *str ) {
return NS_OK;
}
icalcomponent *comp;
for( comp = icalfileset_get_first_component( stream );
comp != 0;
comp = icalfileset_get_next_component( stream ) ) {
nsresult rv;
icalcomponent *vcalendar;
icalcomponent *vevent;
oeICalEventImpl *icalevent;
for( vcalendar = icalfileset_get_first_component( stream );
vcalendar != 0;
vcalendar = icalfileset_get_next_component( stream ) ) {
nsresult rv;
oeICalEventImpl *icalevent;
if( NS_FAILED( rv = NS_NewICalEvent((oeIICalEvent**) &icalevent ))) {
return rv;
for( vevent = icalcomponent_get_first_component( vcalendar, ICAL_VEVENT_COMPONENT );
vevent != 0;
vevent = icalcomponent_get_next_component( vcalendar, ICAL_VEVENT_COMPONENT ) ) {
if( NS_FAILED( rv = NS_NewICalEvent((oeIICalEvent**) &icalevent ))) {
return rv;
}
icalevent->ParseIcalComponent( vevent );
m_eventlist.Add( icalevent );
}
icalevent->ParseIcalComponent( comp );
m_eventlist.Add( icalevent );
}
icalfileset_free(stream);