Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added XML to the SaveString function of ContactDataObject
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Wed, 29 Jun 2016 08:20:12 +0000 (09:20 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Wed, 29 Jun 2016 08:20:12 +0000 (09:20 +0100)
source/contacteditor/cdo/ContactDataObject-Save.cpp
source/tests/xestiaab_contactsave.h

index 3b12441..7de614c 100644 (file)
@@ -79,6 +79,31 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){
                
        }
        
+       // Process XML.
+
+       for (std::map<int, wxString>::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, 
index 3eb41b1..ee43235 100644 (file)
@@ -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:<a xmlns=\"http://www.w3.org/1999/xhtml\"\\n   href=\"http://example.com/\">Ex\n"
+       " ample Page 1</a>\n"
+       "XML;ALTID=3:<a xmlns=\"http://www.w3.org/1999/xhtml\"\\n   href=\"http://example.\n"
+       " com/page2.html\">Example Page 2</a>\n"
+       "XML;ALTID=5:<a xmlns=\"http://www.w3.org/1999/xhtml\"\\n   href=\"http://example.\n"
+       " com/page3.html\">Example Page 3</a>\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"
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