Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Replaced code in PREF for TEL and LANGUAGE with ProcessIntegerValue.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 28 Dec 2015 02:10:22 +0000 (02:10 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 28 Dec 2015 02:10:22 +0000 (02:10 +0000)
source/contacteditor/ContactDataObject.cpp

index 23c53f3..e9784dc 100644 (file)
@@ -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 {
                
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy