X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FContactDataObject.cpp;h=6247596bd22c3bdf3c92961822084f415326efbb;hb=7d729a4ae2a2f9255de6ea3babe3d5ee983fd1fd;hp=e9784dc661df6b09a1cbf8f694c42d0766816bc6;hpb=c556f865d9d5e104b8f60dd16828da22ea79b087;p=xestiaab%2F.git diff --git a/source/contacteditor/ContactDataObject.cpp b/source/contacteditor/ContactDataObject.cpp index e9784dc..6247596 100644 --- a/source/contacteditor/ContactDataObject.cpp +++ b/source/contacteditor/ContactDataObject.cpp @@ -2871,24 +2871,8 @@ void ContactDataObject::ProcessGeographic(wxString PropertySeg1, wxString Proper GeopositionListMediatype->insert(std::make_pair(*GeographicCount, 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){ - GeopositionListPref->erase(*GeographicCount); - GeopositionListPref->insert(std::make_pair(*GeographicCount, PriorityNumber)); - - } + ProcessIntegerValue(this, GeopositionListPref, &PropertyValue, GeographicCount); } else { @@ -3123,9 +3107,8 @@ void ContactDataObject::ProcessRelated(wxString PropertySeg1, wxString PropertyS } } else if (PropertyName == wxT("LANGUAGE")){ - - GeneralRelatedListLanguage.erase(*RelatedCount); - GeneralRelatedListLanguage.insert(std::make_pair(*RelatedCount, PropertyValue)); + + ProcessIntegerValue(this, &GeneralRelatedListPref, &PropertyValue, RelatedCount); } else if (PropertyName != wxT("TYPE")) { @@ -3276,25 +3259,9 @@ void ContactDataObject::ProcessURL(wxString PropertySeg1, wxString PropertySeg2, WebsiteListPID->insert(std::make_pair(*URLCount, 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){ - WebsiteListPref->erase(*URLCount); - WebsiteListPref->insert(std::make_pair(*URLCount, PriorityNumber)); - - } - + ProcessIntegerValue(this, WebsiteListPref, &PropertyValue, URLCount); + } else if (PropertyName == wxT("MEDIATYPE")){ WebsiteListMediatype->erase(*URLCount); @@ -3450,25 +3417,9 @@ void ContactDataObject::ProcessTitle(wxString PropertySeg1, wxString PropertySeg TitleListPID->insert(std::make_pair(*TitleCount, 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){ - - TitleListPref->erase(*TitleCount); - TitleListPref->insert(std::make_pair(*TitleCount, PriorityNumber)); - - } - + ProcessIntegerValue(this, TitleListPref, &PropertyValue, TitleCount); + } else if (PropertyName == wxT("LANGUAGE")){ TitleListLanguage->erase(*TitleCount);