From: Steve Brokenshire Date: Mon, 28 Dec 2015 02:10:22 +0000 (+0000) Subject: Replaced code in PREF for TEL and LANGUAGE with ProcessIntegerValue. X-Git-Tag: release-0.09~197 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=c556f865d9d5e104b8f60dd16828da22ea79b087;p=xestiaab%2F.git Replaced code in PREF for TEL and LANGUAGE with ProcessIntegerValue. --- diff --git a/source/contacteditor/ContactDataObject.cpp b/source/contacteditor/ContactDataObject.cpp index 23c53f3..e9784dc 100644 --- a/source/contacteditor/ContactDataObject.cpp +++ b/source/contacteditor/ContactDataObject.cpp @@ -2611,24 +2611,8 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert TelephoneListPID->insert(std::make_pair(*TelephoneCount, PropertyValue)); } else if (PropertyName == wxT("PREF")){ - - int PriorityNumber = 0; - bool ValidNumber = TRUE; - - try{ - PriorityNumber = std::stoi(PropertyValue.ToStdString()); - } - - catch(std::invalid_argument &e){ - ValidNumber = FALSE; - } - if (ValidNumber == TRUE){ - - TelephoneListPref->erase(*TelephoneCount); - TelephoneListPref->insert(std::make_pair(*TelephoneCount, PriorityNumber)); - - } + ProcessIntegerValue(this, TelephoneListPref, &PropertyValue, TelephoneCount); } else { @@ -2754,23 +2738,7 @@ void ContactDataObject::ProcessLanguage(wxString PropertySeg1, wxString Property } else if (PropertyName == wxT("PREF")){ - int PriorityNumber = 0; - bool ValidNumber = TRUE; - - try{ - PriorityNumber = std::stoi(PropertyValue.ToStdString()); - } - - catch(std::invalid_argument &e){ - ValidNumber = FALSE; - } - - if (ValidNumber == TRUE){ - - LanguageListPref->erase(*LanguageCount); - LanguageListPref->insert(std::make_pair(*LanguageCount, PriorityNumber)); - - } + ProcessIntegerValue(this, LanguageListPref, &PropertyValue, LanguageCount); } else {