// Split the name into sections.
- vCardDataString = Person.Get(wxT("N"));
-
vCardName NameData = Person.GetName();
vCardDataString = NameData.Forename + wxT(" ") + NameData.Surname;
// First Name, Last Name.
- lstContacts->SetItem(longSelected, 0, ucd->ContactNameArray.Forename + wxT(" ") + ucd->ContactNameArray.Surname);
+ if (ucd->ContactNameArray.Forename == wxT("") && ucd->ContactNameArray.Surname == wxT(""))
+ {
+ lstContacts->SetItem(longSelected, 0, ucd->ContactName);
+ }
+ else
+ {
+ lstContacts->SetItem(longSelected, 0, ucd->ContactNameArray.Forename + wxT(" ") + ucd->ContactNameArray.Surname);
+ }
} else if (SortMode == 2){
// Last Name, First Name.
-
- lstContacts->SetItem(longSelected, 0, ucd->ContactNameArray.Surname + wxT(", ") + ucd->ContactNameArray.Forename);
+
+ if (ucd->ContactNameArray.Forename == wxT("") && ucd->ContactNameArray.Surname == wxT(""))
+ {
+ lstContacts->SetItem(longSelected, 0, wxT(", ") + ucd->ContactName);
+ }
+ else
+ {
+ lstContacts->SetItem(longSelected, 0, ucd->ContactNameArray.Surname + wxT(", ") + ucd->ContactNameArray.Forename);
+ }
} else if (SortMode == 3){
// Nickname.
- lstContacts->SetItem(longSelected, 0, ucd->ContactNickname);
+ if (ucd->ContactNickname == wxT(""))
+ {
+ lstContacts->SetItem(longSelected, 0, _("(no nickname)"));
+ }
+ else
+ {
+ lstContacts->SetItem(longSelected, 0, ucd->ContactNickname);
+ }
} else if (SortMode == 4){