Not Logged In
|
Login
|
Register
Home
|
News
|
Projects
|
Releases
Bugs
|
RFE
|
Repositories
|
Help
projects
/
xestiaab
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replaced the PREF code in NOTE with ProcessIntegerValue.
[xestiaab/.git]
/
source
/
contacteditor
/
ContactDataObject.cpp
diff --git
a/source/contacteditor/ContactDataObject.cpp
b/source/contacteditor/ContactDataObject.cpp
index
e9784dc
..
0dbc421
100644
(file)
--- 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")){
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 {
} else {
@@
-3123,9
+3107,8
@@
void ContactDataObject::ProcessRelated(wxString PropertySeg1, wxString PropertyS
}
} else if (PropertyName == wxT("LANGUAGE")){
}
} 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")) {
} 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")){
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);
} 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")){
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);
} else if (PropertyName == wxT("LANGUAGE")){
TitleListLanguage->erase(*TitleCount);
@@
-3624,25
+3575,9
@@
void ContactDataObject::ProcessRole(wxString PropertySeg1, wxString PropertySeg2
RoleListPID->insert(std::make_pair(*RoleCount, PropertyValue));
} else if (PropertyName == wxT("PREF")){
RoleListPID->insert(std::make_pair(*RoleCount, 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){
- RoleListPref->erase(*RoleCount);
- RoleListPref->insert(std::make_pair(*RoleCount, PriorityNumber));
-
- }
-
+ ProcessIntegerValue(this, RoleListPref, &PropertyValue, RoleCount);
+
} else if (PropertyName == wxT("LANGUAGE")){
RoleListLanguage->erase(*RoleCount);
} else if (PropertyName == wxT("LANGUAGE")){
RoleListLanguage->erase(*RoleCount);
@@
-3807,25
+3742,9
@@
void ContactDataObject::ProcessOrganisation(wxString PropertySeg1, wxString Prop
OrganisationsListSortAs->insert(std::make_pair(*OrganisationCount, PropertyValue));
} else if (PropertyName == wxT("PREF")){
OrganisationsListSortAs->insert(std::make_pair(*OrganisationCount, 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){
- OrganisationsListPref->erase(*OrganisationCount);
- OrganisationsListPref->insert(std::make_pair(*OrganisationCount, PriorityNumber));
-
- }
-
+ ProcessIntegerValue(this, OrganisationsListPref, &PropertyValue, OrganisationCount);
+
} else if (PropertyName == wxT("LANGUAGE")){
OrganisationsListLanguage->erase(*OrganisationCount);
} else if (PropertyName == wxT("LANGUAGE")){
OrganisationsListLanguage->erase(*OrganisationCount);
@@
-3981,25
+3900,9
@@
void ContactDataObject::ProcessNote(wxString PropertySeg1, wxString PropertySeg2
NoteListPID->insert(std::make_pair(*NoteCount, PropertyValue));
} else if (PropertyName == wxT("PREF")){
NoteListPID->insert(std::make_pair(*NoteCount, 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){
-
- NoteListPref->erase(*NoteCount);
- NoteListPref->insert(std::make_pair(*NoteCount, PriorityNumber));
-
- }
-
+ ProcessIntegerValue(this, NoteListPref, &PropertyValue, NoteCount);
+
} else if (PropertyName == wxT("LANGUAGE")){
NoteListLanguage->erase(*NoteCount);
} else if (PropertyName == wxT("LANGUAGE")){
NoteListLanguage->erase(*NoteCount);
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software
Xestia Address Book
Xestia Calendar
Development
Xestia Gelforn
Everything else
About
News
Privacy Policy