Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Improved checking for DTSTAMP and UID for ValidObject in CalendarEvent.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 23 Jan 2016 13:34:01 +0000 (13:34 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 23 Jan 2016 13:34:01 +0000 (13:34 +0000)
source/objects/calendarevent/CalendarEvent.cpp

index 6c1887d..d175eed 100644 (file)
@@ -9,6 +9,7 @@ CalendarObjectValidResult CalendarEventObject::ValidObject(){
        bool ValidDateTimeStamp = false;
        bool ValidUniqueID = false;
        int SeekCount = 0;
+       string PropertyName;
        
        // Look for BEGIN:VEVENT.
        
@@ -44,8 +45,16 @@ CalendarObjectValidResult CalendarEventObject::ValidObject(){
        
        for (vector<string>::iterator iter = ObjectName.begin();
                iter != ObjectName.end(); iter++){
-       
-               if (ObjectName[SeekCount] == "DTSTAMP"){
+                       
+               try{
+                       PropertyName = ObjectName[SeekCount].substr(0,7);
+               }
+                       
+               catch(const out_of_range& oor){
+                       continue;
+               }
+               
+               if (PropertyName == "DTSTAMP"){
                        
                        if (ValidDateTimeStamp == false){
                                ValidDateTimeStamp = true;
@@ -66,7 +75,15 @@ CalendarObjectValidResult CalendarEventObject::ValidObject(){
        for (vector<string>::iterator iter = ObjectName.begin();
                iter != ObjectName.end(); iter++){
        
-               if (ObjectName[SeekCount] == "UID"){
+               try{
+                       PropertyName = ObjectName[SeekCount].substr(0,3);
+               }
+               
+               catch(const out_of_range& oor){
+                       continue;
+               }
+                       
+               if (PropertyName == "UID"){
                        
                        if (ValidUniqueID == false){
                                ValidUniqueID = true;
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy