Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Replaced PREF code for SOURCE with ProcessIntegerValue.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 28 Dec 2015 01:47:17 +0000 (01:47 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 28 Dec 2015 01:47:17 +0000 (01:47 +0000)
source/contacteditor/ContactDataObject.cpp
source/contacteditor/ContactDataObject.h

index 532884d..12486bc 100644 (file)
@@ -611,24 +611,8 @@ void ContactDataObject::ProcessSource(wxString PropertySeg1, wxString PropertySe
                
                } 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){
+                       ProcessIntegerValue(this, &SourceListPref, &PropertyValue, SourceCount);
 
-                               SourceListPref.erase(*SourceCount);
-                               SourceListPref.insert(std::make_pair(*SourceCount, PriorityNumber));
-
-                       }
-               
                } else if (PropertyName == wxT("MEDIATYPE")){
                
                        SourceListMediatype.erase(*SourceCount);
@@ -5878,9 +5862,9 @@ void ContactDataObject::ProcessVendor(wxString PropertySeg1, wxString PropertySe
 }
 
 void ProcessIntegerValue(ContactDataObject *ContactData,
-       std::map<int,int> *KeyListPref
+       std::map<int,int> *PrefPtr
        wxString *PropertyValue, 
-       int *KeyCount){
+       int *ItemCount){
 
        int PriorityNumber = 0; 
        bool ValidNumber = TRUE;
@@ -5895,8 +5879,8 @@ void ProcessIntegerValue(ContactDataObject *ContactData,
 
        if (ValidNumber == TRUE){
 
-               KeyListPref->erase(*KeyCount);
-               KeyListPref->insert(std::make_pair(*KeyCount, PriorityNumber));
+               PrefPtr->erase(*ItemCount);
+               PrefPtr->insert(std::make_pair(*ItemCount, PriorityNumber));
 
        }
 
index 9e1be8a..1df38ff 100644 (file)
@@ -619,8 +619,8 @@ void CheckType(wxString *PropertySeg1,
        PropertyType *intType);
 
 void ProcessIntegerValue(ContactDataObject *ContactData,
-       std::map<int,int> *KeyListPref
+       std::map<int,int> *PrefPtr
        wxString *PropertyValue, 
-       int *KeyCount);
+       int *ItemCount);
 
 #endif
\ No newline at end of file
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