From: Steve Brokenshire Date: Wed, 29 Jun 2016 08:20:12 +0000 (+0100) Subject: Added XML to the SaveString function of ContactDataObject X-Git-Tag: release-0.14~49 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=53c4e76cc8369f6816d6d64d498ccb5908972b45;p=xestiaab%2F.git Added XML to the SaveString function of ContactDataObject --- diff --git a/source/contacteditor/cdo/ContactDataObject-Save.cpp b/source/contacteditor/cdo/ContactDataObject-Save.cpp index 3b12441..7de614c 100644 --- a/source/contacteditor/cdo/ContactDataObject-Save.cpp +++ b/source/contacteditor/cdo/ContactDataObject-Save.cpp @@ -79,6 +79,31 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){ } + // Process XML. + + for (std::map::iterator XMLIter = XMLList.begin(); + XMLIter != XMLList.end(); XMLIter++){ + + ProcessData.Append("XML"); + + if (XMLListAltID[XMLIter->first].size() > 0){ + + ProcessData.Append(";ALTID="); + ProcessData.Append(XMLListAltID[XMLIter->first]); + + } + + ProcessData.Append(":"); + ProcessData.Append(XMLIter->second); + ProcessData.Append("\n"); + + ProcessData = OutputText(&ProcessData); + + SaveData->Append(ProcessData); + ProcessData.clear(); + + } + // Process SOURCE. SaveSource(&SourceList, &SourceListAltID, diff --git a/source/tests/xestiaab_contactsave.h b/source/tests/xestiaab_contactsave.h index 3eb41b1..ee43235 100644 --- a/source/tests/xestiaab_contactsave.h +++ b/source/tests/xestiaab_contactsave.h @@ -62,6 +62,12 @@ TEST(ContactSave, ContactSaveTests){ "PRODID:-//Xestia//Address Book Unit Testing//KW\n" "UID:903588-9082374-989120310-AAFECDBCDF\n" "KIND:individual\n" + "XML:Ex\n" + " ample Page 1\n" + "XML;ALTID=3:Example Page 2\n" + "XML;ALTID=5:Example Page 3\n" "SOURCE;ALTID=74;MEDIATYPE=text/plain;PID=71;PREF=72;STATUS=FEED:http://exampl\n" " e.com/source/sourcea.vcf\n" "SOURCE;TYPE=home;ALTID=84;MEDIATYPE=text/plainpaper;PID=81;PREF=82;STATUS=ONL\n"