From 9e0d23153e8cd09f0b96e7b111812000b19614db Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 3 Jul 2016 17:07:08 +0100 Subject: [PATCH] Added GENDER to the SaveString function of ContactDataObject --- .../cdo/ContactDataObject-Save.cpp | 32 ++++++++++++++++++- source/tests/xestiaab_contactsave.h | 1 + 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/source/contacteditor/cdo/ContactDataObject-Save.cpp b/source/contacteditor/cdo/ContactDataObject-Save.cpp index 8747ae3..9a45e46 100644 --- a/source/contacteditor/cdo/ContactDataObject-Save.cpp +++ b/source/contacteditor/cdo/ContactDataObject-Save.cpp @@ -376,7 +376,37 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){ &BusinessNicknamesListLanguage, &BusinessNicknamesListPref, &BusinessNicknamesListTokens, SaveData, "work"); - // TODO: Process GENDER. + // Process GENDER. + + if (Gender.size() > 0){ + + ProcessData.Append("GENDER"); + + if (GenderTokens.size() > 0){ + + ProcessData.Append(";"); + ProcessData.Append(GenderTokens); + + } + + ProcessData.Append(":"); + ProcessData.Append(Gender); + + if (GenderDetails.size() > 0){ + + ProcessData.Append(";"); + ProcessData.Append(GenderDetails); + + } + + ProcessData.Append("\n"); + + ProcessData = OutputText(&ProcessData); + + SaveData->Append(ProcessData); + ProcessData.clear(); + + } // TODO: Process BDAY. diff --git a/source/tests/xestiaab_contactsave.h b/source/tests/xestiaab_contactsave.h index 414df44..ad719f5 100644 --- a/source/tests/xestiaab_contactsave.h +++ b/source/tests/xestiaab_contactsave.h @@ -89,6 +89,7 @@ TEST(ContactSave, ContactSaveTests){ " y\n" "NICKNAME;TYPE=work;ALTID=99;LANGUAGE=en-GB;PID=10;PREF=1;YAY=Maybe;Boop=Boing\n" " :The Testing One\n" + "GENDER;BEEP=Boop:F;Example Text\n" "TITLE;ALTID=20;LANGUAGE=text/plain;PID=21;PREF=22;EEP=LIGHT:Lord of Light\n" "TITLE;TYPE=home;ALTID=30;LANGUAGE=grass/dry;PID=31;PREF=32;EEP=DARK:Lord of D\n" " arkness\n" -- 2.39.5