From 0e4428e3d018004e70822dacf4260b1eed8d2c14 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sat, 23 Jan 2016 15:09:58 +0000 Subject: [PATCH] Added check for METHOD before checking DTSTART. --- .../objects/calendarevent/CalendarEvent.cpp | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/source/objects/calendarevent/CalendarEvent.cpp b/source/objects/calendarevent/CalendarEvent.cpp index 720c7bd..e061050 100644 --- a/source/objects/calendarevent/CalendarEvent.cpp +++ b/source/objects/calendarevent/CalendarEvent.cpp @@ -100,31 +100,37 @@ CalendarObjectValidResult CalendarEventObject::ValidObject(){ SeekCount = 0; - // Look for DTSTART. + // Look for DTSTART if nothing is set for METHOD.. - for (vector::iterator iter = ObjectName.begin(); - iter != ObjectName.end(); iter++){ + if (MethodData.size() == 0){ + + for (vector::iterator iter = ObjectName.begin(); + iter != ObjectName.end(); iter++){ - try{ - PropertyName = ObjectName[SeekCount].substr(0,7); - } + try{ + PropertyName = ObjectName[SeekCount].substr(0,7); + } - catch(const out_of_range& oor){ - continue; - } + catch(const out_of_range& oor){ + continue; + } - if (PropertyName == "DTSTART"){ + if (PropertyName == "DTSTART"){ - if (ValidDateTimeStart == false){ - ValidDateTimeStart = true; - } else { - return CALENDAROBJECTVALID_INVALIDFORMAT; - } + if (ValidDateTimeStart == false){ + ValidDateTimeStart = true; + } else { + return CALENDAROBJECTVALID_INVALIDFORMAT; + } - } + } - SeekCount++; + SeekCount++; + } + + } else { + ValidDateTimeStart = true; } SeekCount = 0; -- 2.39.5