From bf214932c3bc9eb486cd11eb1bbf82bc1ba7ad32 Mon Sep 17 00:00:00 2001 From: Chris Frey Date: Thu, 1 May 2008 20:09:38 -0400 Subject: [PATCH] Fixed missing fields in the Calendar record build process. --- ChangeLog | 1 + src/r_calendar.cc | 13 +++++++++++++ src/r_calendar.h | 2 ++ src/s11n-boost.h | 1 + 4 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8f0d2878..6c42ef8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ Release: version 0.13 - 2008/05/?? so that when building records, it doesn't get processed like a null terminated string... also added more BuildField() helper functions for accuracy + - fixed missing fields in the Calendar record build process 2008/04/29 - applied Jason Thomas's ACLOCAL_FLAGS patch to make autoreconf work again... Thanks! diff --git a/src/r_calendar.cc b/src/r_calendar.cc index dd3461a1..90a54442 100644 --- a/src/r_calendar.cc +++ b/src/r_calendar.cc @@ -362,6 +362,16 @@ void Calendar::BuildFields(Data &data, size_t &offset) const } } + // handle special cases + + // FIXME - need to build CALFC_RECURRENCE_DATA as well + + if( TimeZoneValid ) + BuildField(data, offset, CALFC_TIMEZONE_CODE, TimeZoneCode); + + BuildField(data, offset, CALFC_FREEBUSY_FLAG, (char)FreeBusyFlag); + BuildField(data, offset, CALFC_CLASS_FLAG, (char)ClassFlag); + // and finally save unknowns UnknownsType::const_iterator ub = Unknowns.begin(), ue = Unknowns.end(); @@ -391,6 +401,7 @@ void Calendar::Clear() RecurringEndTime = 0; Perpetual = false; TimeZoneCode = GetTimeZoneCode(0, 0); // default to GMT + TimeZoneValid = false; DayOfWeek = WeekOfMonth = DayOfMonth = MonthOfYear = 0; WeekDays = 0; @@ -415,6 +426,8 @@ void Calendar::Dump(std::ostream &os) const os << " All Day Event: " << (AllDayEvent ? "yes" : "no") << "\n"; os << " Class: " << ClassTypes[ClassFlag] << "\n"; os << " Free/Busy: " << FreeBusy[FreeBusyFlag] << "\n"; + if( TimeZoneValid ) + os << " Time Zone: " << GetTimeZone(TimeZoneCode)->Name << "\n"; // cycle through the type table for( const FieldLink *b = CalendarFieldLinks; diff --git a/src/r_calendar.h b/src/r_calendar.h index f6d01c50..262ce7ec 100644 --- a/src/r_calendar.h +++ b/src/r_calendar.h @@ -132,6 +132,8 @@ public: // seems to have little use, but // set to your current time zone // as a good default + bool TimeZoneValid; // true if the record contained a + // time zone code unsigned short // recurring details, depending on type DayOfWeek, // 0-6 diff --git a/src/s11n-boost.h b/src/s11n-boost.h index 065d1076..f810a0dc 100644 --- a/src/s11n-boost.h +++ b/src/s11n-boost.h @@ -175,6 +175,7 @@ void serialize(ArchiveT &ar, Barry::Calendar &c, const unsigned int ver) ar & make_nvp("RecurringEndTime", c.RecurringEndTime); ar & make_nvp("Perpetual", c.Perpetual); ar & make_nvp("TimeZoneCode", c.TimeZoneCode); + ar & make_nvp("TimeZoneValid", c.TimeZoneValid); ar & make_nvp("DayOfWeek", c.DayOfWeek); ar & make_nvp("WeekOfMonth", c.WeekOfMonth); -- 2.11.4.GIT