From 2031be04c0036b44c40c473a07fdd31e898b2a11 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Fri, 12 Jan 2018 00:09:07 +0000 Subject: [PATCH] vCard: Look at full name if no names exist --- source/vcard/vcard.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/vcard/vcard.cpp b/source/vcard/vcard.cpp index bc9cd81..fb34ab4 100644 --- a/source/vcard/vcard.cpp +++ b/source/vcard/vcard.cpp @@ -190,6 +190,15 @@ vCardName vCard::GetName(){ vCardName NameData; ArrayvCardOutData NameArray = this->GetByPartial(wxT("N")); //wxString NameDataGet = NameArray.PropValues[0]; + + if (NameArray.PropValues.Count() == 0) + { + // Use FN if there is no N values set. + wxString fullName = this->Get(wxT("FN")); + NameData.Forename = fullName; + return NameData; + } + wxString NameDataGet = NameArray.PropValues[0]; std::map SplitPoints; std::map SplitLength; -- 2.39.2