- if (intType == 0){ GeneralIMListMediatype.erase(intValueSeek); GeneralIMListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeIMListMediatype.erase(intValueSeek); HomeIMListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessIMListMediatype.erase(intValueSeek); BusinessIMListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else {
-
- // Something else we don't know about so append
- // to the tokens variable.
-
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
-
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
-
- }
-
- }
-
- }
-
- // Split the address.
-
- //std::map<int, int>::iterator SLiter;
- intPropertyLen = wxSPropertySeg2.Len();
- SplitPoints.clear();
- SplitLength.clear();
- intSplitsFound = 0;
- intSplitSize = 0;
- intPrevValue = 0;
-
- for (int i = 0; i <= intPropertyLen; i++){
-
- intSplitSize++;
-
- if (wxSPropertySeg2.Mid(i, 1) == wxT(":") && wxSPropertySeg2.Mid((i - 1), 1) != wxT("\\")){
-
- intSplitsFound++;
- SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
-
- if (intSplitsFound == 1){
-
- SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
- break;
-
- }
-
- intSplitSize = 0;
-
- }
-
- }
-
- // Split the data into several parts.
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- if (intiter->first == 1){
-
- // Deal with PO Box.
-
- SLiter = SplitLength.find(1);
-
- //txtSurname->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(0, SLiter->second), TRUE));
- IMPPType = wxSPropertySeg2.Mid(0, SLiter->second);
- intPrevValue = intiter->second;
-
- IMPPAddress = wxSPropertySeg2.Mid(intPrevValue);
-
- }
-
- }
-
- // Check what IM type it is.
-
- if (IMPPType == wxT("aim")){
-
- IMPPType = wxT("AIM");
-
- } else if (IMPPType == wxT("gg")){
-
- IMPPType = wxT("Gadu-Gadu");
-
- } else if (IMPPType == wxT("icq")){
-
- IMPPType = wxT("ICQ");
-
- } else if (IMPPType == wxT("skype")){
-
- IMPPType = wxT("Skype");
-
- } else if (IMPPType == wxT("xmpp")){
-
- IMPPType = wxT("XMPP");
-
- } else if (IMPPType == wxT("yahoo")){
-
- IMPPType = wxT("Yahoo");
-
- } else {
-
- // Do nothing.
-
- }
-
- // Add the data to the General/Home/Work address variables.
-
- ProcessCaptureStrings(&wxSPropertySeg2);
-
- wxListItem coldata;
-
- coldata.SetId(intValueSeek);
- coldata.SetData(intValueSeek);
- coldata.SetText(IMPPType);
-
- if (intType == 0){
-
- ListCtrlIndex = lboIM->InsertItem(coldata);
-
- lboIM->SetItem(ListCtrlIndex, 1, IMPPAddress);
-
- if (intPref > 0 && intPref < 101){
-
- lboIM->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
-
- }
-
- GeneralIMList.erase(intValueSeek);
- GeneralIMListType.erase(intValueSeek);
- GeneralIMListTokens.erase(intValueSeek);
- GeneralIMList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- GeneralIMListType.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralIMListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- } else if (intType == 1){
-
- ListCtrlIndex = lboHomeIM->InsertItem(coldata);
-
- lboHomeIM->SetItem(ListCtrlIndex, 1, IMPPAddress);
-
- if (intPref > 0 && intPref < 101){
-
- lboHomeIM->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
-
- }
-
- HomeIMList.erase(intValueSeek);
- HomeIMListType.erase(intValueSeek);
- HomeIMListTokens.erase(intValueSeek);
- HomeIMList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- HomeIMListType.insert(std::make_pair(intValueSeek, wxT("home")));
- HomeIMListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- } else if (intType == 2){
-
- ListCtrlIndex = lboBusinessIM->InsertItem(coldata);
-
- lboBusinessIM->SetItem(ListCtrlIndex, 1, IMPPAddress);
-
- if (intPref > 0 && intPref < 101){
-
- lboBusinessIM->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
-
- }
-
- BusinessIMList.erase(intValueSeek);
- BusinessIMListType.erase(intValueSeek);
- BusinessIMListTokens.erase(intValueSeek);
- BusinessIMList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- BusinessIMListType.insert(std::make_pair(intValueSeek, wxT("work")));
- BusinessIMListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- }
-
- IMPPCount++;
- intValueSeek++;
-
- } else if (wxSProperty == wxT("TEL")){
-
- // Check TEL and make sure it is functioning properly.
-
- int intPropertyLen = wxSPropertySeg1.Len();
- std::map<int, int> SplitPoints;
- std::map<int, int> SplitLength;
- std::map<int, int> TypeSplitPoints;
- std::map<int, int> TypeSplitLength;
- std::map<int, int>::iterator SLiter;
- std::map<int, int>::iterator SPoint;
- std::map<int, int>::iterator TSLiter;
- std::map<int, int>::iterator TSPoint;
- wxString PropertyData;
- wxString PropertyName;
- wxString PropertyValue;
- wxString PropertyTokens;
- wxString TelType;
- wxString TelNumber;
- wxString TelTypeUI;
- wxString TelTypeDetail;
- bool AfterFirstProperty = FALSE;
- bool FirstToken = TRUE;
- int intSplitSeek = 0;
- int intSplitsFound = 0;
- int intSplitSize = 0;
- int intPrevValue = 5;
- int intPref = 0;
- int intType = 0;
- int intSplitPoint = 0;
- long ListCtrlIndex;
-
- SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
-
- intPrevValue = 4;
-
- // Look for type before continuing.
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- if (PropertyName == wxT("TYPE")){
-
- // Process each value in type and translate each
- // part.
-
- // Strip out the quotes if they are there.
-
- int intPropertyValueLen = PropertyValue.Len();
-
- if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
-
- PropertyValue.Trim();
- PropertyValue.RemoveLast();
-
- }
-
- if (PropertyValue.Mid(0, 1) == wxT("\"")){
-
- PropertyValue.Remove(0, 1);
-
- }
-
- TelTypeDetail = PropertyValue;
-
- intSplitSize = 0;
- intSplitsFound = 0;
- intSplitPoint = 0;
-
- for (int i = 0; i <= intPropertyValueLen; i++){
-
- intSplitSize++;
-
- if (PropertyValue.Mid(i, 1) == wxT(",") && PropertyValue.Mid((i - 1), 1) != wxT("\\")){
-
- if (intSplitsFound == 0){
-
- TypeSplitPoints.insert(std::make_pair(intSplitsFound, intSplitPoint));
- TypeSplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
-
- } else {
-
- TypeSplitPoints.insert(std::make_pair(intSplitsFound, intSplitPoint));
- TypeSplitLength.insert(std::make_pair(intSplitsFound, intSplitSize));
-
- }
-
- intSplitsFound++;
- i++;
- intSplitPoint = i;
- intSplitSize = 0;
-
- }
-
- }
-
- TypeSplitPoints.insert(std::make_pair(intSplitsFound, intSplitPoint));
- TypeSplitLength.insert(std::make_pair(intSplitsFound, intSplitSize));
-
- int intTypeSeek = 0;
-
- for (std::map<int, int>::iterator typeiter = TypeSplitPoints.begin();
- typeiter != TypeSplitPoints.end(); ++typeiter){
-
- wxString TypePropertyName;
-
- TSLiter = TypeSplitLength.find(typeiter->first);
-
- TypePropertyName = PropertyValue.Mid(typeiter->second, TSLiter->second);
-
- if (intTypeSeek == 0){
-
-
- } else {
-
- TelTypeUI.Append(wxT(","));
-
- }
-
- if (TypePropertyName == wxT("home")){
-
- intType = 1;
-
- } else if (TypePropertyName == wxT("work")){
-
- intType = 2;
-
- }
-
-
- if (TypePropertyName == wxT("text")){
-
- TelTypeUI.Append(_("text"));
- intTypeSeek++;
-
- } else if (TypePropertyName == wxT("voice")){
-
- TelTypeUI.Append(_("voice"));
- intTypeSeek++;
-
- } else if (TypePropertyName == wxT("fax")){
-
- TelTypeUI.Append(_("fax"));
- intTypeSeek++;
-
- } else if (TypePropertyName == wxT("cell")){
-
- TelTypeUI.Append(_("mobile"));
- intTypeSeek++;
-
- } else if (TypePropertyName == wxT("video")){
-
- TelTypeUI.Append(_("video"));
- intTypeSeek++;
-
- } else if (TypePropertyName == wxT("pager")){
-
- TelTypeUI.Append(_("pager"));
- intTypeSeek++;
-
- } else if (TypePropertyName == wxT("textphone")){
-
- TelTypeUI.Append(_("textphone"));
- intTypeSeek++;
-
- }
-
- }
-
- }
-
-
-
- }
-
- // Setup blank lines for later on.
-
- if (intType == 0){
-
- GeneralTelephoneList.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralTelephoneListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralTelephoneListPID.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralTelephoneListPref.insert(std::make_pair(intValueSeek, 0));
- GeneralTelephoneListTokens.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 1){
-
- HomeTelephoneList.insert(std::make_pair(intValueSeek, wxT("")));
- HomeTelephoneListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- HomeTelephoneListPID.insert(std::make_pair(intValueSeek, wxT("")));
- HomeTelephoneListPref.insert(std::make_pair(intValueSeek, 0));
- HomeTelephoneListTokens.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 2){
-
- BusinessTelephoneList.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessTelephoneListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessTelephoneListPID.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessTelephoneListPref.insert(std::make_pair(intValueSeek, 0));
- BusinessTelephoneListTokens.insert(std::make_pair(intValueSeek, wxT("")));
-
- }
-
- intPrevValue = 4;
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- int intPropertyValueLen = PropertyValue.Len();
-
- if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
-
- PropertyValue.Trim();
- PropertyValue.RemoveLast();
-
- }
-
- if (PropertyValue.Mid(0, 1) == wxT("\"")){
-
- PropertyValue.Remove(0, 1);
-
- }
-
- ProcessCaptureStrings(&PropertyValue);
-
- // Process properties.
-
- if (PropertyName == wxT("ALTID")){
-
- if (intType == 0){ GeneralTelephoneListAltID.erase(intValueSeek); GeneralTelephoneListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeTelephoneListAltID.erase(intValueSeek); HomeTelephoneListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessTelephoneListAltID.erase(intValueSeek); BusinessTelephoneListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PID")){
-
- if (intType == 0){ GeneralTelephoneListPID.erase(intValueSeek); GeneralTelephoneListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeTelephoneListPID.erase(intValueSeek); HomeTelephoneListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessTelephoneListPID.erase(intValueSeek); BusinessTelephoneListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PREF")){
-
- intPref = wxAtoi(PropertyValue);
-
- if (intPref > 0 && intPref < 101){
-
- if (intType == 0){ GeneralTelephoneListPref.erase(intValueSeek); GeneralTelephoneListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 1){ HomeTelephoneListPref.erase(intValueSeek); HomeTelephoneListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 2){ BusinessTelephoneListPref.erase(intValueSeek); BusinessTelephoneListPref.insert(std::make_pair(intValueSeek, intPref)); }
-
- }
-
- } else {
-
- // Something else we don't know about so append
- // to the tokens variable.
-
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
-
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
-
- }
-
- }
-
- }
-
- // Split the address.
-
- //std::map<int, int>::iterator SLiter;
- intPropertyLen = wxSPropertySeg2.Len();
- SplitPoints.clear();
- SplitLength.clear();
- intSplitsFound = 0;
- intSplitSize = 0;
- intPrevValue = 0;
-
- for (int i = 0; i <= intPropertyLen; i++){
-
- intSplitSize++;
-
- if (wxSPropertySeg2.Mid(i, 1) == wxT(":") && wxSPropertySeg2.Mid((i - 1), 1) != wxT("\\")){
-
- intSplitsFound++;
- SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
-
- if (intSplitsFound == 1){
-
- SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
- break;
-
- }
-
- intSplitSize = 0;
-
- }
-
- }
-
- // Split the data into several parts.
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- if (intiter->first == 1){
-
- // Deal with PO Box.
-
- SLiter = SplitLength.find(1);
-
- //txtSurname->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(0, SLiter->second), TRUE));
- TelType = wxSPropertySeg2.Mid(0, SLiter->second);
- intPrevValue = intiter->second;
-
- TelNumber = wxSPropertySeg2.Mid(intPrevValue);
-
- }
-
- }
-
- // Add the data to the General/Home/Work address variables.
-
- ProcessCaptureStrings(&PropertyValue);
- wxListItem coldata;
-
- coldata.SetId(intValueSeek);
- coldata.SetData(intValueSeek);
- coldata.SetText(TelNumber);
-
- if (intType == 0){
-
- ListCtrlIndex = lboTelephone->InsertItem(coldata);
-
- lboTelephone->SetItem(ListCtrlIndex, 1, TelTypeUI);
-
- if (intPref > 0 && intPref < 101){
-
- lboTelephone->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
-
- }
-
- GeneralTelephoneList.erase(intValueSeek);
- GeneralTelephoneListType.erase(intValueSeek);
- GeneralTelephoneListTokens.erase(intValueSeek);
- GeneralTelephoneList.insert(std::make_pair(intValueSeek, TelNumber));
- GeneralTelephoneListType.insert(std::make_pair(intValueSeek, TelTypeDetail));
- GeneralTelephoneListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- } else if (intType == 1){
-
- ListCtrlIndex = lboHomeTelephone->InsertItem(coldata);
-
- lboHomeTelephone->SetItem(ListCtrlIndex, 1, TelTypeUI);
-
- if (intPref > 0 && intPref < 101){
-
- lboHomeTelephone->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
-
- }
-
- HomeTelephoneList.erase(intValueSeek);
- HomeTelephoneListType.erase(intValueSeek);
- HomeTelephoneListTokens.erase(intValueSeek);
- HomeTelephoneList.insert(std::make_pair(intValueSeek, TelNumber));
- HomeTelephoneListType.insert(std::make_pair(intValueSeek, TelTypeDetail));
- HomeTelephoneListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- } else if (intType == 2){
-
- ListCtrlIndex = lboBusinessTelephone->InsertItem(coldata);
-
- lboBusinessTelephone->SetItem(ListCtrlIndex, 1, TelTypeUI);
-
- if (intPref > 0 && intPref < 101){
-
- lboBusinessTelephone->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
-
- }
-
- BusinessTelephoneList.erase(intValueSeek);
- BusinessTelephoneListType.erase(intValueSeek);
- BusinessTelephoneListTokens.erase(intValueSeek);
- BusinessTelephoneList.insert(std::make_pair(intValueSeek, TelNumber));
- BusinessTelephoneListType.insert(std::make_pair(intValueSeek, TelTypeDetail));
- BusinessTelephoneListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- }
-
- TelCount++;
- intValueSeek++;
-
- } else if (wxSProperty == wxT("LANG")){
-
- int intPropertyLen = wxSPropertySeg1.Len();
- std::map<int, int> SplitPoints;
- std::map<int, int> SplitLength;
- std::map<int, int>::iterator SLiter;
- wxString PropertyData;
- wxString PropertyName;
- wxString PropertyValue;
- wxString PropertyTokens;
- bool AfterFirstToken = FALSE;
- bool FirstToken = TRUE;
- int intSplitsFound = 0;
- int intSplitSize = 0;
- int intPrevValue = 6;
- int intPref = 0;
- int intType = 0;
- int intSplitSeek = 0;
- long ListCtrlIndex;
-
- SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
-
- intPrevValue = 5;
-
- // Look for type before continuing.
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- if (PropertyName == wxT("TYPE")){
-
- if (PropertyValue == wxT("work")){
-
- intType = 2;
-
- } else if (PropertyValue == wxT("home")){
-
- intType = 1;
-
- } else {
-
- intType = 0;
-
- }
-
- }
-
- }
-
- // Setup blank lines for later on.
-
- if (intType == 0){
-
- GeneralLanguageList.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralLanguageListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralLanguageListPID.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralLanguageListPref.insert(std::make_pair(intValueSeek, 0));
- GeneralLanguageListTokens.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 1){
-
- HomeLanguageList.insert(std::make_pair(intValueSeek, wxT("")));
- HomeLanguageListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- HomeLanguageListPID.insert(std::make_pair(intValueSeek, wxT("")));
- HomeLanguageListPref.insert(std::make_pair(intValueSeek, 0));
- HomeLanguageListTokens.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 2){
-
- BusinessLanguageList.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessLanguageListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessLanguageListPID.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessLanguageListPref.insert(std::make_pair(intValueSeek, 0));
- BusinessLanguageListTokens.insert(std::make_pair(intValueSeek, wxT("")));
-
- }
-
- intPrevValue = 5;
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- // Process properties.
-
- int intPropertyValueLen = PropertyValue.Len();
-
- if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
-
- PropertyValue.Trim();
- PropertyValue.RemoveLast();
-
- }
-
- if (PropertyValue.Mid(0, 1) == wxT("\"")){
-
- PropertyValue.Remove(0, 1);
-
- }
-
- ProcessCaptureStrings(&PropertyValue);
-
- if (PropertyName == wxT("ALTID")){
-
- if (intType == 0){ GeneralLanguageListAltID.erase(intValueSeek); GeneralLanguageListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeLanguageListAltID.erase(intValueSeek); HomeLanguageListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessLanguageListAltID.erase(intValueSeek); BusinessLanguageListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PID")){
-
- if (intType == 0){ GeneralLanguageListPID.erase(intValueSeek); GeneralLanguageListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeLanguageListPID.erase(intValueSeek); HomeLanguageListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessLanguageListPID.erase(intValueSeek); BusinessLanguageListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PREF")){
-
- intPref = wxAtoi(PropertyValue);
-
- if (intType == 0){ GeneralLanguageListPref.erase(intValueSeek); GeneralLanguageListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 1){ HomeLanguageListPref.erase(intValueSeek); HomeLanguageListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 2){ BusinessLanguageListPref.erase(intValueSeek); BusinessLanguageListPref.insert(std::make_pair(intValueSeek, intPref)); }
-
- } else {
-
- // Something else we don't know about so append
- // to the tokens variable.
-
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
-
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
-
- }
-
- }
-
- }
-
- // Add the data to the General/Home/Work address variables.
-
- ProcessCaptureStrings(&wxSPropertySeg2);
-
- wxListItem coldata;
-
- coldata.SetId(intValueSeek);
- coldata.SetData(intValueSeek);
- coldata.SetText(wxSPropertySeg2);
-
- if (intType == 0){
-
- ListCtrlIndex = lboLanguages->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboLanguages->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- GeneralLanguageList.erase(intValueSeek);
- GeneralLanguageListType.erase(intValueSeek);
- GeneralLanguageListTokens.erase(intValueSeek);
- GeneralLanguageList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- GeneralLanguageListType.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralLanguageListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- } else if (intType == 1){
-
- ListCtrlIndex = lboHomeLanguages->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboHomeLanguages->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- HomeLanguageList.erase(intValueSeek);
- HomeLanguageListType.erase(intValueSeek);
- HomeLanguageListTokens.erase(intValueSeek);
- HomeLanguageList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- HomeLanguageListType.insert(std::make_pair(intValueSeek, wxT("home")));
- HomeLanguageListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- } else if (intType == 2){
-
- ListCtrlIndex = lboBusinessLanguages->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboBusinessLanguages->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- BusinessLanguageList.erase(intValueSeek);
- BusinessLanguageListType.erase(intValueSeek);
- BusinessLanguageListTokens.erase(intValueSeek);
- BusinessLanguageList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- BusinessLanguageListType.insert(std::make_pair(intValueSeek, wxT("work")));
- BusinessLanguageListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- }
-
- LangCount++;
- intValueSeek++;
-
- } else if (wxSProperty == wxT("GEO")){
-
- int intPropertyLen = wxSPropertySeg1.Len();
- std::map<int, int> SplitPoints;
- std::map<int, int> SplitLength;
- std::map<int, int>::iterator SLiter;
- wxString PropertyData;
- wxString PropertyName;
- wxString PropertyValue;
- wxString PropertyTokens;
- wxString GeoType;
- wxString GeoData;
- bool AfterFirstToken = FALSE;
- bool FirstToken = TRUE;
- int intSplitsFound = 0;
- int intSplitSize = 0;
- int intPrevValue = 5;
- int intPref = 0;
- int intType = 0;
- int intSplitSeek = 0;
- long ListCtrlIndex;
-
- SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
-
- intPrevValue = 4;
-
- // Look for type before continuing.
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- if (PropertyName == wxT("TYPE")){
-
- if (PropertyValue == wxT("work")){
-
- intType = 2;
-
- } else if (PropertyValue == wxT("home")){
-
- intType = 1;
-
- } else {
-
- intType = 0;
-
- }
-
- }
-
- }
-
- // Setup blank lines for later on.
-
- if (intType == 0){
-
- GeneralGeographyList.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralGeographyListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralGeographyListPID.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralGeographyListPref.insert(std::make_pair(intValueSeek, 0));
- GeneralGeographyListTokens.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 1){
-
- HomeGeographyList.insert(std::make_pair(intValueSeek, wxT("")));
- HomeGeographyListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- HomeGeographyListPID.insert(std::make_pair(intValueSeek, wxT("")));
- HomeGeographyListPref.insert(std::make_pair(intValueSeek, 0));
- HomeGeographyListTokens.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 2){
-
- BusinessGeographyList.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessGeographyListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessGeographyListPID.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessGeographyListPref.insert(std::make_pair(intValueSeek, 0));
- BusinessGeographyListTokens.insert(std::make_pair(intValueSeek, wxT("")));
-
- }
-
- intPrevValue = 4;
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- // Process properties.
-
- int intPropertyValueLen = PropertyValue.Len();
-
- if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
-
- PropertyValue.Trim();
- PropertyValue.RemoveLast();
-
- }
-
- if (PropertyValue.Mid(0, 1) == wxT("\"")){
-
- PropertyValue.Remove(0, 1);
-
- }
-
- ProcessCaptureStrings(&PropertyValue);
-
- if (PropertyName == wxT("ALTID")){
-
- if (intType == 0){ GeneralGeographyListAltID.erase(intValueSeek); GeneralGeographyListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeGeographyListAltID.erase(intValueSeek); HomeGeographyListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessGeographyListAltID.erase(intValueSeek); BusinessGeographyListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PID")){
-
- if (intType == 0){ GeneralGeographyListPID.erase(intValueSeek); GeneralGeographyListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeGeographyListPID.erase(intValueSeek); HomeGeographyListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessGeographyListPID.erase(intValueSeek); BusinessGeographyListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("MEDIATYPE")){
-
- if (intType == 0){ GeneralGeographyListMediatype.erase(intValueSeek); GeneralGeographyListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeGeographyListMediatype.erase(intValueSeek); HomeGeographyListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessGeographyListMediatype.erase(intValueSeek); BusinessGeographyListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PREF")){
-
- intPref = wxAtoi(PropertyValue);
-
- if (intPref > 0 && intPref < 101){
-
- if (intType == 0){ GeneralGeographyListPref.erase(intValueSeek); GeneralGeographyListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 1){ HomeGeographyListPref.erase(intValueSeek); HomeGeographyListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 2){ BusinessGeographyListPref.erase(intValueSeek); BusinessGeographyListPref.insert(std::make_pair(intValueSeek, intPref)); }
-
- }
-
- } else {
-
- // Something else we don't know about so append
- // to the tokens variable.
-
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
-
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
-
- }
-
- }
-
- }
-
- // Split the address.
-
- //std::map<int, int>::iterator SLiter;
- intPropertyLen = wxSPropertySeg2.Len();
- SplitPoints.clear();
- SplitLength.clear();
- intSplitsFound = 0;
- intSplitSize = 0;
- intPrevValue = 0;
-
- for (int i = 0; i <= intPropertyLen; i++){
-
- intSplitSize++;
-
- if (wxSPropertySeg2.Mid(i, 1) == wxT(":") && wxSPropertySeg2.Mid((i - 1), 1) != wxT("\\")){
-
- intSplitsFound++;
- SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
-
- if (intSplitsFound == 1){
-
- SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
- break;
-
- }
-
- intSplitSize = 0;
-
- }
-
- }
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- if (intiter->first == 1){
-
- // Deal with PO Box.
-
- SLiter = SplitLength.find(1);
-
- //txtSurname->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(0, SLiter->second), TRUE));
- GeoType = wxSPropertySeg2.Mid(0, SLiter->second);
- intPrevValue = intiter->second;
-
- GeoData = wxSPropertySeg2.Mid(intPrevValue);
-
- }
-
- }
-
- ProcessCaptureStrings(&wxSPropertySeg2);
-
- wxListItem coldata;
-
- coldata.SetId(intValueSeek);
- coldata.SetData(intValueSeek);
-
-
- if (intType == 0){
-
- /*
-
- ListCtrlIndex = lboTimezones->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboTimezones->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- */
- /*
- txtGeopositioning->SetValue(GeoData);
- */
-
- GeneralGeographyList.erase(intValueSeek);
- GeneralGeographyListType.erase(intValueSeek);
- GeneralGeographyListTokens.erase(intValueSeek);
- GeneralGeographyList.insert(std::make_pair(intValueSeek, GeoData));
- GeneralGeographyListType.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralGeographyListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- CaptureString(&GeoData, FALSE);
- coldata.SetText(GeoData);
- ListCtrlIndex = lboGeoposition->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboGeoposition->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- } else if (intType == 1){
-
- /*
-
- ListCtrlIndex = lboHomeTimezones->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboHomeTimezones->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- */
-
- /*
- txtHomeGeopositioning->SetValue(GeoData);
- */
-
- HomeGeographyList.erase(intValueSeek);
- HomeGeographyListType.erase(intValueSeek);
- HomeGeographyListTokens.erase(intValueSeek);
- HomeGeographyList.insert(std::make_pair(intValueSeek, GeoData));
- HomeGeographyListType.insert(std::make_pair(intValueSeek, wxT("home")));
- HomeGeographyListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- CaptureString(&GeoData, FALSE);
- coldata.SetText(GeoData);
- ListCtrlIndex = lboHomeGeoposition->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboHomeGeoposition->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- } else if (intType == 2){
-
- ListCtrlIndex = lboBusinessGeoposition->InsertItem(coldata);
-
- /*
-
- ListCtrlIndex = lboBusinessTimezones->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboBusinessTimezones->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- */
-
- /*
- txtBusinessGeopositioning->SetValue(GeoData);
- */
-
- BusinessGeographyList.erase(intValueSeek);
- BusinessGeographyListType.erase(intValueSeek);
- BusinessGeographyListTokens.erase(intValueSeek);
- BusinessGeographyList.insert(std::make_pair(intValueSeek, GeoData));
- BusinessGeographyListType.insert(std::make_pair(intValueSeek, wxT("work")));
- BusinessGeographyListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- CaptureString(&GeoData, FALSE);
- coldata.SetText(GeoData);
- ListCtrlIndex = lboBusinessGeoposition->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboBusinessGeoposition->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- }
-
- GeoCount++;
- intValueSeek++;
-
- } else if (wxSProperty == wxT("RELATED")){
-
- int intPropertyLen = wxSPropertySeg1.Len();
- std::map<int, int> SplitPoints;
- std::map<int, int> SplitLength;
- std::map<int, int>::iterator SLiter;
- wxString PropertyData;
- wxString PropertyName;
- wxString PropertyValue;
- wxString PropertyTokens;
- wxString RelatedType;
- wxString RelatedTypeOriginal;
- wxString RelatedName;
- bool AfterFirstToken = FALSE;
- bool FirstToken = TRUE;
- int intSplitsFound = 0;
- int intSplitSize = 0;
- int intPrevValue = 9;
- int intPref = 0;
- int intType = 0;
- int intSplitSeek = 0;
- long ListCtrlIndex;
-
- SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
-
- intPrevValue = 8;
-
- // Look for type before continuing.
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- // Process these.
-
- RelatedTypeOriginal = PropertyValue;
-
- if (PropertyName == wxT("TYPE")){
-
- if (PropertyValue == wxT("contact")){
-
- RelatedType = _("Contact");
-
- } else if (PropertyValue == wxT("acquaintance")){
-
- RelatedType = _("Acquaintance");
-
- } else if (PropertyValue == wxT("friend")){
-
- RelatedType = _("Friend");
-
- } else if (PropertyValue == wxT("met")){
-
- RelatedType = _("Met");
-
- } else if (PropertyValue == wxT("co-worker")){
-
- RelatedType = _("Co-worker");
-
- } else if (PropertyValue == wxT("colleague")){
-
- RelatedType = _("Colleague");
-
- } else if (PropertyValue == wxT("co-resident")){
-
- RelatedType = _("Co-resident");
-
- } else if (PropertyValue == wxT("neighbor")){
-
- RelatedType = _("Neighbour");
-
- } else if (PropertyValue == wxT("child")){
-
- RelatedType = _("Child");
-
- } else if (PropertyValue == wxT("parent")){
-
- RelatedType = _("Parent");
-
- } else if (PropertyValue == wxT("sibling")){
-
- RelatedType = _("Sibling");
-
- } else if (PropertyValue == wxT("spouse")){
-
- RelatedType = _("Spouse");
-
- } else if (PropertyValue == wxT("kin")){
-
- RelatedType = _("Kin");
-
- } else if (PropertyValue == wxT("muse")){
-
- RelatedType = _("Muse");
-
- } else if (PropertyValue == wxT("crush")){
-
- RelatedType = _("Crush");
-
- } else if (PropertyValue == wxT("date")){
-
- RelatedType = _("Date");
-
- } else if (PropertyValue == wxT("sweetheart")){
-
- RelatedType = _("Sweetheart");
-
- } else if (PropertyValue == wxT("me")){
-
- RelatedType = _("Me");
-
- } else if (PropertyValue == wxT("agent")){
-
- RelatedType = _("Agent");
-
- } else if (PropertyValue == wxT("emergency")){
-
- RelatedType = _("Emergency");
-
- } else {
-
- RelatedType = PropertyValue;
-
- }
-
- }
-
- }
-
- intPrevValue = 8;
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- // Process properties.
-
- int intPropertyValueLen = PropertyValue.Len();
-
- if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
-
- PropertyValue.Trim();
- PropertyValue.RemoveLast();
-
- }
-
- if (PropertyValue.Mid(0, 1) == wxT("\"")){
-
- PropertyValue.Remove(0, 1);
-
- }
-
- ProcessCaptureStrings(&PropertyValue);
-
- if (PropertyName == wxT("ALTID")){
-
- GeneralRelatedListAltID.erase(intValueSeek);
- GeneralRelatedListAltID.insert(std::make_pair(intValueSeek, PropertyValue));
-
- } else if (PropertyName == wxT("PID")){
-
- GeneralRelatedListPID.erase(intValueSeek);
- GeneralRelatedListPID.insert(std::make_pair(intValueSeek, PropertyValue));
-
- } else if (PropertyName == wxT("PREF")){
-
- intPref = wxAtoi(PropertyValue);
-
- if (intPref > 0 && intPref < 101){
-
- GeneralRelatedListPref.erase(intValueSeek);
- GeneralRelatedListPref.insert(std::make_pair(intValueSeek, intPref));
-
-
- }
-
- } else if (PropertyName == wxT("LANGUAGE")){
-
- GeneralRelatedListLanguage.erase(intValueSeek);
- GeneralRelatedListLanguage.insert(std::make_pair(intValueSeek, PropertyValue));
-
- } else {
-
- // Something else we don't know about so append
- // to the tokens variable.
-
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
-
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
-
- }
-
- }
-
- }
-
- // Split the address.
-
- //std::map<int, int>::iterator SLiter;
- intPropertyLen = wxSPropertySeg2.Len();
- SplitPoints.clear();
- SplitLength.clear();
- intSplitsFound = 0;
- intSplitSize = 0;
- intPrevValue = 0;
-
- // Add the data to the General/Home/Work address variables.
-
- wxListItem coldata;
-
- coldata.SetId(intValueSeek);
- coldata.SetData(intValueSeek);
- coldata.SetText(RelatedType);
-
- ProcessCaptureStrings(&wxSPropertySeg2);
-
- ListCtrlIndex = lboRelated->InsertItem(coldata);
-
- lboRelated->SetItem(ListCtrlIndex, 1, wxSPropertySeg2);
-
- if (intPref > 0 && intPref < 101){
-
- lboRelated->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
-
- }
-
- GeneralRelatedList.erase(intValueSeek);
- GeneralRelatedListRelType.erase(intValueSeek);
- GeneralRelatedListType.erase(intValueSeek);
- GeneralRelatedListTokens.erase(intValueSeek);
- GeneralRelatedList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- GeneralRelatedListRelType.insert(std::make_pair(intValueSeek, RelatedTypeOriginal));
- GeneralRelatedListType.insert(std::make_pair(intValueSeek, RelatedTypeOriginal));
- GeneralRelatedListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- RelatedCount++;
- intValueSeek++;
-
- } else if (wxSProperty == wxT("URL")){
-
- int intPropertyLen = wxSPropertySeg1.Len();
- std::map<int, int> SplitPoints;
- std::map<int, int> SplitLength;
- std::map<int, int>::iterator SLiter;
- wxString PropertyData;
- wxString PropertyName;
- wxString PropertyValue;
- wxString PropertyTokens;
- bool AfterFirstToken = FALSE;
- bool FirstToken = TRUE;
- int intSplitsFound = 0;
- int intSplitSize = 0;
- int intPrevValue = 5;
- int intPref = 0;
- int intType = 0;
- int intSplitSeek = 0;
- long ListCtrlIndex;
-
- SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
-
- intPrevValue = 4;
-
- // Look for type before continuing.
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- if (PropertyName == wxT("TYPE")){
-
- if (PropertyValue == wxT("work")){
-
- intType = 2;
-
- } else if (PropertyValue == wxT("home")){
-
- intType = 1;
-
- } else {
-
- intType = 0;
-
- }
-
- }
-
- }
-
- // Setup blank lines for later on.
-
- if (intType == 0){
-
- GeneralWebsiteList.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralWebsiteListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralWebsiteListPID.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralWebsiteListPref.insert(std::make_pair(intValueSeek, 0));
- GeneralWebsiteListTokens.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 1){
-
- HomeWebsiteList.insert(std::make_pair(intValueSeek, wxT("")));
- HomeWebsiteListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- HomeWebsiteListPID.insert(std::make_pair(intValueSeek, wxT("")));
- HomeWebsiteListPref.insert(std::make_pair(intValueSeek, 0));
- HomeWebsiteListTokens.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 2){
-
- BusinessWebsiteList.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessWebsiteListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessWebsiteListPID.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessWebsiteListPref.insert(std::make_pair(intValueSeek, 0));
- BusinessWebsiteListTokens.insert(std::make_pair(intValueSeek, wxT("")));
-
- }
-
- intPrevValue = 4;
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- // Process properties.
-
- int intPropertyValueLen = PropertyValue.Len();
-
- if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
-
- PropertyValue.Trim();
- PropertyValue.RemoveLast();
-
- }
-
- if (PropertyValue.Mid(0, 1) == wxT("\"")){
-
- PropertyValue.Remove(0, 1);
-
- }
-
- ProcessCaptureStrings(&PropertyValue);
-
- if (PropertyName == wxT("ALTID")){
-
- if (intType == 0){ GeneralWebsiteListAltID.erase(intValueSeek); GeneralWebsiteListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeWebsiteListAltID.erase(intValueSeek); HomeWebsiteListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessWebsiteListAltID.erase(intValueSeek); BusinessWebsiteListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PID")){
-
- if (intType == 0){ GeneralWebsiteListPID.erase(intValueSeek); GeneralWebsiteListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeWebsiteListPID.erase(intValueSeek); HomeWebsiteListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessWebsiteListPID.erase(intValueSeek); BusinessWebsiteListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PREF")){
-
- intPref = wxAtoi(PropertyValue);
-
- if (intType == 0){ GeneralWebsiteListPref.erase(intValueSeek); GeneralWebsiteListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 1){ HomeWebsiteListPref.erase(intValueSeek); HomeWebsiteListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 2){ BusinessWebsiteListPref.erase(intValueSeek); BusinessWebsiteListPref.insert(std::make_pair(intValueSeek, intPref)); }
-
- } else if (PropertyName == wxT("MEDIATYPE")){
-
- if (intType == 0){ GeneralWebsiteListMediatype.erase(intValueSeek); GeneralWebsiteListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeWebsiteListMediatype.erase(intValueSeek); HomeWebsiteListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessWebsiteListMediatype.erase(intValueSeek); BusinessWebsiteListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else {
-
- // Something else we don't know about so append
- // to the tokens variable.
-
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
-
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
-
- }
-
- }
-
- }
-
- // Add the data to the General/Home/Work address variables.
-
- ProcessCaptureStrings(&wxSPropertySeg2);
-
- wxListItem coldata;
-
- coldata.SetId(intValueSeek);
- coldata.SetData(intValueSeek);
- coldata.SetText(wxSPropertySeg2);
-
- if (intType == 0){
-
- ListCtrlIndex = lboWebsites->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboWebsites->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- GeneralWebsiteList.erase(intValueSeek);
- GeneralWebsiteListType.erase(intValueSeek);
- GeneralWebsiteListTokens.erase(intValueSeek);
- GeneralWebsiteList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- GeneralWebsiteListType.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralWebsiteListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- } else if (intType == 1){
-
- ListCtrlIndex = lboHomeWebsites->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboHomeWebsites->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- HomeWebsiteList.erase(intValueSeek);
- HomeWebsiteListType.erase(intValueSeek);
- HomeWebsiteListTokens.erase(intValueSeek);
- HomeWebsiteList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- HomeWebsiteListType.insert(std::make_pair(intValueSeek, wxT("home")));
- HomeWebsiteListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- } else if (intType == 2){
-
- ListCtrlIndex = lboBusinessWebsites->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboBusinessWebsites->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- BusinessWebsiteList.erase(intValueSeek);
- BusinessWebsiteListType.erase(intValueSeek);
- BusinessWebsiteListTokens.erase(intValueSeek);
- BusinessWebsiteList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- BusinessWebsiteListType.insert(std::make_pair(intValueSeek, wxT("work")));
- BusinessWebsiteListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- }
-
- URLCount++;
- intValueSeek++;
-
- } else if (wxSProperty == wxT("TITLE")) {
-
- int intPropertyLen = wxSPropertySeg1.Len();
- std::map<int, int> SplitPoints;
- std::map<int, int> SplitLength;
- std::map<int, int>::iterator SLiter;
- wxString PropertyData;
- wxString PropertyName;
- wxString PropertyValue;
- wxString PropertyTokens;
- bool AfterFirstToken = FALSE;
- bool FirstToken = TRUE;
- int intSplitsFound = 0;
- int intSplitSize = 0;
- int intPrevValue = 7;
- int intPref = 0;
- int intType = 0;
- int intSplitSeek = 0;
- long ListCtrlIndex;
-
- SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
-
- intPrevValue = 6;
-
- // Look for type before continuing.
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- if (PropertyName == wxT("TYPE")){
-
- if (PropertyValue == wxT("work")){
-
- intType = 2;
-
- } else if (PropertyValue == wxT("home")){
-
- intType = 1;
-
- } else {
-
- intType = 0;
-
- }
-
- }
-
- }
-
- // Setup blank lines for later on.
-
- if (intType == 0){
-
- GeneralTitleList.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralTitleListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralTitleListPID.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralTitleListPref.insert(std::make_pair(intValueSeek, 0));
- GeneralTitleListTokens.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralTitleListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 1){
-
- HomeTitleList.insert(std::make_pair(intValueSeek, wxT("")));
- HomeTitleListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- HomeTitleListPID.insert(std::make_pair(intValueSeek, wxT("")));
- HomeTitleListPref.insert(std::make_pair(intValueSeek, 0));
- HomeTitleListTokens.insert(std::make_pair(intValueSeek, wxT("")));
- HomeTitleListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 2){
-
- BusinessTitleList.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessTitleListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessTitleListPID.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessTitleListPref.insert(std::make_pair(intValueSeek, 0));
- BusinessTitleListTokens.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessTitleListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
-
- }
-
- intPrevValue = 6;
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- // Process properties.
-
- int intPropertyValueLen = PropertyValue.Len();
-
- if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
-
- PropertyValue.Trim();
- PropertyValue.RemoveLast();
-
- }
-
- if (PropertyValue.Mid(0, 1) == wxT("\"")){
-
- PropertyValue.Remove(0, 1);
-
- }
-
- ProcessCaptureStrings(&PropertyValue);
-
- if (PropertyName == wxT("ALTID")){
-
- if (intType == 0){ GeneralTitleListAltID.erase(intValueSeek); GeneralTitleListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeTitleListAltID.erase(intValueSeek); HomeTitleListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessTitleListAltID.erase(intValueSeek); BusinessTitleListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PID")){
-
- if (intType == 0){ GeneralTitleListPID.erase(intValueSeek); GeneralTitleListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeTitleListPID.erase(intValueSeek); HomeTitleListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessTitleListPID.erase(intValueSeek); BusinessTitleListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PREF")){
-
- intPref = wxAtoi(PropertyValue);
-
- if (intType == 0){ GeneralTitleListPref.erase(intValueSeek); GeneralTitleListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 1){ HomeTitleListPref.erase(intValueSeek); HomeTitleListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 2){ BusinessTitleListPref.erase(intValueSeek); BusinessTitleListPref.insert(std::make_pair(intValueSeek, intPref)); }
-
- } else if (PropertyName == wxT("LANGUAGE")){
-
- if (intType == 0){ GeneralTitleListLanguage.erase(intValueSeek); GeneralTitleListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeTitleListLanguage.erase(intValueSeek); HomeTitleListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessTitleListLanguage.erase(intValueSeek); BusinessTitleListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else {
-
- // Something else we don't know about so append
- // to the tokens variable.
-
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
-
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
-
- }
-
- }
-
- }
-
- // Add the data to the General/Home/Work address variables.
-
- ProcessCaptureStrings(&wxSPropertySeg2);
-
- wxListItem coldata;
-
- coldata.SetId(intValueSeek);
- coldata.SetData(intValueSeek);
- coldata.SetText(wxSPropertySeg2);
-
- if (intType == 0){
-
- ListCtrlIndex = lboTitles->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboTitles->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- GeneralTitleList.erase(intValueSeek);
- GeneralTitleListType.erase(intValueSeek);
- GeneralTitleListTokens.erase(intValueSeek);
- GeneralTitleList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- GeneralTitleListType.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralTitleListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- } else if (intType == 1){
-
- ListCtrlIndex = lboHomeTitles->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboHomeTitles->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- HomeTitleList.erase(intValueSeek);
- HomeTitleListType.erase(intValueSeek);
- HomeTitleListTokens.erase(intValueSeek);
- HomeTitleList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- HomeTitleListType.insert(std::make_pair(intValueSeek, wxT("home")));
- HomeTitleListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- } else if (intType == 2){
-
- ListCtrlIndex = lboBusinessTitles->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboBusinessTitles->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- BusinessTitleList.erase(intValueSeek);
- BusinessTitleListType.erase(intValueSeek);
- BusinessTitleListTokens.erase(intValueSeek);
- BusinessTitleList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- BusinessTitleListType.insert(std::make_pair(intValueSeek, wxT("work")));
- BusinessTitleListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- }
-
- TitleCount++;
- intValueSeek++;
-
- } else if (wxSProperty == wxT("ROLE")) {
-
- int intPropertyLen = wxSPropertySeg1.Len();
- std::map<int, int> SplitPoints;
- std::map<int, int> SplitLength;
- std::map<int, int>::iterator SLiter;
- wxString PropertyData;
- wxString PropertyName;
- wxString PropertyValue;
- wxString PropertyTokens;
- bool AfterFirstToken = FALSE;
- bool FirstToken = TRUE;
- int intSplitsFound = 0;
- int intSplitSize = 0;
- int intPrevValue = 6;
- int intPref = 0;
- int intType = 0;
- int intSplitSeek = 0;
- long ListCtrlIndex;
-
- SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
-
- intPrevValue = 5;
-
- // Look for type before continuing.
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- if (PropertyName == wxT("TYPE")){
-
- if (PropertyValue == wxT("work")){
-
- intType = 2;
-
- } else if (PropertyValue == wxT("home")){
-
- intType = 1;
-
- } else {
-
- intType = 0;
-
- }
-
- }
-
- }
-
- // Setup blank lines for later on.
-
- if (intType == 0){
-
- GeneralRoleList.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralRoleListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralRoleListPID.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralRoleListPref.insert(std::make_pair(intValueSeek, 0));
- GeneralRoleListTokens.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralRoleListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 1){
-
- HomeRoleList.insert(std::make_pair(intValueSeek, wxT("")));
- HomeRoleListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- HomeRoleListPID.insert(std::make_pair(intValueSeek, wxT("")));
- HomeRoleListPref.insert(std::make_pair(intValueSeek, 0));
- HomeRoleListTokens.insert(std::make_pair(intValueSeek, wxT("")));
- HomeRoleListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 2){
-
- BusinessRoleList.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessRoleListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessRoleListPID.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessRoleListPref.insert(std::make_pair(intValueSeek, 0));
- BusinessRoleListTokens.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessRoleListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
-
- }
-
- intPrevValue = 5;
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- // Process properties.
-
- int intPropertyValueLen = PropertyValue.Len();
-
- if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
-
- PropertyValue.Trim();
- PropertyValue.RemoveLast();
-
- }
-
- if (PropertyValue.Mid(0, 1) == wxT("\"")){
-
- PropertyValue.Remove(0, 1);
-
- }
-
- ProcessCaptureStrings(&PropertyValue);
-
- if (PropertyName == wxT("ALTID")){
-
- if (intType == 0){ GeneralRoleListAltID.erase(intValueSeek); GeneralRoleListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeRoleListAltID.erase(intValueSeek); HomeRoleListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessRoleListAltID.erase(intValueSeek); BusinessRoleListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PID")){
-
- if (intType == 0){ GeneralRoleListPID.erase(intValueSeek); GeneralRoleListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeRoleListPID.erase(intValueSeek); HomeRoleListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessRoleListPID.erase(intValueSeek); BusinessRoleListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PREF")){
-
- intPref = wxAtoi(PropertyValue);
-
- if (intType == 0){ GeneralRoleListPref.erase(intValueSeek); GeneralRoleListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 1){ HomeRoleListPref.erase(intValueSeek); HomeRoleListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 2){ BusinessRoleListPref.erase(intValueSeek); BusinessRoleListPref.insert(std::make_pair(intValueSeek, intPref)); }
-
- } else if (PropertyName == wxT("LANGUAGE")){
-
- if (intType == 0){ GeneralRoleListLanguage.erase(intValueSeek); GeneralRoleListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeRoleListLanguage.erase(intValueSeek); HomeRoleListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessRoleListLanguage.erase(intValueSeek); BusinessRoleListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else {
-
- // Something else we don't know about so append
- // to the tokens variable.
-
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
-
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
-
- }
-
- }
-
- }
-
- // Add the data to the General/Home/Work address variables.
-
- ProcessCaptureStrings(&wxSPropertySeg2);
-
- wxListItem coldata;
-
- coldata.SetId(intValueSeek);
- coldata.SetData(intValueSeek);
- coldata.SetText(wxSPropertySeg2);
-
- if (intType == 0){
-
- ListCtrlIndex = lboRoles->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboRoles->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- GeneralRoleList.erase(intValueSeek);
- GeneralRoleListType.erase(intValueSeek);
- GeneralRoleListTokens.erase(intValueSeek);
- GeneralRoleList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- GeneralRoleListType.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralRoleListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- } else if (intType == 1){
-
- ListCtrlIndex = lboHomeRoles->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboHomeRoles->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- HomeRoleList.erase(intValueSeek);
- HomeRoleListType.erase(intValueSeek);
- HomeRoleListTokens.erase(intValueSeek);
- HomeRoleList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- HomeRoleListType.insert(std::make_pair(intValueSeek, wxT("home")));
- HomeRoleListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- } else if (intType == 2){
-
- ListCtrlIndex = lboBusinessRoles->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboBusinessRoles->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- BusinessRoleList.erase(intValueSeek);
- BusinessRoleListType.erase(intValueSeek);
- BusinessRoleListTokens.erase(intValueSeek);
- BusinessRoleList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- BusinessRoleListType.insert(std::make_pair(intValueSeek, wxT("work")));
- BusinessRoleListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- }
-
- RoleCount++;
- intValueSeek++;
-
- } else if (wxSProperty == wxT("ORG")) {
-
- int intPropertyLen = wxSPropertySeg1.Len();
- std::map<int, int> SplitPoints;
- std::map<int, int> SplitLength;
- std::map<int, int>::iterator SLiter;
- wxString PropertyData;
- wxString PropertyName;
- wxString PropertyValue;
- wxString PropertyTokens;
- bool AfterFirstToken = FALSE;
- bool FirstToken = TRUE;
- int intSplitsFound = 0;
- int intSplitSize = 0;
- int intPrevValue = 5;
- int intPref = 0;
- int intType = 0;
- int intSplitSeek = 0;
- long ListCtrlIndex;
-
- SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
-
- intPrevValue = 4;
-
- // Look for type before continuing.
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- if (PropertyName == wxT("TYPE")){
-
- if (PropertyValue == wxT("work")){
-
- intType = 2;
-
- } else if (PropertyValue == wxT("home")){
-
- intType = 1;
-
- } else {
-
- intType = 0;
-
- }
-
- }
-
- }
-
- // Setup blank lines for later on.
-
- if (intType == 0){
-
- GeneralOrganisationsList.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralOrganisationsListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralOrganisationsListPID.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralOrganisationsListPref.insert(std::make_pair(intValueSeek, 0));
- GeneralOrganisationsListTokens.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralOrganisationsListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralOrganisationsListSortAs.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 1){
-
- HomeOrganisationsList.insert(std::make_pair(intValueSeek, wxT("")));
- HomeOrganisationsListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- HomeOrganisationsListPID.insert(std::make_pair(intValueSeek, wxT("")));
- HomeOrganisationsListPref.insert(std::make_pair(intValueSeek, 0));
- HomeOrganisationsListTokens.insert(std::make_pair(intValueSeek, wxT("")));
- HomeOrganisationsListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
- HomeOrganisationsListSortAs.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 2){
-
- BusinessOrganisationsList.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessOrganisationsListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessOrganisationsListPID.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessOrganisationsListPref.insert(std::make_pair(intValueSeek, 0));
- BusinessOrganisationsListTokens.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessOrganisationsListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessOrganisationsListSortAs.insert(std::make_pair(intValueSeek, wxT("")));
-
- }
-
- intPrevValue = 4;
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- // Process properties.
-
- int intPropertyValueLen = PropertyValue.Len();
-
- if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
-
- PropertyValue.Trim();
- PropertyValue.RemoveLast();
-
- }
-
- if (PropertyValue.Mid(0, 1) == wxT("\"")){
-
- PropertyValue.Remove(0, 1);
-
- }
-
- ProcessCaptureStrings(&PropertyValue);
-
- if (PropertyName == wxT("ALTID")){
-
- if (intType == 0){ GeneralOrganisationsListAltID.erase(intValueSeek); GeneralOrganisationsListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeOrganisationsListAltID.erase(intValueSeek); HomeOrganisationsListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessOrganisationsListAltID.erase(intValueSeek); BusinessOrganisationsListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PID")){
-
- if (intType == 0){ GeneralOrganisationsListPID.erase(intValueSeek); GeneralOrganisationsListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeOrganisationsListPID.erase(intValueSeek); HomeOrganisationsListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessOrganisationsListPID.erase(intValueSeek); BusinessOrganisationsListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PREF")){
-
- intPref = wxAtoi(PropertyValue);
-
- if (intType == 0){ GeneralOrganisationsListPref.erase(intValueSeek); GeneralOrganisationsListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 1){ HomeOrganisationsListPref.erase(intValueSeek); HomeOrganisationsListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 2){ BusinessOrganisationsListPref.erase(intValueSeek); BusinessOrganisationsListPref.insert(std::make_pair(intValueSeek, intPref)); }
-
- } else if (PropertyName == wxT("LANGUAGE")){
-
- if (intType == 0){ GeneralOrganisationsListLanguage.erase(intValueSeek); GeneralOrganisationsListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeOrganisationsListLanguage.erase(intValueSeek); HomeOrganisationsListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessOrganisationsListLanguage.erase(intValueSeek); BusinessOrganisationsListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("SORT-AS")){
-
- if (intType == 0){ GeneralOrganisationsListSortAs.erase(intValueSeek); GeneralOrganisationsListSortAs.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeOrganisationsListSortAs.erase(intValueSeek); HomeOrganisationsListSortAs.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessOrganisationsListSortAs.erase(intValueSeek); BusinessOrganisationsListSortAs.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else {
-
- // Something else we don't know about so append
- // to the tokens variable.
-
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
-
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
-
- }
-
- }
-
- }
-
- // Add the data to the General/Home/Work address variables.
-
- wxListItem coldata;
-
- ProcessCaptureStrings(&wxSPropertySeg2);
-
- coldata.SetId(intValueSeek);
- coldata.SetData(intValueSeek);
- coldata.SetText(wxSPropertySeg2);
-
- if (intType == 0){
-
- ListCtrlIndex = lboOrganisations->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboOrganisations->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- GeneralOrganisationsList.erase(intValueSeek);
- GeneralOrganisationsListType.erase(intValueSeek);
- GeneralOrganisationsListTokens.erase(intValueSeek);
- GeneralOrganisationsList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- GeneralOrganisationsListType.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralOrganisationsListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- } else if (intType == 1){
-
- ListCtrlIndex = lboHomeOrganisations->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboHomeOrganisations->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- HomeOrganisationsList.erase(intValueSeek);
- HomeOrganisationsListType.erase(intValueSeek);
- HomeOrganisationsListTokens.erase(intValueSeek);
- HomeOrganisationsList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- HomeOrganisationsListType.insert(std::make_pair(intValueSeek, wxT("home")));
- HomeOrganisationsListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- } else if (intType == 2){
-
- ListCtrlIndex = lboBusinessOrganisations->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboBusinessOrganisations->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- BusinessOrganisationsList.erase(intValueSeek);
- BusinessOrganisationsListType.erase(intValueSeek);
- BusinessOrganisationsListTokens.erase(intValueSeek);
- BusinessOrganisationsList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- BusinessOrganisationsListType.insert(std::make_pair(intValueSeek, wxT("work")));
- BusinessOrganisationsListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- }
-
- OrgCount++;
- intValueSeek++;
-
- } else if (wxSProperty == wxT("NOTE")) {
-
- int intPropertyLen = wxSPropertySeg1.Len();
- std::map<int, int> SplitPoints;
- std::map<int, int> SplitLength;
- std::map<int, int>::iterator SLiter;
- wxString PropertyData;
- wxString PropertyName;
- wxString PropertyValue;
- wxString PropertyTokens;
- bool AfterFirstToken = FALSE;
- bool FirstToken = TRUE;
- int intSplitsFound = 0;
- int intSplitSize = 0;
- int intPrevValue = 6;
- int intPref = 0;
- int intType = 0;
- int intSplitSeek = 0;
- long ListCtrlIndex;
-
- SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
-
- intPrevValue = 5;
-
- // Look for type before continuing.
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- if (PropertyName == wxT("TYPE")){
-
- if (PropertyValue == wxT("work")){
-
- intType = 2;
-
- } else if (PropertyValue == wxT("home")){
-
- intType = 1;
-
- } else {
-
- intType = 0;
-
- }
-
- }
-
- }
-
- // Setup blank lines for later on.
-
- if (intType == 0){
-
- GeneralNoteList.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralNoteListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralNoteListPID.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralNoteListPref.insert(std::make_pair(intValueSeek, 0));
- GeneralNoteListTokens.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralNoteListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 1){
-
- HomeNoteList.insert(std::make_pair(intValueSeek, wxT("")));
- HomeNoteListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- HomeNoteListPID.insert(std::make_pair(intValueSeek, wxT("")));
- HomeNoteListPref.insert(std::make_pair(intValueSeek, 0));
- HomeNoteListTokens.insert(std::make_pair(intValueSeek, wxT("")));
- HomeNoteListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 2){
-
- BusinessNoteList.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessNoteListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessNoteListPID.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessNoteListPref.insert(std::make_pair(intValueSeek, 0));
- BusinessNoteListTokens.insert(std::make_pair(intValueSeek, wxT("")));
- BusinessNoteListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
-
- }
-
- intPrevValue = 5;
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, SLiter->second);
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- // Process properties.
-
- int intPropertyValueLen = PropertyValue.Len();
-
- if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
-
- PropertyValue.Trim();
- PropertyValue.RemoveLast();
-
- }
-
- if (PropertyValue.Mid(0, 1) == wxT("\"")){
-
- PropertyValue.Remove(0, 1);
-
- }
-
- ProcessCaptureStrings(&PropertyValue);
-
- if (PropertyName == wxT("ALTID")){
-
- if (intType == 0){ GeneralNoteListAltID.erase(intValueSeek); GeneralNoteListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeNoteListAltID.erase(intValueSeek); HomeNoteListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessNoteListAltID.erase(intValueSeek); BusinessNoteListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PID")){
-
- if (intType == 0){ GeneralNoteListPID.erase(intValueSeek); GeneralNoteListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeNoteListPID.erase(intValueSeek); HomeNoteListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessNoteListPID.erase(intValueSeek); BusinessNoteListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PREF")){
-
- intPref = wxAtoi(PropertyValue);
-
- if (intType == 0){ GeneralNoteListPref.erase(intValueSeek); GeneralNoteListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 1){ HomeNoteListPref.erase(intValueSeek); HomeNoteListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 2){ BusinessNoteListPref.erase(intValueSeek); BusinessNoteListPref.insert(std::make_pair(intValueSeek, intPref)); }
-
- } else if (PropertyName == wxT("LANGUAGE")){
-
- if (intType == 0){ GeneralNoteListLanguage.erase(intValueSeek); GeneralNoteListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ HomeNoteListLanguage.erase(intValueSeek); HomeNoteListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ BusinessNoteListLanguage.erase(intValueSeek); BusinessNoteListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else {
-
- // Something else we don't know about so append
- // to the tokens variable.
-
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
-
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
-
- }
-
- }
-
- }
-
- // Add the data to the General/Home/Work address variables.
-
- ProcessCaptureStrings(&wxSPropertySeg2);
-
- wxListItem coldata;
-
- coldata.SetId(intValueSeek);
- coldata.SetData(intValueSeek);
-
- if (intType == 0){
-
- GeneralNoteList.erase(intValueSeek);
- GeneralNoteListType.erase(intValueSeek);
- GeneralNoteListTokens.erase(intValueSeek);
- GeneralNoteList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- GeneralNoteListType.insert(std::make_pair(intValueSeek, wxT("")));
- GeneralNoteListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- //CaptureString(&wxSPropertySeg2, FALSE);
-
- coldata.SetText(wxSPropertySeg2);
-
- ListCtrlIndex = lboNotes->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboNotes->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- } else if (intType == 1){
-
- HomeNoteList.erase(intValueSeek);
- HomeNoteListType.erase(intValueSeek);
- HomeNoteListTokens.erase(intValueSeek);
- HomeNoteList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- HomeNoteListType.insert(std::make_pair(intValueSeek, wxT("home")));
- HomeNoteListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- CaptureString(&wxSPropertySeg2, FALSE);
-
- coldata.SetText(wxSPropertySeg2);
-
- ListCtrlIndex = lboHomeNotes->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboHomeNotes->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- } else if (intType == 2){
-
- BusinessNoteList.erase(intValueSeek);
- BusinessNoteListType.erase(intValueSeek);
- BusinessNoteListTokens.erase(intValueSeek);
- BusinessNoteList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
- BusinessNoteListType.insert(std::make_pair(intValueSeek, wxT("work")));
- BusinessNoteListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- CaptureString(&wxSPropertySeg2, FALSE);
-
- coldata.SetText(wxSPropertySeg2);
-
- ListCtrlIndex = lboBusinessNotes->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboBusinessNotes->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- }
-
- NoteCount++;
- intValueSeek++;
-
- } else if (wxSProperty == wxT("CATEGORIES")) {
-
- int intPropertyLen = wxSPropertySeg1.Len();
- std::map<int, int> SplitPoints;
- std::map<int, int> SplitLength;
- std::map<int, int>::iterator SLiter;
- wxString PropertyData;
- wxString PropertyName;
- wxString PropertyValue;
- wxString PropertyTokens;
- wxString PropertyType;
- bool AfterFirstToken = FALSE;
- bool FirstToken = TRUE;
- int intSplitsFound = 0;
- int intSplitSize = 0;
- int intPrevValue = 12;
- int intPref = 0;
- int intType = 0;
- int intSplitSeek = 0;
- long ListCtrlIndex;
-
- SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
-
- intPrevValue = 11;
-
- // Look for type before continuing.
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- if (PropertyName == wxT("TYPE")){
-
- if (PropertyValue == wxT("work")){
-
- intType = 2;
- PropertyType = wxT("work");
-
- } else if (PropertyValue == wxT("home")){
-
- intType = 1;
- PropertyType = wxT("home");
-
- } else {
-
- intType = 0;
-
- }
-
- }
-
- }
-
- // Setup blank lines for later on.
-
- CategoriesList.insert(std::make_pair(intValueSeek, wxT("")));
- CategoriesListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- CategoriesListPID.insert(std::make_pair(intValueSeek, wxT("")));
- CategoriesListPref.insert(std::make_pair(intValueSeek, 0));
- CategoriesListTokens.insert(std::make_pair(intValueSeek, wxT("")));
-
- intPrevValue = 11;
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- // Process properties.
-
- int intPropertyValueLen = PropertyValue.Len();
-
- if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
-
- PropertyValue.Trim();
- PropertyValue.RemoveLast();
-
- }
-
- if (PropertyValue.Mid(0, 1) == wxT("\"")){
-
- PropertyValue.Remove(0, 1);
-
- }
-
- ProcessCaptureStrings(&PropertyValue);
-
- if (PropertyName == wxT("ALTID")){
-
- if (intType == 0){ CategoriesListAltID.erase(intValueSeek); CategoriesListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ CategoriesListAltID.erase(intValueSeek); CategoriesListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ CategoriesListAltID.erase(intValueSeek); CategoriesListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PID")){
-
- if (intType == 0){ CategoriesListPID.erase(intValueSeek); CategoriesListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ CategoriesListPID.erase(intValueSeek); CategoriesListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ CategoriesListPID.erase(intValueSeek); CategoriesListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PREF")){
-
- intPref = wxAtoi(PropertyValue);
-
- if (intType == 0){ CategoriesListPref.erase(intValueSeek); CategoriesListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 1){ CategoriesListPref.erase(intValueSeek); CategoriesListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 2){ CategoriesListPref.erase(intValueSeek); CategoriesListPref.insert(std::make_pair(intValueSeek, intPref)); }
-
- } else {
-
- // Something else we don't know about so append
- // to the tokens variable.
-
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
-
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
-
- }
-
- }
-
- }
-
- // Deal with multiple categories.
-
- SplitPoints.clear();
- SplitLength.clear();
- intSplitSize = 0;
- intSplitsFound = 0;
- intSplitSeek = 0;
- intPrevValue = 0;
- intPropertyLen = wxSPropertySeg2.Len();
-
- for (int i = 0; i <= intPropertyLen; i++){
-
- if (intSplitSize == 0 && wxSPropertySeg2.Mid(i, 1) == wxT(" ")){
-
- continue;
-
- }
-
- intSplitSize++;
-
- if (wxSPropertySeg2.Mid(i, 1) == wxT(",") && wxSPropertySeg2.Mid((i - 1), 1) != wxT("\\")){
-
- if (AfterFirstToken == TRUE){
-
- SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
- SplitLength.insert(std::make_pair(intSplitsFound, intSplitSize));
-
- } else {
-
- SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
- SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
- AfterFirstToken = TRUE;
-
- }
-
- intSplitsFound++;
- intSplitSeek = i;
- intSplitSize = 0;
-
- }
-
- }
-
- SplitPoints.insert(std::make_pair(intSplitsFound, (intSplitSeek + 1)));
- SplitLength.insert(std::make_pair(intSplitsFound, intSplitSize));
-
- intPrevValue = 0;
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg2.Mid(intPrevValue, (SLiter->second + 1));
-
- intPrevValue = intiter->second;
-
- // Process properties.
-
- /*
-
- int intPropertyValueLen = PropertyValue.Len();
-
- if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
-
- PropertyValue.Trim();
- PropertyValue.RemoveLast();
-
- }
-
- */
-
- // Add the data to the General/Home/Work address variables.
-
- // Trim any whitespace from the start and end.
-
- PropertyData = PropertyData.Trim(FALSE);
- PropertyData = PropertyData.Trim(TRUE);
-
- ProcessCaptureStrings(&PropertyData);
-
- wxListItem coldata;
-
- coldata.SetId(intValueSeek);
- coldata.SetData(intValueSeek);
- coldata.SetText(PropertyData);
-
- ListCtrlIndex = lboCategories->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboCategories->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
-
- }
-
- CategoriesList.erase(intValueSeek);
- CategoriesListType.erase(intValueSeek);
- CategoriesListTokens.erase(intValueSeek);
- CategoriesList.insert(std::make_pair(intValueSeek, PropertyData));
- CategoriesListType.insert(std::make_pair(intValueSeek, PropertyType));
- CategoriesListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- CategoryCount++;
- intValueSeek++;
-
- }
-
- } else if (wxSProperty == wxT("PHOTO")) {
-
- int intPropertyLen = wxSPropertySeg1.Len();
- std::map<int, int> SplitPoints;
- std::map<int, int> SplitLength;
- std::map<int, int>::iterator SLiter;
- wxString PropertyData;
- wxString PropertyName;
- wxString PropertyValue;
- wxString PropertyTokens;
- bool FirstToken = TRUE;
- int intSplitsFound = 0;
- int intSplitSize = 0;
- int intPrevValue = 7;
- int intPref = 0;
- int intType = 0;
- int intSplitSeek = 0;
- long ListCtrlIndex;
-
- SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
-
- intPrevValue = 6;
-
- // Look for type before continuing.
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- if (PropertyName == wxT("TYPE")){
-
- if (PropertyValue == wxT("work")){
-
- intType = 2;
-
- } else if (PropertyValue == wxT("home")){
-
- intType = 1;
-
- } else {
-
- intType = 0;
-
- }
-
- }
-
- }
-
- // Setup blank lines for later on.
-
- PicturesList.insert(std::make_pair(intValueSeek, ""));
- PicturesListType.insert(std::make_pair(intValueSeek, wxT("")));
- PicturesListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- PicturesListPID.insert(std::make_pair(intValueSeek, wxT("")));
- PicturesListPref.insert(std::make_pair(intValueSeek, 0));
- PicturesListPicEncType.insert(std::make_pair(intValueSeek, wxT("")));
- PicturesListPictureType.insert(std::make_pair(intValueSeek, wxT("")));
- PicturesListTokens.insert(std::make_pair(intValueSeek, wxT("")));
- PicturesListMediatype.insert(std::make_pair(intValueSeek, wxT("")));
-
- intPrevValue = 6;
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- // Process properties.
-
- int intPropertyValueLen = PropertyValue.Len();
-
- if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
-
- PropertyValue.Trim();
- PropertyValue.RemoveLast();
-
- }
-
- if (PropertyValue.Mid(0, 1) == wxT("\"")){
-
- PropertyValue.Remove(0, 1);
-
- }
-
- ProcessCaptureStrings(&PropertyValue);
-
- if (PropertyName == wxT("ALTID")){
-
- if (intType == 0){ PicturesListAltID.erase(intValueSeek); PicturesListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ PicturesListAltID.erase(intValueSeek); PicturesListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ PicturesListAltID.erase(intValueSeek); PicturesListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PID")){
-
- if (intType == 0){ PicturesListPID.erase(intValueSeek); PicturesListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ PicturesListPID.erase(intValueSeek); PicturesListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ PicturesListPID.erase(intValueSeek); PicturesListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PREF")){
-
- intPref = wxAtoi(PropertyValue);
-
- if (intType == 0){ PicturesListPref.erase(intValueSeek); PicturesListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 1){ PicturesListPref.erase(intValueSeek); PicturesListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 2){ PicturesListPref.erase(intValueSeek); PicturesListPref.insert(std::make_pair(intValueSeek, intPref)); }
-
- } else if (PropertyName == wxT("MEDIATYPE")){
-
- if (intType == 0){ PicturesListMediatype.erase(intValueSeek); PicturesListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ PicturesListMediatype.erase(intValueSeek); PicturesListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ PicturesListMediatype.erase(intValueSeek); PicturesListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else {
-
- // Something else we don't know about so append
- // to the tokens variable.
-
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
-
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
-
- }
-
- }
-
- }
-
- intPropertyLen = wxSPropertySeg2.Len();
- SplitPoints.clear();
- SplitLength.clear();
- intSplitsFound = 0;
- intSplitSize = 0;
- intPrevValue = 0;
-
- ProcessCaptureStrings(&wxSPropertySeg2);
-
- for (int i = 0; i <= intPropertyLen; i++){
-
- intSplitSize++;
-
- if (wxSPropertySeg2.Mid(i, 1) == wxT(";")){
-
- intSplitsFound++;
- SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
-
- if (intSplitsFound == 6){
-
- SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
- break;
-
- } else {
-
- SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
-
- }
-
- intSplitSize = 0;
-
- }
-
- }
-
- wxString wxSPhotoURI;
- wxString wxSPhotoMIME;
- wxString wxSPhotoEncoding;
- wxString wxSPhotoData;
- std::string base64enc;
-
- if (intSplitsFound = 0){
-
- } else {
-
- std::map<int, int>::iterator striter;
-
- striter = SplitLength.find(1);
-
- wxStringTokenizer wSTDataType(wxSPropertySeg2.Mid(0, striter->second), wxT(":"));
-
- while (wSTDataType.HasMoreTokens() == TRUE){
-
- wxSPhotoURI = wSTDataType.GetNextToken();
- wxSPhotoMIME = wSTDataType.GetNextToken();
- break;
-
- }
-
- wxStringTokenizer wSTDataInfo(wxSPropertySeg2.Mid((striter->second + 1)), wxT(","));
-
- while (wSTDataInfo.HasMoreTokens() == TRUE){
-
- wxSPhotoEncoding = wSTDataInfo.GetNextToken();
- wxSPhotoData = wSTDataInfo.GetNextToken();
- base64enc = wxSPhotoData.mb_str();
- break;
-
- }
-
- }
-
- // Add the data to the General/Home/Work address variables.
-
- wxListItem coldata;
-
- coldata.SetId(intValueSeek);
- coldata.SetData(intValueSeek);
- coldata.SetText(_("Picture"));
-
- ListCtrlIndex = lboPictures->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboPictures->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
-
- }
-
- PicturesList.erase(intValueSeek);
- PicturesListType.erase(intValueSeek);
- PicturesListTokens.erase(intValueSeek);
- PicturesListPictureType.erase(intValueSeek);
- PicturesListPicEncType.erase(intValueSeek);
- PicturesList.insert(std::make_pair(intValueSeek, base64enc));
- PicturesListPictureType.insert(std::make_pair(intValueSeek, wxSPhotoMIME));
- PicturesListPicEncType.insert(std::make_pair(intValueSeek, wxSPhotoEncoding));
-
- if (intType == 0){
-
- PicturesListType.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 1){
-
- PicturesListType.insert(std::make_pair(intValueSeek, wxT("home")));
- lboLogos->SetItem(ListCtrlIndex, 1, _("Home"));
-
- } else if (intType == 2){
-
- PicturesListType.insert(std::make_pair(intValueSeek, wxT("work")));
- lboLogos->SetItem(ListCtrlIndex, 1, _("Work"));
-
- }
-
- PicturesListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- PhotoCount++;
- intValueSeek++;
-
- } else if (wxSProperty == wxT("LOGO")) {
-
- int intPropertyLen = wxSPropertySeg1.Len();
- std::map<int, int> SplitPoints;
- std::map<int, int> SplitLength;
- std::map<int, int>::iterator SLiter;
- wxString PropertyData;
- wxString PropertyName;
- wxString PropertyValue;
- wxString PropertyTokens;
- bool FirstToken = TRUE;
- int intSplitsFound = 0;
- int intSplitSize = 0;
- int intPrevValue = 6;
- int intPref = 0;
- int intType = 0;
- int intSplitSeek = 0;
- long ListCtrlIndex;
-
- SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
-
- intPrevValue = 5;
-
- // Look for type before continuing.
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- if (PropertyName == wxT("TYPE")){
-
- if (PropertyValue == wxT("work")){
-
- intType = 2;
-
- } else if (PropertyValue == wxT("home")){
-
- intType = 1;
-
- } else {
-
- intType = 0;
-
- }
-
- }
-
- }
-
- // Setup blank lines for later on.
-
- LogosList.insert(std::make_pair(intValueSeek, ""));
- LogosListType.insert(std::make_pair(intValueSeek, wxT("")));
- LogosListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- LogosListPID.insert(std::make_pair(intValueSeek, wxT("")));
- LogosListPref.insert(std::make_pair(intValueSeek, 0));
- LogosListPicEncType.insert(std::make_pair(intValueSeek, wxT("")));
- LogosListPictureType.insert(std::make_pair(intValueSeek, wxT("")));
- LogosListTokens.insert(std::make_pair(intValueSeek, wxT("")));
- LogosListMediatype.insert(std::make_pair(intValueSeek, wxT("")));
-
- intPrevValue = 5;
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- // Process properties.
-
- int intPropertyValueLen = PropertyValue.Len();
-
- if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
-
- PropertyValue.Trim();
- PropertyValue.RemoveLast();
-
- }
-
- if (PropertyValue.Mid(0, 1) == wxT("\"")){
-
- PropertyValue.Remove(0, 1);
-
- }
-
- ProcessCaptureStrings(&PropertyValue);
-
- if (PropertyName == wxT("ALTID")){
-
- if (intType == 0){ LogosListAltID.erase(intValueSeek); LogosListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ LogosListAltID.erase(intValueSeek); LogosListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ LogosListAltID.erase(intValueSeek); LogosListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PID")){
-
- if (intType == 0){ LogosListPID.erase(intValueSeek); LogosListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ LogosListPID.erase(intValueSeek); LogosListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ LogosListPID.erase(intValueSeek); LogosListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PREF")){
-
- intPref = wxAtoi(PropertyValue);
-
- if (intType == 0){ LogosListPref.erase(intValueSeek); LogosListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 1){ LogosListPref.erase(intValueSeek); LogosListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 2){ LogosListPref.erase(intValueSeek); LogosListPref.insert(std::make_pair(intValueSeek, intPref)); }
-
- } else if (PropertyName == wxT("MEDIATYPE")){
-
- if (intType == 0){ LogosListMediatype.erase(intValueSeek); LogosListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ LogosListMediatype.erase(intValueSeek); LogosListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ LogosListMediatype.erase(intValueSeek); LogosListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else {
-
- // Something else we don't know about so append
- // to the tokens variable.
-
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
-
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
-
- }
-
- }
-
- }
-
- intPropertyLen = wxSPropertySeg2.Len();
- SplitPoints.clear();
- SplitLength.clear();
- intSplitsFound = 0;
- intSplitSize = 0;
- intPrevValue = 0;
-
- wxString wxSPhotoURI;
- wxString wxSPhotoMIME;
- wxString wxSPhotoEncoding;
- wxString wxSPhotoData;
- std::string base64enc;
-
- ProcessCaptureStrings(&wxSPropertySeg2);
-
- if (intSplitsFound = 0){
-
- } else {
-
- std::map<int, int>::iterator striter;
-
- striter = SplitLength.find(1);
-
- wxStringTokenizer wSTDataType(wxSPropertySeg2.Mid(0, striter->second), wxT(":"));
-
- while (wSTDataType.HasMoreTokens() == TRUE){
-
- wxSPhotoURI = wSTDataType.GetNextToken();
- wxSPhotoMIME = wSTDataType.GetNextToken();
- break;
-
- }
-
- wxStringTokenizer wSTDataInfo(wxSPropertySeg2.Mid((striter->second + 1)), wxT(","));
-
- while (wSTDataInfo.HasMoreTokens() == TRUE){
-
- wxSPhotoEncoding = wSTDataInfo.GetNextToken();
- wxSPhotoData = wSTDataInfo.GetNextToken();
- base64enc = wxSPhotoData.mb_str();
- break;
-
- }
-
- }
-
- // Add the data to the General/Home/Work address variables.
-
- wxListItem coldata;
-
- coldata.SetId(intValueSeek);
- coldata.SetData(intValueSeek);
- coldata.SetText(_("Picture"));
-
- ListCtrlIndex = lboLogos->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboLogos->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
-
- }
-
- LogosList.erase(intValueSeek);
- LogosListType.erase(intValueSeek);
- LogosListTokens.erase(intValueSeek);
- LogosListPictureType.erase(intValueSeek);
- LogosListPicEncType.erase(intValueSeek);
- LogosList.insert(std::make_pair(intValueSeek, base64enc));
- LogosListPictureType.insert(std::make_pair(intValueSeek, wxSPhotoMIME));
- LogosListPicEncType.insert(std::make_pair(intValueSeek, wxSPhotoEncoding));
-
- if (intType == 0){
-
- LogosListType.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 1){
-
- LogosListType.insert(std::make_pair(intValueSeek, wxT("home")));
- lboLogos->SetItem(ListCtrlIndex, 1, _("Home"));
-
- } else if (intType == 2){
-
- LogosListType.insert(std::make_pair(intValueSeek, wxT("work")));
- lboLogos->SetItem(ListCtrlIndex, 1, _("Work"));
-
- }
-
- LogosListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- LogoCount++;
- intValueSeek++;
-
- } else if (wxSProperty == wxT("SOUND")) {
-
- int intPropertyLen = wxSPropertySeg1.Len();
- std::map<int, int> SplitPoints;
- std::map<int, int> SplitLength;
- std::map<int, int>::iterator SLiter;
- wxString PropertyData;
- wxString PropertyName;
- wxString PropertyValue;
- wxString PropertyTokens;
- bool FirstToken = TRUE;
- int intSplitsFound = 0;
- int intSplitSize = 0;
- int intPrevValue = 7;
- int intPref = 0;
- int intType = 0;
- int intSplitSeek = 0;
- long ListCtrlIndex;
-
- SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
-
- intPrevValue = 6;
-
- // Look for type before continuing.
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- if (PropertyName == wxT("TYPE")){
-
- if (PropertyValue == wxT("work")){
-
- intType = 2;
-
- } else if (PropertyValue == wxT("home")){
-
- intType = 1;
-
- } else {
-
- intType = 0;
-
- }
-
- }
-
- }
-
- // Setup blank lines for later on.
-
- SoundsList.insert(std::make_pair(intValueSeek, ""));
- SoundsListType.insert(std::make_pair(intValueSeek, wxT("")));
- SoundsListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- SoundsListPID.insert(std::make_pair(intValueSeek, wxT("")));
- SoundsListPref.insert(std::make_pair(intValueSeek, 0));
- SoundsListAudioEncType.insert(std::make_pair(intValueSeek, wxT("")));
- SoundsListAudioType.insert(std::make_pair(intValueSeek, wxT("")));
- SoundsListTokens.insert(std::make_pair(intValueSeek, wxT("")));
- SoundsListMediatype.insert(std::make_pair(intValueSeek, wxT("")));
-
- intPrevValue = 6;
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- // Process properties.
-
- int intPropertyValueLen = PropertyValue.Len();
-
- if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
-
- PropertyValue.Trim();
- PropertyValue.RemoveLast();
-
- }
-
- if (PropertyValue.Mid(0, 1) == wxT("\"")){
-
- PropertyValue.Remove(0, 1);
-
- }
-
- ProcessCaptureStrings(&PropertyValue);
-
- if (PropertyName == wxT("ALTID")){
-
- if (intType == 0){ SoundsListAltID.erase(intValueSeek); SoundsListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ SoundsListAltID.erase(intValueSeek); SoundsListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ SoundsListAltID.erase(intValueSeek); SoundsListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PID")){
-
- if (intType == 0){ SoundsListPID.erase(intValueSeek); SoundsListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ SoundsListPID.erase(intValueSeek); SoundsListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ SoundsListPID.erase(intValueSeek); SoundsListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else if (PropertyName == wxT("PREF")){
-
- intPref = wxAtoi(PropertyValue);
-
- if (intType == 0){ SoundsListPref.erase(intValueSeek); SoundsListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 1){ SoundsListPref.erase(intValueSeek); SoundsListPref.insert(std::make_pair(intValueSeek, intPref)); }
- else if (intType == 2){ SoundsListPref.erase(intValueSeek); SoundsListPref.insert(std::make_pair(intValueSeek, intPref)); }
-
- } else if (PropertyName == wxT("MEDIATYPE")){
-
- if (intType == 0){ SoundsListMediatype.erase(intValueSeek); SoundsListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 1){ SoundsListMediatype.erase(intValueSeek); SoundsListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
- else if (intType == 2){ SoundsListMediatype.erase(intValueSeek); SoundsListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
-
- } else {
-
- // Something else we don't know about so append
- // to the tokens variable.
-
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
-
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
-
- }
-
- }
-
- }
-
- intPropertyLen = wxSPropertySeg2.Len();
- SplitPoints.clear();
- SplitLength.clear();
- intSplitsFound = 0;
- intSplitSize = 0;
- intPrevValue = 0;
-
- ProcessCaptureStrings(&wxSPropertySeg2);
-
- for (int i = 0; i <= intPropertyLen; i++){
-
- intSplitSize++;
-
- if (wxSPropertySeg2.Mid(i, 1) == wxT(";")){
-
- intSplitsFound++;
- SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
-
- if (intSplitsFound == 6){
-
- SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
- break;
-
- } else {
-
- SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
-
- }
-
- intSplitSize = 0;
-
- }
-
- }
-
- wxString wxSSoundURI;
- wxString wxSSoundMIME;
- wxString wxSSoundEncoding;
- wxString wxSSoundData;
- std::string base64enc;
-
- if (intSplitsFound = 0){
-
- } else {
-
- std::map<int, int>::iterator striter;
-
- striter = SplitLength.find(1);
-
- wxStringTokenizer wSTDataType(wxSPropertySeg2.Mid(0, striter->second), wxT(":"));
-
- while (wSTDataType.HasMoreTokens() == TRUE){
-
- wxSSoundURI = wSTDataType.GetNextToken();
- wxSSoundMIME = wSTDataType.GetNextToken();
- break;
-
- }
-
- wxStringTokenizer wSTDataInfo(wxSPropertySeg2.Mid((striter->second + 1)), wxT(","));
-
- while (wSTDataInfo.HasMoreTokens() == TRUE){
-
- wxSSoundEncoding = wSTDataInfo.GetNextToken();
- wxSSoundData = wSTDataInfo.GetNextToken();
- base64enc = wxSSoundData.mb_str();
- break;
-
- }
-
- }
-
- // Add the data to the General/Home/Work address variables.
-
- wxListItem coldata;
-
- coldata.SetId(intValueSeek);
- coldata.SetData(intValueSeek);
- coldata.SetText(_("Sound"));
-
- ListCtrlIndex = lboSounds->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboSounds->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
-
- }
-
- SoundsList.erase(intValueSeek);
- SoundsListType.erase(intValueSeek);
- SoundsListTokens.erase(intValueSeek);
- SoundsListAudioType.erase(intValueSeek);
- SoundsListAudioEncType.erase(intValueSeek);
- SoundsList.insert(std::make_pair(intValueSeek, base64enc));
- SoundsListAudioType.insert(std::make_pair(intValueSeek, wxSSoundMIME));
- SoundsListAudioEncType.insert(std::make_pair(intValueSeek, wxSSoundEncoding));
-
- if (intType == 0){
-
- SoundsListType.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 1){
-
- SoundsListType.insert(std::make_pair(intValueSeek, wxT("home")));
- lboLogos->SetItem(ListCtrlIndex, 1, _("Home"));
-
- } else if (intType == 2){
-
- SoundsListType.insert(std::make_pair(intValueSeek, wxT("work")));
- lboLogos->SetItem(ListCtrlIndex, 1, _("Work"));
-
- }
-
- SoundsListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- SoundCount++;
- intValueSeek++;
-
- } else if (wxSProperty == wxT("CALURI")){
-
- int intPropertyLen = wxSPropertySeg1.Len();
- std::map<int, int> SplitPoints;
- std::map<int, int> SplitLength;
- std::map<int, int>::iterator SLiter;
- wxString PropertyData;
- wxString PropertyName;
- wxString PropertyValue;
- wxString PropertyTokens;
- bool AfterFirstToken = FALSE;
- bool FirstToken = TRUE;
- int intSplitsFound = 0;
- int intSplitSize = 0;
- int intPrevValue = 8;
- int intPref = 0;
- int intType = 0;
- int intSplitSeek = 0;
- long ListCtrlIndex;
-
- SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
-
- intPrevValue = 7;
-
- // Look for type before continuing.
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- if (PropertyName == wxT("TYPE")){
-
- if (PropertyValue == wxT("work")){
-
- intType = 2;
-
- } else if (PropertyValue == wxT("home")){
-
- intType = 1;
-
- } else {
-
- intType = 0;
-
- }
-
- }
-
- }
-
- // Setup blank lines for later on.
-
- CalendarList.insert(std::make_pair(intValueSeek, wxT("")));
- CalendarListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- CalendarListPID.insert(std::make_pair(intValueSeek, wxT("")));
- CalendarListPref.insert(std::make_pair(intValueSeek, 0));
- CalendarListTokens.insert(std::make_pair(intValueSeek, wxT("")));
-
- intPrevValue = 6;
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- // Process properties.
-
- int intPropertyValueLen = PropertyValue.Len();
-
- if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
-
- PropertyValue.Trim();
- PropertyValue.RemoveLast();
-
- }
-
- if (PropertyValue.Mid(0, 1) == wxT("\"")){
-
- PropertyValue.Remove(0, 1);
-
- }
-
- if (PropertyName == wxT("ALTID")){
-
- CalendarListAltID.erase(intValueSeek); CalendarListAltID.insert(std::make_pair(intValueSeek, PropertyValue));
-
- } else if (PropertyName == wxT("PID")){
-
- CalendarListPID.erase(intValueSeek); CalendarListPID.insert(std::make_pair(intValueSeek, PropertyValue));
-
- } else if (PropertyName == wxT("PREF")){
-
- intPref = wxAtoi(PropertyValue);
-
- CalendarListPref.erase(intValueSeek); CalendarListPref.insert(std::make_pair(intValueSeek, intPref));
-
- } else if (PropertyName == wxT("MEDIATYPE")){
-
- CalendarListMediatype.erase(intValueSeek); CalendarListMediatype.insert(std::make_pair(intValueSeek, PropertyValue));
-
- } else {
-
- // Something else we don't know about so append
- // to the tokens variable.
-
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
-
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
-
- }
-
- }
-
- }
-
- // Add the data to the General/Home/Work address variables.
-
- wxListItem coldata;
-
- coldata.SetId(intValueSeek);
- coldata.SetData(intValueSeek);
- coldata.SetText(wxSPropertySeg2);
-
- ListCtrlIndex = lboCalendarAddresses->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboCalendarAddresses->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
-
- }
-
- CaptureString(&wxSPropertySeg2, FALSE);
-
- CalendarList.erase(intValueSeek);
- CalendarListType.erase(intValueSeek);
- CalendarListTokens.erase(intValueSeek);
- CalendarList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
-
- if (intType == 0){
-
- CalendarListType.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 1){
-
- CalendarListType.insert(std::make_pair(intValueSeek, wxT("home")));
- lboCalendarAddresses->SetItem(ListCtrlIndex, 1, _("Home"), intPref);
-
- } else if (intType == 2){
-
- CalendarListType.insert(std::make_pair(intValueSeek, wxT("work")));
- lboCalendarAddresses->SetItem(ListCtrlIndex, 1, _("Work"), intPref);
-
- }
-
- CalendarListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- CalAdrCount++;
- intValueSeek++;
-
- } else if (wxSProperty == wxT("CALADRURI")){
-
- int intPropertyLen = wxSPropertySeg1.Len();
- std::map<int, int> SplitPoints;
- std::map<int, int> SplitLength;
- std::map<int, int>::iterator SLiter;
- wxString PropertyData;
- wxString PropertyName;
- wxString PropertyValue;
- wxString PropertyTokens;
- bool AfterFirstToken = FALSE;
- bool FirstToken = TRUE;
- int intSplitsFound = 0;
- int intSplitSize = 0;
- int intPrevValue = 11;
- int intPref = 0;
- int intType = 0;
- int intSplitSeek = 0;
- long ListCtrlIndex;
-
- SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
-
- intPrevValue = 10;
-
- // Look for type before continuing.
-
-
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- if (PropertyName == wxT("TYPE")){
-
- if (PropertyValue == wxT("work")){
-
- intType = 2;
-
- } else if (PropertyValue == wxT("home")){
-
- intType = 1;
-
- } else {
-
- intType = 0;
-
- }
-
- }
-
- }
-
- // Setup blank lines for later on.
-
- CalendarRequestList.insert(std::make_pair(intValueSeek, wxT("")));
- CalendarRequestListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- CalendarRequestListPID.insert(std::make_pair(intValueSeek, wxT("")));
- CalendarRequestListPref.insert(std::make_pair(intValueSeek, 0));
- CalendarRequestListTokens.insert(std::make_pair(intValueSeek, wxT("")));
-
- intPrevValue = 10;
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- // Process properties.
-
- int intPropertyValueLen = PropertyValue.Len();
-
- if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
-
- PropertyValue.Trim();
- PropertyValue.RemoveLast();
-
- }
-
- if (PropertyValue.Mid(0, 1) == wxT("\"")){
-
- PropertyValue.Remove(0, 1);
-
- }
-
- if (PropertyName == wxT("ALTID")){
-
- CalendarRequestListAltID.erase(intValueSeek); CalendarRequestListAltID.insert(std::make_pair(intValueSeek, PropertyValue));
-
- } else if (PropertyName == wxT("PID")){
-
- CalendarRequestListPID.erase(intValueSeek); CalendarRequestListPID.insert(std::make_pair(intValueSeek, PropertyValue));
-
- } else if (PropertyName == wxT("PREF")){
-
- intPref = wxAtoi(PropertyValue);
-
- CalendarRequestListPref.erase(intValueSeek); CalendarRequestListPref.insert(std::make_pair(intValueSeek, intPref));
-
- } else if (PropertyName == wxT("MEDIATYPE")){
-
- CalendarRequestListMediatype.erase(intValueSeek); CalendarRequestListMediatype.insert(std::make_pair(intValueSeek, PropertyValue));
-
- } else {
-
- // Something else we don't know about so append
- // to the tokens variable.
-
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
-
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
-
- }
-
- }
-
- }
-
- // Add the data to the General/Home/Work address variables.
-
- wxListItem coldata;
-
- coldata.SetId(intValueSeek);
- coldata.SetData(intValueSeek);
- coldata.SetText(wxSPropertySeg2);
-
- ListCtrlIndex = lboCalendarRequestAddress->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboCalendarRequestAddress->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
-
- }
-
- CaptureString(&wxSPropertySeg2, FALSE);
-
- CalendarRequestList.erase(intValueSeek);
- CalendarRequestListType.erase(intValueSeek);
- CalendarRequestListTokens.erase(intValueSeek);
- CalendarRequestList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
-
- if (intType == 0){
-
- CalendarRequestListType.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 1){
-
- CalendarRequestListType.insert(std::make_pair(intValueSeek, wxT("home")));
- lboCalendarRequestAddress->SetItem(ListCtrlIndex, 1, _("Home"), intPref);
-
- } else if (intType == 2){
-
- CalendarRequestListType.insert(std::make_pair(intValueSeek, wxT("work")));
- lboCalendarRequestAddress->SetItem(ListCtrlIndex, 1, _("Work"), intPref);
-
- }
-
- CalendarRequestListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- CalReqAdrCount++;
- intValueSeek++;
-
- } else if (wxSProperty == wxT("FBURL")){
-
- int intPropertyLen = wxSPropertySeg1.Len();
- std::map<int, int> SplitPoints;
- std::map<int, int> SplitLength;
- std::map<int, int>::iterator SLiter;
- wxString PropertyData;
- wxString PropertyName;
- wxString PropertyValue;
- wxString PropertyTokens;
- bool AfterFirstToken = FALSE;
- bool FirstToken = TRUE;
- int intSplitsFound = 0;
- int intSplitSize = 0;
- int intPrevValue = 7;
- int intPref = 0;
- int intType = 0;
- int intSplitSeek = 0;
- long ListCtrlIndex;
-
- SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
-
- intPrevValue = 6;
-
- // Look for type before continuing.
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- if (PropertyName == wxT("TYPE")){
-
- if (PropertyValue == wxT("work")){
-
- intType = 2;
-
- } else if (PropertyValue == wxT("home")){
-
- intType = 1;
-
- } else {
-
- intType = 0;
-
- }
-
- }
-
- }
-
- // Setup blank lines for later on.
-
- FreeBusyList.insert(std::make_pair(intValueSeek, wxT("")));
- FreeBusyListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- FreeBusyListPID.insert(std::make_pair(intValueSeek, wxT("")));
- FreeBusyListPref.insert(std::make_pair(intValueSeek, 0));
- FreeBusyListTokens.insert(std::make_pair(intValueSeek, wxT("")));
-
- intPrevValue = 6;
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- // Process properties.
-
- int intPropertyValueLen = PropertyValue.Len();
-
- if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
-
- PropertyValue.Trim();
- PropertyValue.RemoveLast();
-
- }
-
- if (PropertyValue.Mid(0, 1) == wxT("\"")){
-
- PropertyValue.Remove(0, 1);
-
- }
-
- if (PropertyName == wxT("ALTID")){
-
- FreeBusyListAltID.erase(intValueSeek); FreeBusyListAltID.insert(std::make_pair(intValueSeek, PropertyValue));
-
- } else if (PropertyName == wxT("PID")){
-
- FreeBusyListPID.erase(intValueSeek); FreeBusyListPID.insert(std::make_pair(intValueSeek, PropertyValue));
-
- } else if (PropertyName == wxT("PREF")){
-
- intPref = wxAtoi(PropertyValue);
-
- FreeBusyListPref.erase(intValueSeek); FreeBusyListPref.insert(std::make_pair(intValueSeek, intPref));
-
- } else if (PropertyName == wxT("MEDIATYPE")){
-
- FreeBusyListMediatype.erase(intValueSeek); FreeBusyListMediatype.insert(std::make_pair(intValueSeek, PropertyValue));
-
- } else {
-
- // Something else we don't know about so append
- // to the tokens variable.
-
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
-
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
-
- }
-
- }
-
- }
-
- // Add the data to the General/Home/Work address variables.
-
- wxListItem coldata;
-
- coldata.SetId(intValueSeek);
- coldata.SetData(intValueSeek);
- coldata.SetText(wxSPropertySeg2);
-
- ListCtrlIndex = lboFreeBusyAddresses->InsertItem(coldata);
-
- if (intPref > 0 && intPref < 101){
-
- lboFreeBusyAddresses->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
-
- }
-
- CaptureString(&wxSPropertySeg2, FALSE);
-
- FreeBusyList.erase(intValueSeek);
- FreeBusyListType.erase(intValueSeek);
- FreeBusyListTokens.erase(intValueSeek);
- FreeBusyList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
-
- if (intType == 0){
-
- FreeBusyListType.insert(std::make_pair(intValueSeek, wxT("")));
-
- } else if (intType == 1){
-
- FreeBusyListType.insert(std::make_pair(intValueSeek, wxT("home")));
- lboFreeBusyAddresses->SetItem(ListCtrlIndex, 1, _("Home"), intPref);
-
- } else if (intType == 2){
-
- FreeBusyListType.insert(std::make_pair(intValueSeek, wxT("work")));
- lboFreeBusyAddresses->SetItem(ListCtrlIndex, 1, _("Work"), intPref);
-
- }
-
- FreeBusyListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
-
- FreeBusyCount++;
- intValueSeek++;
- } else if (wxSProperty == wxT("KEY")){
-
- int intPropertyLen = wxSPropertySeg1.Len();
- std::map<int, int> SplitPoints;
- std::map<int, int> SplitLength;
- std::map<int, int>::iterator SLiter;
- wxString PropertyData;
- wxString PropertyName;
- wxString PropertyValue;
- wxString PropertyTokens;
- bool AfterFirstToken = FALSE;
- bool FirstToken = TRUE;
- int intSplitsFound = 0;
- int intSplitSize = 0;
- int intPrevValue = 5;
- int intPref = 0;
- int intType = 0;
- int intSplitSeek = 0;
- long ListCtrlIndex;
-
- SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
-
- intPrevValue = 4;
-
- // Look for type before continuing.
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- if (PropertyName == wxT("TYPE")){
-
- if (PropertyValue == wxT("work")){
-
- intType = 2;
-
- } else if (PropertyValue == wxT("home")){
-
- intType = 1;
-
- } else {
-
- intType = 0;
-
- }
-
- }
-
- }
-
- // Setup blank lines for later on.
-
- KeyList.insert(std::make_pair(intValueSeek, wxT("")));
- KeyListAltID.insert(std::make_pair(intValueSeek, wxT("")));
- KeyListPID.insert(std::make_pair(intValueSeek, wxT("")));
- KeyListPref.insert(std::make_pair(intValueSeek, 0));
- KeyListKeyType.insert(std::make_pair(intValueSeek, FALSE));
- KeyListDataType.insert(std::make_pair(intValueSeek, wxT("")));
- KeyListDataEncType.insert(std::make_pair(intValueSeek, wxT("")));
- KeyListTokens.insert(std::make_pair(intValueSeek, wxT("")));
-
- intPrevValue = 4;
-
- for (std::map<int, int>::iterator intiter = SplitPoints.begin();
- intiter != SplitPoints.end(); ++intiter){
-
- SLiter = SplitLength.find(intiter->first);
-
- PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
-
- wxStringTokenizer PropertyElement (PropertyData, wxT("="));
- PropertyName = PropertyElement.GetNextToken();
- PropertyValue = PropertyElement.GetNextToken();
-
- intPrevValue = intiter->second;
-
- // Process properties.
-
- int intPropertyValueLen = PropertyValue.Len();
-
- if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
-
- PropertyValue.Trim();
- PropertyValue.RemoveLast();
-
- }
-
- if (PropertyValue.Mid(0, 1) == wxT("\"")){
-
- PropertyValue.Remove(0, 1);
-
- }
-
- if (PropertyName == wxT("ALTID")){