Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added N to the SaveString function of ContactDataObject
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 3 Jul 2016 15:41:12 +0000 (16:41 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 3 Jul 2016 15:41:12 +0000 (16:41 +0100)
source/contacteditor/cdo/ContactDataObject-Save.cpp
source/tests/xestiaab_contactsave.h

index daf6159..8747ae3 100644 (file)
@@ -297,6 +297,70 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){
                        
        }
        
+       // Process N.
+       
+       if (!NameTitle.IsEmpty() || !NameForename.IsEmpty() || !NameSurname.IsEmpty() ||
+               !NameOtherNames.IsEmpty() || !NameSuffix.IsEmpty()){
+               
+               ProcessData.Append("N");
+               
+               // Check if there is a value for ALTID.
+               
+               if (NameAltID.size() > 0){
+               
+                       ProcessData.Append(";ALTID=");
+                       ProcessData.Append(NameAltID);
+                       
+               }
+
+               // Check if there is a value for LANGUAGE.
+               
+               if (NameLanguage.size() > 0){
+               
+                       ProcessData.Append(";LANGUAGE=");
+                       ProcessData.Append(NameLanguage);
+                       
+               }
+               
+               // Check if there is a value for SORT-AS.
+               
+               if (NameDisplayAs.size() > 0){
+               
+                       ProcessData.Append(";SORT-AS=\"");
+                       ProcessData.Append(NameDisplayAs);
+                       ProcessData.Append("\"");
+                       
+               }
+
+               // Check if there is a value for tokens.
+
+               if (NameTokens.size() > 0){
+               
+                       ProcessData.Append(";");
+                       ProcessData.Append(NameTokens);
+                       
+               }
+                       
+               ProcessData.Append(":");
+               ProcessData.Append(NameSurname);
+               ProcessData.Append(";");
+               ProcessData.Append(NameForename);
+               ProcessData.Append(";");
+               ProcessData.Append(NameOtherNames);
+               ProcessData.Append(";");
+               ProcessData.Append(NameTitle);
+               ProcessData.Append(";");
+               ProcessData.Append(NameSuffix);
+               
+               ProcessData.Append("\n");
+
+               ProcessData = OutputText(&ProcessData);
+               
+               SaveData->Append(ProcessData);
+               ProcessData.clear();
+                       
+       }
+       
        // Process NICKNAME.
        
        SaveNickname(&GeneralNicknamesList, &GeneralNicknamesListAltID, 
@@ -312,6 +376,12 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){
                &BusinessNicknamesListLanguage, &BusinessNicknamesListPref, 
                &BusinessNicknamesListTokens, SaveData, "work");
        
+       // TODO: Process GENDER.
+       
+       // TODO: Process BDAY.
+       
+       // TODO: Process ANNIVERSARY.
+       
        // Process TITLE.
 
        SaveTitle(&GeneralTitleList, &GeneralTitleListLanguage,
index d0c2cfe..414df44 100644 (file)
@@ -82,6 +82,8 @@ TEST(ContactSave, ContactSaveTests){
        "CLIENTPIDMAP;MEEP=MOO;WOOP=WOO:3;urn;uuid:bbbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb\n"
        " bb\n"
        "FN;TYPE=work;LANGUAGE=kw;ALTID=500;PID=40;PREF=45;EXAMPLE=Baaa:Test Contact\n"
+       "N;ALTID=3;LANGUAGE=kw;SORT-AS=\"Contact,Test\";TEST=Yes:Contact;Test;Example;Ro\n"
+       " bot;LOONY\n"
        "NICKNAME;ALTID=35;LANGUAGE=kw;PID=50;PREF=40;YAY=Nope;Beep=Boop:Tester\n"
        "NICKNAME;TYPE=home;ALTID=17;LANGUAGE=en;PID=39;PREF=78;YAY=Yep;Beep=Boop:Test\n"
        " y\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