From: Steve Brokenshire Date: Sat, 2 Jul 2016 21:50:13 +0000 (+0100) Subject: Added VND-* to the SaveString function of ContactDataObject X-Git-Tag: release-0.14~26 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=53225dcec7940087f46e777fb9a3cc2a4d5bb341;p=xestiaab%2F.git Added VND-* to the SaveString function of ContactDataObject --- diff --git a/source/contacteditor/cdo/ContactDataObject-Save.cpp b/source/contacteditor/cdo/ContactDataObject-Save.cpp index f88d9ee..8a04c55 100644 --- a/source/contacteditor/cdo/ContactDataObject-Save.cpp +++ b/source/contacteditor/cdo/ContactDataObject-Save.cpp @@ -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 *KeyList, map } +} + +void ContactDataObject::SaveVendor(map *VendorList, map *VendorListPEN, + map *VendorListElement, wxString *SaveData){ + + wxString ProcessData = ""; + + for (std::map::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 diff --git a/source/contacteditor/cdo/ContactDataObject.h b/source/contacteditor/cdo/ContactDataObject.h index 1ad93c1..6886fcd 100644 --- a/source/contacteditor/cdo/ContactDataObject.h +++ b/source/contacteditor/cdo/ContactDataObject.h @@ -189,6 +189,8 @@ class ContactDataObject{ map *KeyListKeyType, map *KeyListDataEncType, map *KeyListDataType, map *KeyListPref, map *KeyListTokens, wxString *SaveData); + void SaveVendor(map *VendorList, map *VendorListPEN, + map *VendorListElement, wxString *SaveData); public: diff --git a/source/tests/xestiaab_contactsave.h b/source/tests/xestiaab_contactsave.h index 1dd8b65..7261f8c 100644 --- a/source/tests/xestiaab_contactsave.h +++ b/source/tests/xestiaab_contactsave.h @@ -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"));