Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added VND-* to the SaveString function of ContactDataObject
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 2 Jul 2016 21:50:13 +0000 (22:50 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 2 Jul 2016 21:50:13 +0000 (22:50 +0100)
source/contacteditor/cdo/ContactDataObject-Save.cpp
source/contacteditor/cdo/ContactDataObject.h
source/tests/xestiaab_contactsave.h

index f88d9ee..8a04c55 100644 (file)
@@ -621,6 +621,11 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){
                &KeyListDataType, &KeyListPref, 
                &KeyListTokens, SaveData);
 
+       // Process VND-*
+       
+       SaveVendor(&VendorList, &VendorListPEN, 
+               &VendorListElement, SaveData);
+
        // Write the end part of the vCard data file.
        
        SaveData->Append("END:VCARD");
@@ -2283,4 +2288,29 @@ void ContactDataObject::SaveKey(map<int, wxString> *KeyList, map<int, wxString>
                        
        }
                
+}
+
+void ContactDataObject::SaveVendor(map<int, wxString> *VendorList, map<int, wxString> *VendorListPEN, 
+       map<int, wxString> *VendorListElement, wxString *SaveData){
+
+       wxString ProcessData = "";
+               
+       for (std::map<int, wxString>::iterator VendorIter = VendorList->begin();
+               VendorIter != VendorList->end(); VendorIter++){
+
+               ProcessData.Append("VND-");
+               ProcessData.Append((*VendorListPEN)[VendorIter->first]);
+               ProcessData.Append("-");
+               ProcessData.Append((*VendorListElement)[VendorIter->first]);
+               ProcessData.Append(":");
+               ProcessData.Append(VendorIter->second);
+               ProcessData.Append("\n");
+
+               ProcessData = OutputText(&ProcessData);
+               
+               SaveData->Append(ProcessData);
+               ProcessData.clear();
+                       
+       }
+               
 }
\ No newline at end of file
index 1ad93c1..6886fcd 100644 (file)
@@ -189,6 +189,8 @@ class ContactDataObject{
                map<int, bool> *KeyListKeyType, map<int, wxString> *KeyListDataEncType, 
                map<int, wxString> *KeyListDataType, map<int, int> *KeyListPref, 
                map<int, wxString> *KeyListTokens, wxString *SaveData);
+       void SaveVendor(map<int, wxString> *VendorList, map<int, wxString> *VendorListPEN, 
+               map<int, wxString> *VendorListElement, wxString *SaveData);
 
        public:
 
index 1dd8b65..7261f8c 100644 (file)
@@ -679,6 +679,9 @@ TEST(ContactSave, ContactSaveTests){
        " jdzT1E1Uk5BUUNUSHVjOQpjM1dORURZY1hhV2N6S3ZwN2R4aWJ1YS9FanNxRC85eHNUOHRZUUQrT\n"
        " 2VqRndvRmVrbnpZa2RFMmdJb2ZuaDk0CjdKeUhaNDUyTERkamZXQ1BZWFU9Cj16T3NxCi0tLS0tR\n"
        " U5EIFBHUCBQVUJMSUMgS0VZIEJMT0NLLS0tLS0K\n"
+       "VND-696-CAKE:Lemon\n"
+       "VND-696-DRINK:Orange\n"
+       "VND-696-MUSIC:Shiena Nishizawa\n"
        "END:VCARD";
 
        ASSERT_EQ(CONTACTLOAD_OK, TestFile3.LoadFile("LoadCheck-Load4.vcf"));
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