From: Steve Brokenshire Date: Mon, 28 Dec 2015 03:57:59 +0000 (+0000) Subject: Replaced string processing in FN with ProcessStringValue. X-Git-Tag: release-0.09~179 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=e853e78e586e6de204aeb733e05cccd6d568929a;hp=9df6fa24ffcd0cb8e6b5f5fc5ec4f09bb411ac89;p=xestiaab%2F.git Replaced string processing in FN with ProcessStringValue. --- diff --git a/source/contacteditor/ContactDataObject.cpp b/source/contacteditor/ContactDataObject.cpp index d794af2..56b2846 100644 --- a/source/contacteditor/ContactDataObject.cpp +++ b/source/contacteditor/ContactDataObject.cpp @@ -807,6 +807,7 @@ void ContactDataObject::ProcessFN(wxString PropertySeg1, wxString PropertySeg2, wxString PropertyTokens; std::map::iterator SLiter; bool FirstToken = TRUE; + bool PropertyMatched = FALSE; for (std::map::iterator intiter = SplitPoints.begin(); intiter != SplitPoints.end(); ++intiter){ @@ -832,27 +833,24 @@ void ContactDataObject::ProcessFN(wxString PropertySeg1, wxString PropertySeg2, FullNamesListType.insert(std::make_pair(*FNCount, PropertyValue)); } + + PropertyMatched = TRUE; - } else if (PropertyName == wxT("LANGUAGE")){ - - FullNamesListLanguage.erase(*FNCount); - FullNamesListLanguage.insert(std::make_pair(*FNCount, PropertyValue)); + } - } else if (PropertyName == wxT("ALTID")){ + ProcessStringValue(&PropertyName, "ALTID", &FullNamesListAltID, &PropertyValue, FNCount, &PropertyMatched); + ProcessStringValue(&PropertyName, "PID", &FullNamesListPID, &PropertyValue, FNCount, &PropertyMatched); + ProcessStringValue(&PropertyName, "LANGUAGE", &FullNamesListLanguage, &PropertyValue, FNCount, &PropertyMatched); + ProcessIntegerValue(&PropertyName, "PREF", &FullNamesListPref, &PropertyValue, FNCount, &PropertyMatched); - FullNamesListAltID.erase(*FNCount); - FullNamesListAltID.insert(std::make_pair(*FNCount, PropertyValue)); + if (PropertyMatched == TRUE){ - } else if (PropertyName == wxT("PID")){ - - FullNamesListPID.erase(*FNCount); - FullNamesListPID.insert(std::make_pair(*FNCount, PropertyValue)); + PropertyMatched = FALSE; + continue; - } else if (PropertyName == wxT("PREF")){ - - ProcessIntegerValue(&FullNamesListPref, &PropertyValue, FNCount); + } - } else if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty()){ + if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty()){ if (FirstToken == TRUE){