Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Removed ContactDataObject point for ProcessIntegerValue and introduced ProcessStringV...
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 28 Dec 2015 03:03:07 +0000 (03:03 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 28 Dec 2015 03:03:07 +0000 (03:03 +0000)
source/contacteditor/ContactDataObject.cpp
source/contacteditor/ContactDataObject.h

index 1acc7f9..bc45c48 100644 (file)
@@ -611,7 +611,7 @@ void ContactDataObject::ProcessSource(wxString PropertySeg1, wxString PropertySe
                
                } else if (PropertyName == wxT("PREF")){
                        
-                       ProcessIntegerValue(this, &SourceListPref, &PropertyValue, SourceCount);
+                       ProcessIntegerValue(&SourceListPref, &PropertyValue, SourceCount);
 
                } else if (PropertyName == wxT("MEDIATYPE")){
                
@@ -769,7 +769,7 @@ void ContactDataObject::ProcessMember(wxString PropertySeg1, wxString PropertySe
                
                } else if (PropertyName == wxT("PREF")){
 
-                       ProcessIntegerValue(this, &GroupsListPref, &PropertyValue, GroupCount);
+                       ProcessIntegerValue(&GroupsListPref, &PropertyValue, GroupCount);
                
                } else if (PropertyName == wxT("MEDIATYPE")){
 
@@ -866,7 +866,7 @@ void ContactDataObject::ProcessFN(wxString PropertySeg1, wxString PropertySeg2,
                
                } else if (PropertyName == wxT("PREF")){
 
-                       ProcessIntegerValue(this, &FullNamesListPref, &PropertyValue, FNCount);
+                       ProcessIntegerValue(&FullNamesListPref, &PropertyValue, FNCount);
                
                } else if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty()){
                        
@@ -1226,7 +1226,7 @@ void ContactDataObject::ProcessNickname(wxString PropertySeg1, wxString Property
 
                } else if (PropertyName == wxT("PREF")){
 
-                       ProcessIntegerValue(this, NicknamesListPref, &PropertyValue, NicknameCount);
+                       ProcessIntegerValue(NicknamesListPref, &PropertyValue, NicknameCount);
                
                } else if (PropertyName == wxT("LANGUAGE")){
 
@@ -1701,7 +1701,7 @@ void ContactDataObject::ProcessTimeZone(wxString PropertySeg1, wxString Property
 
                } else if (PropertyName == wxT("PREF")){
 
-                       ProcessIntegerValue(this, TZListPref, &PropertyValue, TimeZoneCount);
+                       ProcessIntegerValue(TZListPref, &PropertyValue, TimeZoneCount);
                
                } else if (PropertyName == wxT("MEDIATYPE")){
 
@@ -1918,7 +1918,7 @@ void ContactDataObject::ProcessAddress(wxString PropertySeg1, wxString PropertyS
                
                } else if (PropertyName == wxT("PREF")){
 
-                       ProcessIntegerValue(this, AddressListPref, &PropertyValue, AddressCount);
+                       ProcessIntegerValue(AddressListPref, &PropertyValue, AddressCount);
                
                } else {
                
@@ -2183,7 +2183,7 @@ void ContactDataObject::ProcessEmail(wxString PropertySeg1, wxString PropertySeg
                
                } else if (PropertyName == wxT("PREF")){
                        
-                       ProcessIntegerValue(this, EmailListPref, &PropertyValue, EmailCount);
+                       ProcessIntegerValue(EmailListPref, &PropertyValue, EmailCount);
                
                } else {
                
@@ -2318,7 +2318,7 @@ void ContactDataObject::ProcessIM(wxString PropertySeg1, wxString PropertySeg2,
                
                } else if (PropertyName == wxT("PREF")){
                        
-                       ProcessIntegerValue(this, IMListPref, &PropertyValue, IMCount);
+                       ProcessIntegerValue(IMListPref, &PropertyValue, IMCount);
                
                } else {
                
@@ -2612,7 +2612,7 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert
                
                } else if (PropertyName == wxT("PREF")){
 
-                       ProcessIntegerValue(this, TelephoneListPref, &PropertyValue, TelephoneCount);
+                       ProcessIntegerValue(TelephoneListPref, &PropertyValue, TelephoneCount);
                
                } else {
                
@@ -2738,7 +2738,7 @@ void ContactDataObject::ProcessLanguage(wxString PropertySeg1, wxString Property
                
                } else if (PropertyName == wxT("PREF")){
                        
-                       ProcessIntegerValue(this, LanguageListPref, &PropertyValue, LanguageCount);
+                       ProcessIntegerValue(LanguageListPref, &PropertyValue, LanguageCount);
                
                } else {
                
@@ -2872,7 +2872,7 @@ void ContactDataObject::ProcessGeographic(wxString PropertySeg1, wxString Proper
                
                } else if (PropertyName == wxT("PREF")){
 
-                       ProcessIntegerValue(this, GeopositionListPref, &PropertyValue, GeographicCount);
+                       ProcessIntegerValue(GeopositionListPref, &PropertyValue, GeographicCount);
                
                } else {
                
@@ -3108,7 +3108,7 @@ void ContactDataObject::ProcessRelated(wxString PropertySeg1, wxString PropertyS
                
                } else if (PropertyName == wxT("LANGUAGE")){
 
-                       ProcessIntegerValue(this, &GeneralRelatedListPref, &PropertyValue, RelatedCount);
+                       ProcessIntegerValue(&GeneralRelatedListPref, &PropertyValue, RelatedCount);
                
                } else if (PropertyName != wxT("TYPE")) {
                
@@ -3260,7 +3260,7 @@ void ContactDataObject::ProcessURL(wxString PropertySeg1, wxString PropertySeg2,
                        
                } else if (PropertyName == wxT("PREF")){
 
-                       ProcessIntegerValue(this, WebsiteListPref, &PropertyValue, URLCount);
+                       ProcessIntegerValue(WebsiteListPref, &PropertyValue, URLCount);
                                                        
                } else if (PropertyName == wxT("MEDIATYPE")){
                
@@ -3418,7 +3418,7 @@ void ContactDataObject::ProcessTitle(wxString PropertySeg1, wxString PropertySeg
                
                } else if (PropertyName == wxT("PREF")){
 
-                       ProcessIntegerValue(this, TitleListPref, &PropertyValue, TitleCount);
+                       ProcessIntegerValue(TitleListPref, &PropertyValue, TitleCount);
                        
                } else if (PropertyName == wxT("LANGUAGE")){
                
@@ -3576,7 +3576,7 @@ void ContactDataObject::ProcessRole(wxString PropertySeg1, wxString PropertySeg2
                
                } else if (PropertyName == wxT("PREF")){
 
-                       ProcessIntegerValue(this, RoleListPref, &PropertyValue, RoleCount);
+                       ProcessIntegerValue(RoleListPref, &PropertyValue, RoleCount);
                                
                } else if (PropertyName == wxT("LANGUAGE")){
                
@@ -3743,7 +3743,7 @@ void ContactDataObject::ProcessOrganisation(wxString PropertySeg1, wxString Prop
                
                } else if (PropertyName == wxT("PREF")){
 
-                       ProcessIntegerValue(this, OrganisationsListPref, &PropertyValue, OrganisationCount);
+                       ProcessIntegerValue(OrganisationsListPref, &PropertyValue, OrganisationCount);
                        
                } else if (PropertyName == wxT("LANGUAGE")){
                
@@ -3901,7 +3901,7 @@ void ContactDataObject::ProcessNote(wxString PropertySeg1, wxString PropertySeg2
                
                } else if (PropertyName == wxT("PREF")){
 
-                       ProcessIntegerValue(this, NoteListPref, &PropertyValue, NoteCount);
+                       ProcessIntegerValue(NoteListPref, &PropertyValue, NoteCount);
                
                } else if (PropertyName == wxT("LANGUAGE")){
                
@@ -4030,7 +4030,7 @@ void ContactDataObject::ProcessCategory(wxString PropertySeg1, wxString Property
                
                } else if (PropertyName == wxT("PREF")){
 
-                       ProcessIntegerValue(this, &CategoriesListPref, &PropertyValue, CategoryCount);
+                       ProcessIntegerValue(&CategoriesListPref, &PropertyValue, CategoryCount);
                        
                } else if (PropertyName == wxT("LANGUAGE")){
                
@@ -4303,7 +4303,7 @@ void ContactDataObject::ProcessPhoto(wxString PropertySeg1, wxString PropertySeg
                
                } else if (PropertyName == wxT("PREF")){
 
-                       ProcessIntegerValue(this, &PicturesListPref, &PropertyValue, PhotoCount);
+                       ProcessIntegerValue(&PicturesListPref, &PropertyValue, PhotoCount);
                
                } else if (PropertyName == wxT("MEDIATYPE")){
                
@@ -4504,7 +4504,7 @@ void ContactDataObject::ProcessLogo(wxString PropertySeg1, wxString PropertySeg2
                
                } else if (PropertyName == wxT("PREF")){
 
-                       ProcessIntegerValue(this, &LogosListPref, &PropertyValue, LogoCount);
+                       ProcessIntegerValue(&LogosListPref, &PropertyValue, LogoCount);
                
                } else if (PropertyName == wxT("MEDIATYPE")){
                
@@ -4705,7 +4705,7 @@ void ContactDataObject::ProcessSound(wxString PropertySeg1, wxString PropertySeg
                
                } else if (PropertyName == wxT("PREF")){
 
-                       ProcessIntegerValue(this, &SoundsListPref, &PropertyValue, SoundCount);
+                       ProcessIntegerValue(&SoundsListPref, &PropertyValue, SoundCount);
                
                } else if (PropertyName == wxT("MEDIATYPE")){
                
@@ -4911,7 +4911,7 @@ void ContactDataObject::ProcessCalendarURI(wxString PropertySeg1, wxString Prope
                
                } else if (PropertyName == wxT("PREF")){
 
-                       ProcessIntegerValue(this, &CalendarListPref, &PropertyValue, CalURICount);
+                       ProcessIntegerValue(&CalendarListPref, &PropertyValue, CalURICount);
                
                } else if (PropertyName == wxT("MEDIATYPE")){
                
@@ -5047,7 +5047,7 @@ void ContactDataObject::ProcessCalendarAddressURI(wxString PropertySeg1, wxStrin
                
                } else if (PropertyName == wxT("PREF")){
 
-                       ProcessIntegerValue(this, &CalendarRequestListPref, &PropertyValue, CalAdrURICount);
+                       ProcessIntegerValue(&CalendarRequestListPref, &PropertyValue, CalAdrURICount);
                
                } else if (PropertyName == wxT("MEDIATYPE")){
                
@@ -5183,7 +5183,7 @@ void ContactDataObject::ProcessCalendarFreeBusy(wxString PropertySeg1, wxString
                
                } else if (PropertyName == wxT("PREF")){
 
-                       ProcessIntegerValue(this, &FreeBusyListPref, &PropertyValue, FreeBusyAddressCount);
+                       ProcessIntegerValue(&FreeBusyListPref, &PropertyValue, FreeBusyAddressCount);
                
                } else if (PropertyName == wxT("MEDIATYPE")){
                
@@ -5317,24 +5317,8 @@ void ContactDataObject::ProcessKey(wxString PropertySeg1, wxString PropertySeg2,
                        KeyListPID.insert(std::make_pair(*KeyCount, 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){
-
-                               KeyListPref.erase(*KeyCount);
-                               KeyListPref.insert(std::make_pair(*KeyCount, PriorityNumber));
-
-                       }
+                       ProcessIntegerValue(&KeyListPref, &PropertyValue, KeyCount);
                
                } else {
                
@@ -5508,8 +5492,20 @@ void ContactDataObject::ProcessVendor(wxString PropertySeg1, wxString PropertySe
 
 }
 
-void ProcessIntegerValue(ContactDataObject *ContactData,
-       std::map<int,int> *PrefPtr, 
+void ProcessStringValue(wxString *PropertyName,
+       wxString PropertyNameMatch,
+       std::map<int,wxString> *MapPtr,
+       wxString *PropertyValue,
+       int *ItemCount){
+
+       if (*PropertyName == PropertyNameMatch){
+               MapPtr->erase(*ItemCount);
+               MapPtr->insert(std::make_pair(*ItemCount, *PropertyValue));
+       }
+       
+}
+
+void ProcessIntegerValue(std::map<int,int> *PrefPtr, 
        wxString *PropertyValue, 
        int *ItemCount){
 
index 1df38ff..a6e9761 100644 (file)
@@ -618,9 +618,14 @@ void CheckType(wxString *PropertySeg1,
        int *intPrevValue, 
        PropertyType *intType);
 
-void ProcessIntegerValue(ContactDataObject *ContactData,
-       std::map<int,int> *PrefPtr, 
+void ProcessIntegerValue(std::map<int,int> *PrefPtr, 
        wxString *PropertyValue, 
        int *ItemCount);
 
+void ProcessStringValue(wxString *PropertyName,
+       wxString PropertyNameMatch,
+       std::map<int,wxString> *MapPtr,
+       wxString *PropertyValue,
+       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