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 LOGO and SOUND with ProcessIntegerValue.
[xestiaab/.git]
/
source
/
contacteditor
/
ContactDataObject.cpp
diff --git
a/source/contacteditor/ContactDataObject.cpp
b/source/contacteditor/ContactDataObject.cpp
index
238484a
..
9d9434d
100644
(file)
--- a/
source/contacteditor/ContactDataObject.cpp
+++ b/
source/contacteditor/ContactDataObject.cpp
@@
-3107,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")) {
@@
-3260,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);
@@
-3434,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);
@@
-3608,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);
@@
-3791,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);
@@
-3965,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);
@@
-4110,25
+4029,9
@@
void ContactDataObject::ProcessCategory(wxString PropertySeg1, wxString Property
CategoriesListPID.insert(std::make_pair(*CategoryCount, PropertyValue));
} else if (PropertyName == wxT("PREF")){
CategoriesListPID.insert(std::make_pair(*CategoryCount, 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){
-
- CategoriesListPref.erase(*CategoryCount);
- CategoriesListPref.insert(std::make_pair(*CategoryCount, PriorityNumber));
-
- }
-
+ ProcessIntegerValue(this, &CategoriesListPref, &PropertyValue, CategoryCount);
+
} else if (PropertyName == wxT("LANGUAGE")){
CategoriesListLanguage.erase(*CategoryCount);
} else if (PropertyName == wxT("LANGUAGE")){
CategoriesListLanguage.erase(*CategoryCount);
@@
-4399,24
+4302,8
@@
void ContactDataObject::ProcessPhoto(wxString PropertySeg1, wxString PropertySeg
PicturesListPID.insert(std::make_pair(*PhotoCount, PropertyValue));
} else if (PropertyName == wxT("PREF")){
PicturesListPID.insert(std::make_pair(*PhotoCount, 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){
- PicturesListPref.erase(*PhotoCount);
- PicturesListPref.insert(std::make_pair(*PhotoCount, PriorityNumber));
-
- }
+ ProcessIntegerValue(this, &PicturesListPref, &PropertyValue, PhotoCount);
} else if (PropertyName == wxT("MEDIATYPE")){
} else if (PropertyName == wxT("MEDIATYPE")){
@@
-4616,24
+4503,8
@@
void ContactDataObject::ProcessLogo(wxString PropertySeg1, wxString PropertySeg2
LogosListPID.insert(std::make_pair(*LogoCount, PropertyValue));
} else if (PropertyName == wxT("PREF")){
LogosListPID.insert(std::make_pair(*LogoCount, 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){
-
- LogosListPref.erase(*LogoCount);
- LogosListPref.insert(std::make_pair(*LogoCount, PriorityNumber));
-
- }
+ ProcessIntegerValue(this, &LogosListPref, &PropertyValue, LogoCount);
} else if (PropertyName == wxT("MEDIATYPE")){
} else if (PropertyName == wxT("MEDIATYPE")){
@@
-4833,24
+4704,8
@@
void ContactDataObject::ProcessSound(wxString PropertySeg1, wxString PropertySeg
SoundsListPID.insert(std::make_pair(*SoundCount, PropertyValue));
} else if (PropertyName == wxT("PREF")){
SoundsListPID.insert(std::make_pair(*SoundCount, 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){
-
- SoundsListPref.erase(*SoundCount);
- SoundsListPref.insert(std::make_pair(*SoundCount, PriorityNumber));
-
- }
+ ProcessIntegerValue(this, &SoundsListPref, &PropertyValue, SoundCount);
} else if (PropertyName == wxT("MEDIATYPE")){
} else if (PropertyName == wxT("MEDIATYPE")){
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software
Xestia Address Book
Xestia Calendar
Development
Xestia Gelforn
Everything else
About
News
Privacy Policy