From e853e78e586e6de204aeb733e05cccd6d568929a Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Mon, 28 Dec 2015 03:57:59 +0000 Subject: [PATCH 1/1] Replaced string processing in FN with ProcessStringValue. --- source/contacteditor/ContactDataObject.cpp | 28 ++++++++++------------ 1 file changed, 13 insertions(+), 15 deletions(-) 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){ -- 2.39.2