From: Steve Brokenshire Date: Mon, 28 Dec 2015 01:37:21 +0000 (+0000) Subject: Added the ProcessIntegerValue subroutine. X-Git-Tag: release-0.09~206 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=772e3145d141c511dcdcffbc59158a28aa4c3901;p=xestiaab%2F.git Added the ProcessIntegerValue subroutine. --- diff --git a/source/contacteditor/ContactDataObject.cpp b/source/contacteditor/ContactDataObject.cpp index ffca460..532884d 100644 --- a/source/contacteditor/ContactDataObject.cpp +++ b/source/contacteditor/ContactDataObject.cpp @@ -5877,6 +5877,31 @@ void ContactDataObject::ProcessVendor(wxString PropertySeg1, wxString PropertySe } +void ProcessIntegerValue(ContactDataObject *ContactData, + std::map *KeyListPref, + wxString *PropertyValue, + int *KeyCount){ + + 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)); + + } + +} + void SplitValues(wxString *PropertyLine, std::map *SplitPoints, std::map *SplitLength, diff --git a/source/contacteditor/ContactDataObject.h b/source/contacteditor/ContactDataObject.h index 4cf459d..9e1be8a 100644 --- a/source/contacteditor/ContactDataObject.h +++ b/source/contacteditor/ContactDataObject.h @@ -618,4 +618,9 @@ void CheckType(wxString *PropertySeg1, int *intPrevValue, PropertyType *intType); +void ProcessIntegerValue(ContactDataObject *ContactData, + std::map *KeyListPref, + wxString *PropertyValue, + int *KeyCount); + #endif \ No newline at end of file