X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FContactDataObject.cpp;h=23c53f3999116a01fe7332b5962439067289d744;hb=0a749c36a873e196f41a5f8c7da3f09592bf24fb;hp=f842c0443627c77e4a48dfe7ba36a877b7c68902;hpb=8d9662980f611a36364ba6d567a2ba9f4e3f8076;p=xestiaab%2F.git diff --git a/source/contacteditor/ContactDataObject.cpp b/source/contacteditor/ContactDataObject.cpp index f842c04..23c53f3 100644 --- a/source/contacteditor/ContactDataObject.cpp +++ b/source/contacteditor/ContactDataObject.cpp @@ -2183,23 +2183,7 @@ void ContactDataObject::ProcessEmail(wxString PropertySeg1, wxString PropertySeg } 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){ - - EmailListPref->erase(*EmailCount); - EmailListPref->insert(std::make_pair(*EmailCount, PriorityNumber)); - - } + ProcessIntegerValue(this, EmailListPref, &PropertyValue, EmailCount); } else { @@ -2334,23 +2318,7 @@ void ContactDataObject::ProcessIM(wxString PropertySeg1, wxString PropertySeg2, } 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){ - - IMListPref->erase(*IMCount); - IMListPref->insert(std::make_pair(*IMCount, PriorityNumber)); - - } + ProcessIntegerValue(this, IMListPref, &PropertyValue, IMCount); } else {