Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added DESCRIPTION property for saving data from a CalendarJournalObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 5 Jun 2016 22:53:21 +0000 (23:53 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 5 Jun 2016 22:53:21 +0000 (23:53 +0100)
Added the code and unit tests for the DESCRIPTION property.

source/objects/calendarjournal/CalendarJournal-Save.cpp
source/tests/xestiacalendar_icaljournalsave.h

index e866df6..2827bb5 100644 (file)
@@ -710,6 +710,52 @@ void CalendarJournalObject::SaveObjectData(string *SaveData){
                
        }
        
+       // Process the DESCRIPTION values.
+       
+       if (DescriptionList.size() > 0){
+       
+               for (int DescriptionListSeek = 0; DescriptionListSeek < DescriptionList.size() > 0;
+                       DescriptionListSeek++){
+               
+                       DataLine += "DESCRIPTION";
+               
+                       if (DescriptionListAltRep[DescriptionListSeek].size() > 0){
+               
+                               DataLine += ";ALTREP=\"";
+                               DataLine += DescriptionListAltRep[DescriptionListSeek];
+                               DataLine += "\"";
+                       
+                       }
+               
+                       if (DescriptionListLanguage[DescriptionListSeek].size() > 0){
+               
+                               DataLine += ";LANGUAGE=";
+                               DataLine += DescriptionListLanguage[DescriptionListSeek];
+                       
+                       }
+               
+                       if (DescriptionListTokens[DescriptionListSeek].size() > 0){
+               
+                               DataLine += ";";
+                               DataLine += DescriptionListTokens[DescriptionListSeek];
+                       
+                       }
+
+                       DataLine += ":";
+                       DataLine += DescriptionList[DescriptionListSeek];
+                       DataLine += "\n";
+               
+                       DataLineProcessed = OutputText(&DataLine);
+               
+                       *SaveData += DataLineProcessed;
+               
+                       DataLine.clear();
+                       DataLineProcessed.clear();
+               
+               }
+       
+       }
+       
        *SaveData += "END:VJOURNAL\n";
        
 }
\ No newline at end of file
index 0ddb69d..fb69016 100644 (file)
@@ -100,6 +100,10 @@ TEST(iCalendarSaveJournal, SaveEventTests){
        "CONTACT:First Contact\n"
        "CONTACT;ALTREP=\"null:nodata\";LANGUAGE=en-GB:Second Contact\n"
        "CONTACT;ZEBRAS=NO:Third Contact\n"
+       "DESCRIPTION:First Journal Entry Description\n"
+       "DESCRIPTION;ALTREP=\"null:nodata\";LANGUAGE=en-GB:This is the second journal de\n"
+       " scription.\n"
+       "DESCRIPTION;ZEBRAS=NO:This is the third journal description.\n"
        "END:VJOURNAL\n"
        "END:VCALENDAR";
        
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