4 #include <wx/tokenzr.h>
5 #include <wx/datetime.h>
8 #include "frmContactEditor.h"
11 #include "../version.h"
12 #include "../vcard/vcard.h"
13 #include "../common/textprocessing.h"
14 #include "../common/dirs.h"
16 bool frmContactEditor::LoadContact(wxString Filename){
18 // Load the contact into the contact editor.
21 wxString wxSContactString;
24 XABViewMode XVMData = MainPtr->GetViewMode();
26 wxSContactFilename = Filename;
28 // Check if we are using wxWidgets version 2.8 or less and
29 // execute the required command accordingly.
31 #if wxABI_VERSION < 20900
32 ContactFile.Open(Filename.c_str(), wxT("r"));
34 ContactFile.Open(Filename, wxT("r"));
37 if (ContactFile.IsOpened() == FALSE){
43 ContactFile.ReadAll(&wxSContactString, wxConvAuto());
47 std::map<int, wxString> ContactFileLines;
48 std::map<int, wxString>::iterator striter;
50 wxStringTokenizer wSTContactFileLines(wxSContactString, wxT("\r\n"));
52 int ContactLineSeek = 0;
54 while (wSTContactFileLines.HasMoreTokens() == TRUE){
56 ContactLine = wSTContactFileLines.GetNextToken();
57 ContactFileLines.insert(std::make_pair(ContactLineSeek, ContactLine));
64 bool QuoteMode = FALSE;
65 bool PropertyFind = TRUE;
66 bool HasExtraNicknames = FALSE;
67 bool IgnoreGender = FALSE;
68 bool ExtraLineSeek = TRUE;
69 bool BirthdayProcessed = FALSE;
70 bool AnniversaryProcessed = FALSE;
71 bool FNProcessed = FALSE;
72 bool GenderProcessed = FALSE;
73 bool NameProcessed = FALSE;
74 bool UIDProcessed = FALSE;
75 bool KindProcessed = FALSE;
76 bool ETagFound = FALSE;
77 bool ETagOrigFound = FALSE;
78 int intExtraNickname = 0;
80 wxString wxSPropertySeg1;
81 wxString wxSPropertySeg2;
82 wxString wxSPropertyNextLine;
83 int ContactLineLen = 0;
84 int QuoteBreakPoint = 0;
87 int NicknameCount = 0;
101 int CategoryCount = 0;
107 int CalReqAdrCount = 0;
108 int FreeBusyCount = 0;
112 //int intValueSeek = 1;
114 for (std::map<int,wxString>::iterator iter = ContactFileLines.begin();
115 iter != ContactFileLines.end(); ++iter){
117 // Find the colon which splits the start bit from the data part.
119 ContactLine = iter->second;
121 while (ExtraLineSeek == TRUE){
123 // Check if there is extra data on the next line
124 // (indicated by space or tab at the start) and add data.
128 if (iter == ContactFileLines.end()){
135 wxSPropertyNextLine = iter->second;
138 if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
140 wxSPropertyNextLine.Remove(0, 1);
141 //wxSPropertyNextLine.Trim(FALSE);
142 //ContactLine.Trim();
143 ContactLine.Append(wxSPropertyNextLine);
148 ExtraLineSeek = FALSE;
154 ContactLineLen = ContactLine.Len();
156 // Make sure we are not in quotation mode.
157 // Make sure colon does not have \ or \\ before it.
159 for (int i = 0; i <= ContactLineLen; i++){
161 if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
163 PropertyFind = FALSE;
165 } else if (PropertyFind == TRUE){
167 wxSProperty.Append(ContactLine.Mid(i, 1));
171 if (ContactLine.Mid(i, 1) == wxT("\"")){
173 if (QuoteMode == TRUE){
185 if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
194 // Split that line at the point into two variables (ignore the colon).
196 wxSPropertySeg1 = ContactLine.Mid(0, QuoteBreakPoint);
197 wxSPropertySeg2 = ContactLine.Mid((QuoteBreakPoint + 1));
199 // Add the data into the contact editor depending on what it is.
201 if (wxSProperty == wxT("KIND") && KindProcessed == FALSE){
203 int intPropertyLen = wxSPropertySeg1.Len();
204 std::map<int, int> SplitPoints;
205 std::map<int, int> SplitLength;
206 std::map<int, int>::iterator SLiter;
207 wxString PropertyData;
208 wxString PropertyName;
209 wxString PropertyValue;
210 wxString PropertyTokens;
211 bool AfterFirstToken = FALSE;
212 bool FirstToken = TRUE;
213 int intSplitsFound = 0;
214 int intSplitSize = 0;
215 int intPrevValue = 6;
218 int intSplitSeek = 0;
220 if (wxSPropertySeg2 == wxT("individual")){
222 cmbType->SetSelection(1);
224 } else if (wxSPropertySeg2 == wxT("group")){
226 cmbType->SetSelection(2);
229 } else if (wxSPropertySeg2 == wxT("org")){
231 cmbType->SetSelection(3);
233 } else if (wxSPropertySeg2 == wxT("location")){
235 cmbType->SetSelection(4);
239 cmbType->SetSelection(0);
243 wxCommandEvent nullevent;
245 UpdateMembersTab(nullevent);
247 } else if (wxSProperty == wxT("MEMBER")){
249 int intPropertyLen = wxSPropertySeg1.Len();
250 std::map<int, int> SplitPoints;
251 std::map<int, int> SplitLength;
252 std::map<int, int>::iterator SLiter;
253 wxString PropertyData;
254 wxString PropertyName;
255 wxString PropertyValue;
256 wxString PropertyTokens;
257 bool AfterFirstToken = FALSE;
258 bool FirstToken = TRUE;
259 int intSplitsFound = 0;
260 int intSplitSize = 0;
261 int intPrevValue = 8;
264 int intSplitSeek = 0;
266 // Go through the list of contacts for the account and find the matching UID.
267 // If contact with UID doesn't match then say (unknown contact).
269 wxString AccountDirFinal = GetAccountDir(wxSContactAccount, FALSE);
271 //wxString vcardfilenamewxs;
272 wxString vCardFilename;
273 wxString vCardFilenameFull;
274 wxString vCardDataString;
275 //wxStringTokenizer vcardfileline;
277 wxString setname, setvalue;
278 //vCardNames = new std::map<wxString, wxString, std::greater<wxString>>;
279 std::multimap<wxString, wxString, std::greater<wxString>> vCardNamesAsc;
280 std::multimap<wxString, wxString, std::less<wxString>> vCardNamesDsc;
281 int ContactIndex = 0;
283 wxDir vcardaccdir(AccountDirFinal);
285 bool ProcFiles = vcardaccdir.GetFirst(&vCardFilename, wxEmptyString, wxDIR_FILES);
288 if (vCardFilename.Right(4) == wxT(".vcf") ||
289 vCardFilename.Right(4) == wxT(".VCF") ||
290 vCardFilename.Right(5) == wxT(".vcard") ||
291 vCardFilename.Right(5) == wxT(".VCARD")){
295 vCardFilenameFull.Append(AccountDirFinal);
296 vCardFilenameFull.Append(wxT("/"));
297 vCardFilenameFull.Append(vCardFilename);
299 Person.LoadFile(vCardFilenameFull);
301 if (wxSPropertySeg2.Left(9) == wxT("urn:uuid:")){
303 wxString NewPropValue;
304 NewPropValue = wxSPropertySeg2.Mid(9, wxString::npos);
305 wxSPropertySeg2 = NewPropValue;
309 if (Person.MeetBaseSpecification()){
311 wxString KindStatus = Person.Get(wxT("KIND"));
313 if (KindStatus == wxT("group")){
315 vCardFilename.Clear();
316 vCardFilenameFull.Clear();
317 vCardDataString.Clear();
318 ProcFiles = vcardaccdir.GetNext(&vCardFilename);
323 wxString PersonName = Person.Get(wxT("N"));
324 wxString PersonUID = Person.Get(wxT("UID"));
325 wxString PersonFilename = vCardFilenameFull;
327 if (PersonUID != wxSPropertySeg2){
329 vCardFilename.Clear();
330 vCardFilenameFull.Clear();
331 vCardDataString.Clear();
332 ProcFiles = vcardaccdir.GetNext(&vCardFilename);
337 //ContactsNames.insert(std::make_pair(PersonName, ContactIndex));
338 //ContactsUIDs.insert(std::make_pair(ContactIndex, PersonUID));
340 if (XVMData.SortMode == 1){
342 // Split the name into sections.
344 vCardDataString = Person.Get(wxT("N"));
346 vCardName NameData = Person.GetName();
348 vCardDataString = NameData.Forename + wxT(" ") + NameData.Surname;
350 } else if (XVMData.SortMode == 2){
352 // Split the name into sections.
354 vCardName NameData = Person.GetName();
356 vCardDataString = NameData.Surname + wxT(", ") + NameData.Forename;
358 } else if (XVMData.SortMode == 3){
360 // Check and make sure that the top most nickname is used.
362 vCardDataString = Person.Get(wxT("NICKNAME"));
364 if (vCardDataString.IsEmpty()){
366 vCardDataString = wxT("(no nickname)");
370 } else if (XVMData.SortMode == 4){
372 vCardDataString = Person.Get(wxT("FN"));
376 if (XVMData.AscendingMode == TRUE){
377 vCardNamesAsc.insert(std::make_pair(vCardDataString, PersonUID));
379 vCardNamesDsc.insert(std::make_pair(vCardDataString, PersonUID));
390 vCardFilename.Clear();
391 vCardFilenameFull.Clear();
392 vCardDataString.Clear();
393 ProcFiles = vcardaccdir.GetNext(&vCardFilename);
397 if (XVMData.AscendingMode == TRUE){
399 for (std::map<wxString,wxString>::iterator iter = vCardNamesAsc.begin();
400 iter != vCardNamesAsc.end(); ++iter){
405 ItemData.SetText(iter->first);
407 lboGroups->InsertItem(ItemData);
409 GroupsList.insert(std::make_pair(intValueSeek, iter->second));
416 for (std::map<wxString,wxString>::iterator iter = vCardNamesDsc.begin();
417 iter != vCardNamesDsc.end(); ++iter){
422 ItemData.SetText(iter->first);
424 lboGroups->InsertItem(ItemData);
426 GroupsList.insert(std::make_pair(intValueSeek, iter->second));
435 } else if (wxSProperty == wxT("FN")){
439 NameDisplayAs = wxSPropertySeg2;
440 cmbDisplayAs->SetValue(ContactData.Convert(wxSPropertySeg2, TRUE));
444 int intPropertyLen = wxSPropertySeg1.Len();
445 std::map<int, int> SplitPoints;
446 std::map<int, int> SplitLength;
447 std::map<int, int>::iterator SLiter;
448 wxString PropertyData;
449 wxString PropertyName;
450 wxString PropertyValue;
451 wxString PropertyTokens;
452 bool AfterFirstToken = FALSE;
453 bool FirstToken = TRUE;
454 int intSplitsFound = 0;
455 int intSplitSize = 0;
456 int intPrevValue = 4;
459 int intSplitSeek = 0;
461 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
465 // Look for type before continuing.
467 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
468 intiter != SplitPoints.end(); ++intiter){
470 SLiter = SplitLength.find(intiter->first);
472 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
474 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
475 PropertyName = PropertyElement.GetNextToken();
476 PropertyValue = PropertyElement.GetNextToken();
478 intPrevValue = intiter->second;
480 if (PropertyName == wxT("TYPE")){
482 if (PropertyValue == wxT("work")){
486 } else if (PropertyValue == wxT("home")){
500 // Setup blank lines for later on.
502 FullNamesList.insert(std::make_pair(intValueSeek, wxT("")));
503 FullNamesListAltID.insert(std::make_pair(intValueSeek, wxT("")));
504 FullNamesListPID.insert(std::make_pair(intValueSeek, wxT("")));
505 FullNamesListPref.insert(std::make_pair(intValueSeek, 0));
506 FullNamesListType.insert(std::make_pair(intValueSeek, wxT("")));
507 FullNamesListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
508 FullNamesListTokens.insert(std::make_pair(intValueSeek, wxT("")));
512 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
513 intiter != SplitPoints.end(); ++intiter){
515 SLiter = SplitLength.find(intiter->first);
517 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
519 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
520 PropertyName = PropertyElement.GetNextToken();
521 PropertyValue = PropertyElement.GetNextToken();
523 ProcessCaptureStrings(&PropertyValue);
525 intPrevValue = intiter->second;
527 // Process properties.
529 if (PropertyName == wxT("ALTID")){
531 FullNamesListAltID.erase(intValueSeek); FullNamesListAltID.insert(std::make_pair(intValueSeek, PropertyValue));
533 } else if (PropertyName == wxT("PID")){
535 FullNamesListPID.erase(intValueSeek); FullNamesListPID.insert(std::make_pair(intValueSeek, PropertyValue));
537 } else if (PropertyName == wxT("PREF")){
539 intPref = wxAtoi(PropertyValue);
541 if (intPref > 0 && intPref < 101){
543 FullNamesListPref.erase(intValueSeek); FullNamesListPref.insert(std::make_pair(intValueSeek, intPref));
547 } else if (PropertyName == wxT("LANG")){
549 FullNamesListLanguage.erase(intValueSeek); FullNamesListLanguage.insert(std::make_pair(intValueSeek, PropertyValue));
553 // Something else we don't know about so append
554 // to the tokens variable.
556 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
558 if (FirstToken == TRUE){
560 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
565 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
575 // Split the address.
577 //std::map<int, int>::iterator SLiter;
578 intPropertyLen = wxSPropertySeg2.Len();
585 for (int i = 0; i <= intPropertyLen; i++){
589 if (wxSPropertySeg2.Mid(i, 1) == wxT(":") && wxSPropertySeg2.Mid((i - 1), 1) != wxT("\\")){
592 SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
594 if (intSplitsFound == 1){
596 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
607 // Add the data to the General/Home/Work address variables.
613 coldata.SetId(intValueSeek);
614 coldata.SetData(intValueSeek);
615 coldata.SetText(IMPPType);
619 //ProcessCaptureStrings(wxsPropertySeg2);
621 ProcessCaptureStrings(&wxSPropertySeg2);
623 FullNamesList.erase(intValueSeek);
624 FullNamesListType.erase(intValueSeek);
625 FullNamesListTokens.erase(intValueSeek);
626 FullNamesList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
627 FullNamesListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
631 FullNamesListType.insert(std::make_pair(intValueSeek, wxT("")));
633 } else if (intType == 1){
635 FullNamesListType.insert(std::make_pair(intValueSeek, wxT("home")));
637 } else if (intType == 2){
639 FullNamesListType.insert(std::make_pair(intValueSeek, wxT("work")));
643 if (FNProcessed == FALSE){
645 NameDisplayAs = wxSPropertySeg2;
646 cmbDisplayAs->SetValue(ContactData.Convert(wxSPropertySeg2, TRUE));
653 ListCtrlIndex = lboIM->InsertItem(coldata);
655 lboIM->SetItem(ListCtrlIndex, 1, IMPPAddress);
657 if (intPref > 0 && intPref < 101){
659 lboIM->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
663 GeneralIMList.erase(intValueSeek);
664 GeneralIMListType.erase(intValueSeek);
665 GeneralIMListTokens.erase(intValueSeek);
666 GeneralIMList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
667 GeneralIMListType.insert(std::make_pair(intValueSeek, wxT("")));
668 GeneralIMListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
670 } else if (intType == 1){
672 ListCtrlIndex = lboHomeIM->InsertItem(coldata);
674 lboHomeIM->SetItem(ListCtrlIndex, 1, IMPPAddress);
676 if (intPref > 0 && intPref < 101){
678 lboHomeIM->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
682 HomeIMList.erase(intValueSeek);
683 HomeIMListType.erase(intValueSeek);
684 HomeIMListTokens.erase(intValueSeek);
685 HomeIMList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
686 HomeIMListType.insert(std::make_pair(intValueSeek, wxT("home")));
687 HomeIMListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
689 } else if (intType == 2){
691 ListCtrlIndex = lboBusinessIM->InsertItem(coldata);
693 lboBusinessIM->SetItem(ListCtrlIndex, 1, IMPPAddress);
695 if (intPref > 0 && intPref < 101){
697 lboBusinessIM->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
701 BusinessIMList.erase(intValueSeek);
702 BusinessIMListType.erase(intValueSeek);
703 BusinessIMListTokens.erase(intValueSeek);
704 BusinessIMList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
705 BusinessIMListType.insert(std::make_pair(intValueSeek, wxT("work")));
706 BusinessIMListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
713 } else if (wxSProperty == wxT("N") && NameProcessed == FALSE){
715 int intPropertyLen = wxSPropertySeg1.Len();
716 std::map<int, int> SplitPoints;
717 std::map<int, int> SplitLength;
718 std::map<int, int>::iterator SLiter;
719 wxString PropertyData;
720 wxString PropertyName;
721 wxString PropertyValue;
722 wxString PropertyTokens;
723 bool AfterFirstToken = FALSE;
724 bool FirstToken = TRUE;
725 int intSplitsFound = 0;
726 int intSplitSize = 0;
727 int intPrevValue = 3;
730 int intSplitSeek = 0;
732 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
734 // Look for type before continuing.
738 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
739 intiter != SplitPoints.end(); ++intiter){
741 SLiter = SplitLength.find(intiter->first);
743 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
745 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
746 PropertyName = PropertyElement.GetNextToken();
747 PropertyValue = PropertyElement.GetNextToken();
749 intPrevValue = intiter->second;
755 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
756 intiter != SplitPoints.end(); ++intiter){
758 SLiter = SplitLength.find(intiter->first);
760 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
762 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
763 PropertyName = PropertyElement.GetNextToken();
764 PropertyValue = PropertyElement.GetNextToken();
766 ProcessCaptureStrings(&PropertyValue);
768 intPrevValue = intiter->second;
770 // Process properties.
772 if (PropertyName == wxT("ALTID")){
774 NameAltID = PropertyValue;
776 } else if (PropertyName == wxT("LANG")){
778 NameLanguage = PropertyValue;
780 } else if (PropertyName == wxT("SORT-AS")){
782 NameDisplayAs = PropertyValue;
786 // Something else we don't know about so append
787 // to the tokens variable.
789 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty()){
791 if (FirstToken == TRUE){
793 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
798 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
808 intPropertyLen = wxSPropertySeg2.Len();
816 for (int i = 0; i <= intPropertyLen; i++){
820 if (wxSPropertySeg2.Mid(i, 1) == wxT(";") && wxSPropertySeg2.Mid((i - 1), 1) != wxT("\\")){
823 SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
825 if (intSplitsFound == 4){
827 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
832 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
842 // Split the data into several parts.
844 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
845 intiter != SplitPoints.end(); ++intiter){
847 if (intiter->first == 1){
849 // Deal with family name.
851 SLiter = SplitLength.find(1);
853 txtSurname->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(0, SLiter->second), TRUE));
855 intPrevValue = intiter->second;
856 NameSurname = wxSPropertySeg2.Mid(0, SLiter->second);
858 } else if (intiter->first == 2){
860 // Deal with given names.
862 SLiter = SplitLength.find(2);
864 txtForename->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue, SLiter->second), TRUE));
865 intPrevValue = intiter->second;
866 NameForename = wxSPropertySeg2.Mid(intPrevValue, SLiter->second);
868 } else if (intiter->first == 3){
870 // Deal with additional names.
872 SLiter = SplitLength.find(3);
874 txtOtherNames->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue, SLiter->second), TRUE));
875 intPrevValue = intiter->second;
876 NameOtherNames = wxSPropertySeg2.Mid(intPrevValue, SLiter->second);
878 } else if (intiter->first == 4){
880 // Deal with honorifix prefixes and suffixes.
882 SLiter = SplitLength.find(4);
884 txtTitle->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue, SLiter->second), TRUE));
885 intPrevValue = intiter->second;
886 NameTitle = wxSPropertySeg2.Mid(intPrevValue, SLiter->second);
888 txtSuffix->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue), TRUE));
889 NameSuffix = wxSPropertySeg2.Mid(intPrevValue);
895 NameTokens = PropertyTokens;
896 NameProcessed = TRUE;
898 } else if (wxSProperty == wxT("NICKNAME")){
900 int intPropertyLen = wxSPropertySeg1.Len();
901 std::map<int, int> SplitPoints;
902 std::map<int, int> SplitLength;
903 std::map<int, int>::iterator SLiter;
904 wxString PropertyData;
905 wxString PropertyName;
906 wxString PropertyValue;
907 wxString PropertyTokens;
908 bool AfterFirstToken = FALSE;
909 bool FirstToken = TRUE;
910 int intSplitsFound = 0;
911 int intSplitSize = 0;
912 int intPrevValue = 10;
915 int intSplitSeek = 0;
918 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
922 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
923 intiter != SplitPoints.end(); ++intiter){
925 SLiter = SplitLength.find(intiter->first);
927 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
929 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
930 PropertyName = PropertyElement.GetNextToken();
931 PropertyValue = PropertyElement.GetNextToken();
933 intPrevValue = intiter->second;
935 if (PropertyName == wxT("TYPE")){
937 if (PropertyValue == wxT("work")){
941 } else if (PropertyValue == wxT("home")){
955 // Setup blank lines for later on.
959 GeneralNicknamesList.insert(std::make_pair(intValueSeek, wxT("")));
960 GeneralNicknamesListAltID.insert(std::make_pair(intValueSeek, wxT("")));
961 GeneralNicknamesListPID.insert(std::make_pair(intValueSeek, wxT("")));
962 GeneralNicknamesListPref.insert(std::make_pair(intValueSeek, 0));
963 GeneralNicknamesListTokens.insert(std::make_pair(intValueSeek, wxT("")));
964 GeneralNicknamesListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
966 } else if (intType == 1){
968 HomeNicknamesList.insert(std::make_pair(intValueSeek, wxT("")));
969 HomeNicknamesListAltID.insert(std::make_pair(intValueSeek, wxT("")));
970 HomeNicknamesListPID.insert(std::make_pair(intValueSeek, wxT("")));
971 HomeNicknamesListPref.insert(std::make_pair(intValueSeek, 0));
972 HomeNicknamesListTokens.insert(std::make_pair(intValueSeek, wxT("")));
973 HomeNicknamesListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
975 } else if (intType == 2){
977 BusinessNicknamesList.insert(std::make_pair(intValueSeek, wxT("")));
978 BusinessNicknamesListAltID.insert(std::make_pair(intValueSeek, wxT("")));
979 BusinessNicknamesListPID.insert(std::make_pair(intValueSeek, wxT("")));
980 BusinessNicknamesListPref.insert(std::make_pair(intValueSeek, 0));
981 BusinessNicknamesListTokens.insert(std::make_pair(intValueSeek, wxT("")));
982 BusinessNicknamesListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
988 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
989 intiter != SplitPoints.end(); ++intiter){
991 SLiter = SplitLength.find(intiter->first);
993 PropertyData = wxSPropertySeg1.Mid(intPrevValue, SLiter->second);
995 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
996 PropertyName = PropertyElement.GetNextToken();
997 PropertyValue = PropertyElement.GetNextToken();
999 intPrevValue = intiter->second;
1001 ProcessCaptureStrings(&PropertyValue);
1003 // Process properties.
1005 int intPropertyValueLen = PropertyValue.Len();
1007 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
1009 PropertyValue.Trim();
1010 PropertyValue.RemoveLast();
1014 if (PropertyValue.Mid(0, 1) == wxT("\"")){
1016 PropertyValue.Remove(0, 1);
1020 if (PropertyName == wxT("ALTID")){
1022 if (intType == 0){ GeneralNicknamesListAltID.erase(intValueSeek); GeneralNicknamesListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
1023 else if (intType == 1){ HomeNicknamesListAltID.erase(intValueSeek); HomeNicknamesListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
1024 else if (intType == 2){ BusinessNicknamesListAltID.erase(intValueSeek); BusinessNicknamesListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
1026 } else if (PropertyName == wxT("PID")){
1028 if (intType == 0){ GeneralNicknamesListPID.erase(intValueSeek); GeneralNicknamesListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
1029 else if (intType == 1){ HomeNicknamesListPID.erase(intValueSeek); HomeNicknamesListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
1030 else if (intType == 2){ BusinessNicknamesListPID.erase(intValueSeek); BusinessNicknamesListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
1032 } else if (PropertyName == wxT("PREF")){
1034 intPref = wxAtoi(PropertyValue);
1036 if (intType == 0){ GeneralNicknamesListPref.erase(intValueSeek); GeneralNicknamesListPref.insert(std::make_pair(intValueSeek, intPref)); }
1037 else if (intType == 1){ HomeNicknamesListPref.erase(intValueSeek); HomeNicknamesListPref.insert(std::make_pair(intValueSeek, intPref)); }
1038 else if (intType == 2){ BusinessNicknamesListPref.erase(intValueSeek); BusinessNicknamesListPref.insert(std::make_pair(intValueSeek, intPref)); }
1040 } else if (PropertyName == wxT("LANGUAGE")){
1042 if (intType == 0){ GeneralNicknamesListLanguage.erase(intValueSeek); GeneralNicknamesListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
1043 else if (intType == 1){ HomeNicknamesListLanguage.erase(intValueSeek); HomeNicknamesListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
1044 else if (intType == 2){ BusinessNicknamesListLanguage.erase(intValueSeek); BusinessNicknamesListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
1048 // Something else we don't know about so append
1049 // to the tokens variable.
1051 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
1053 if (FirstToken == TRUE){
1055 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
1060 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
1070 // Add the data to the General/Home/Work address variables.
1072 ProcessCaptureStrings(&wxSPropertySeg2);
1076 coldata.SetId(intValueSeek);
1077 coldata.SetData(intValueSeek);
1078 coldata.SetText(wxSPropertySeg2);
1082 ListCtrlIndex = lboNicknames->InsertItem(coldata);
1084 if (intPref > 0 && intPref < 101){
1086 lboNicknames->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
1090 GeneralNicknamesList.erase(intValueSeek);
1091 GeneralNicknamesListType.erase(intValueSeek);
1092 GeneralNicknamesListTokens.erase(intValueSeek);
1093 GeneralNicknamesList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
1094 GeneralNicknamesListType.insert(std::make_pair(intValueSeek, wxT("")));
1095 GeneralNicknamesListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
1097 } else if (intType == 1){
1099 ListCtrlIndex = lboHomeNicknames->InsertItem(coldata);
1101 if (intPref > 0 && intPref < 101){
1103 lboHomeNicknames->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
1107 HomeNicknamesList.erase(intValueSeek);
1108 HomeNicknamesListType.erase(intValueSeek);
1109 HomeNicknamesListTokens.erase(intValueSeek);
1110 HomeNicknamesList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
1111 HomeNicknamesListType.insert(std::make_pair(intValueSeek, wxT("home")));
1112 HomeNicknamesListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
1114 } else if (intType == 2){
1116 ListCtrlIndex = lboBusinessNicknames->InsertItem(coldata);
1118 if (intPref > 0 && intPref < 101){
1120 lboBusinessNicknames->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
1124 BusinessNicknamesList.erase(intValueSeek);
1125 BusinessNicknamesListType.erase(intValueSeek);
1126 BusinessNicknamesListTokens.erase(intValueSeek);
1127 BusinessNicknamesList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
1128 BusinessNicknamesListType.insert(std::make_pair(intValueSeek, wxT("work")));
1129 BusinessNicknamesListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
1136 } else if (wxSProperty == wxT("GENDER") && GenderProcessed == FALSE){
1138 int intPropertyLen = wxSPropertySeg1.Len();
1139 std::map<int, int> SplitPoints;
1140 std::map<int, int> SplitLength;
1141 std::map<int, int>::iterator SLiter;
1142 wxString PropertyData;
1143 wxString PropertyName;
1144 wxString PropertyValue;
1145 wxString PropertyTokens;
1146 bool AfterFirstToken = FALSE;
1147 bool FirstToken = TRUE;;
1148 int intSplitsFound = 0;
1149 int intSplitSize = 0;
1150 int intPrevValue = 8;
1153 int intSplitSeek = 0;
1155 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
1159 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1160 intiter != SplitPoints.end(); ++intiter){
1162 SLiter = SplitLength.find(intiter->first);
1164 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
1166 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1167 PropertyName = PropertyElement.GetNextToken();
1168 PropertyValue = PropertyElement.GetNextToken();
1170 intPrevValue = intiter->second;
1172 // Process properties.
1174 int intPropertyValueLen = PropertyValue.Len();
1176 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
1178 PropertyValue.Trim();
1179 PropertyValue.RemoveLast();
1183 if (PropertyValue.Mid(0, 1) == wxT("\"")){
1185 PropertyValue.Remove(0, 1);
1189 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty()){
1191 if (FirstToken == TRUE){
1193 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
1198 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
1206 wxStringTokenizer GenderDetails (wxSPropertySeg2, wxT(";"));
1208 wxString GenderComponent;
1209 wxString GenderIdentity;
1211 if (GenderDetails.CountTokens() >= 2){
1213 GenderComponent = GenderDetails.GetNextToken();
1214 GenderIdentity = GenderDetails.GetString();
1216 ProcessCaptureStrings(&GenderIdentity);
1218 txtGenderDescription->SetValue(ContactData.Convert(GenderIdentity, TRUE));
1222 GenderComponent = GenderDetails.GetNextToken();
1226 if (GenderComponent == wxT("M")){
1230 cmbGender->SetSelection(1);
1232 } else if (GenderComponent == wxT("F")){
1234 // Gender is Female.
1236 cmbGender->SetSelection(2);
1238 } else if (GenderComponent == wxT("O")){
1242 cmbGender->SetSelection(3);
1244 } else if (GenderComponent == wxT("N")){
1246 // Gender is None/Not Applicable.
1248 cmbGender->SetSelection(4);
1250 } else if (GenderComponent == wxT("U")){
1252 // Gender is Unknown.
1254 cmbGender->SetSelection(5);
1258 GenderTokens = PropertyTokens;
1259 GenderProcessed = TRUE;
1261 } else if (wxSProperty == wxT("BDAY") && BirthdayProcessed == FALSE){
1263 // Process date. Preserve the remainder in the string.
1265 int intPropertyLen = wxSPropertySeg1.Len();
1266 std::map<int, int> SplitPoints;
1267 std::map<int, int> SplitLength;
1268 std::map<int, int>::iterator SLiter;
1269 wxString PropertyData;
1270 wxString PropertyName;
1271 wxString PropertyValue;
1272 wxString PropertyTokens;
1273 bool AfterFirstToken = FALSE;
1274 bool BirthdayText = FALSE;
1275 bool FirstToken = TRUE;
1276 int intSplitsFound = 0;
1277 int intSplitSize = 0;
1278 int intPrevValue = 6;
1281 int intSplitSeek = 0;
1283 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
1287 // Look for type before continuing.
1289 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1290 intiter != SplitPoints.end(); ++intiter){
1292 SLiter = SplitLength.find(intiter->first);
1294 PropertyData = wxSPropertySeg1.Mid(intPrevValue, SLiter->second);
1296 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1297 PropertyName = PropertyElement.GetNextToken();
1298 PropertyValue = PropertyElement.GetNextToken();
1300 intPrevValue = intiter->second;
1302 if (PropertyName == wxT("VALUE") && PropertyValue == wxT("text") && BirthdayText == FALSE){
1304 ProcessCaptureStrings(&wxSPropertySeg2);
1305 txtBirthday->SetValue(wxSPropertySeg2);
1306 Birthday = wxSPropertySeg2;
1307 BirthdayText = TRUE;
1313 // Setup blank lines for later on.
1317 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1318 intiter != SplitPoints.end(); ++intiter){
1320 SLiter = SplitLength.find(intiter->first);
1322 PropertyData = wxSPropertySeg1.Mid(intPrevValue, SLiter->second);
1324 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1325 PropertyName = PropertyElement.GetNextToken();
1326 PropertyValue = PropertyElement.GetNextToken();
1328 intPrevValue = intiter->second;
1330 // Process properties.
1332 ProcessCaptureStrings(&PropertyValue);
1334 int intPropertyValueLen = PropertyValue.Len();
1336 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
1338 PropertyValue.Trim();
1339 PropertyValue.RemoveLast();
1343 if (PropertyValue.Mid(0, 1) == wxT("\"")){
1345 PropertyValue.Remove(0, 1);
1349 if (PropertyName == wxT("ALTID")){
1351 BirthdayAltID = PropertyValue;
1353 } else if (PropertyName == wxT("CALSCALE")){
1355 BirthdayCalScale = PropertyValue;
1357 } else if (PropertyName != wxT("VALUE")) {
1359 // Something else we don't know about so append
1360 // to the tokens variable.
1362 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty()){
1364 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
1372 // Add the data to the variables and form.
1374 if (BirthdayText == FALSE){
1376 Birthday = wxSPropertySeg2;
1378 wxDateTime::Month DateMonth;
1379 unsigned int DateDay;
1383 if (Birthday.Mid(0, 2) == wxT("--")){
1389 DateYear = wxAtoi(Birthday.Mid(0,4));
1393 DateMonth = (wxDateTime::Month)(wxAtoi(Birthday.Mid(4,2)) - 1);
1394 DateDay = wxAtoi(Birthday.Mid(6,2));
1396 wxDateTime BDayDate(DateDay,DateMonth,DateYear);
1398 /*BDayDate.SetDay(DateDay);
1399 BDayDate.SetMonth(wxDateTime::Month::Jan);
1400 BDayDate.SetYear(DateYear);*/
1402 dapBirthday->SetValue(BDayDate);
1406 BirthdayTokens = PropertyTokens;
1408 BirthdayProcessed = TRUE;
1410 } else if (wxSProperty == wxT("ANNIVERSARY") && AnniversaryProcessed == FALSE){
1412 // Process date. Preserve the remainder in the string.
1414 int intPropertyLen = wxSPropertySeg1.Len();
1415 std::map<int, int> SplitPoints;
1416 std::map<int, int> SplitLength;
1417 std::map<int, int>::iterator SLiter;
1418 wxString PropertyData;
1419 wxString PropertyName;
1420 wxString PropertyValue;
1421 wxString PropertyTokens;
1422 bool AfterFirstToken = FALSE;
1423 bool AnniversaryText = FALSE;
1424 bool FirstToken = TRUE;
1425 int intSplitsFound = 0;
1426 int intSplitSize = 0;
1427 int intPrevValue = 13;
1430 int intSplitSeek = 0;
1432 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
1436 // Look for type before continuing.
1438 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1439 intiter != SplitPoints.end(); ++intiter){
1441 SLiter = SplitLength.find(intiter->first);
1443 PropertyData = wxSPropertySeg1.Mid(intPrevValue, SLiter->second);
1445 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1446 PropertyName = PropertyElement.GetNextToken();
1447 PropertyValue = PropertyElement.GetNextToken();
1449 intPrevValue = intiter->second;
1451 if (PropertyName == wxT("VALUE") && PropertyValue == wxT("text") && AnniversaryText == FALSE){
1453 ProcessCaptureStrings(&wxSPropertySeg2);
1454 txtAnniversary->SetValue(wxSPropertySeg2);
1455 Anniversary = wxSPropertySeg2;
1456 AnniversaryText = TRUE;
1462 // Setup blank lines for later on.
1466 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1467 intiter != SplitPoints.end(); ++intiter){
1469 SLiter = SplitLength.find(intiter->first);
1471 PropertyData = wxSPropertySeg1.Mid(intPrevValue, SLiter->second);
1473 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1474 PropertyName = PropertyElement.GetNextToken();
1475 PropertyValue = PropertyElement.GetNextToken();
1477 intPrevValue = intiter->second;
1479 // Process properties.
1481 int intPropertyValueLen = PropertyValue.Len();
1483 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
1485 PropertyValue.Trim();
1486 PropertyValue.RemoveLast();
1490 if (PropertyValue.Mid(0, 1) == wxT("\"")){
1492 PropertyValue.Remove(0, 1);
1496 ProcessCaptureStrings(&PropertyValue);
1498 if (PropertyName == wxT("ALTID")){
1500 AnniversaryAltID = PropertyValue;
1502 } else if (PropertyName == wxT("CALSCALE")){
1504 AnniversaryCalScale = PropertyValue;
1506 } else if (PropertyName != wxT("VALUE")) {
1508 // Something else we don't know about so append
1509 // to the tokens variable.
1511 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty()){
1513 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
1521 // Add the data to the variables and form.
1523 if (AnniversaryText == FALSE){
1525 Anniversary = wxSPropertySeg2;
1527 wxDateTime::Month DateMonth;
1532 if (Anniversary.Mid(0, 2) == wxT("--")){
1538 DateYear = wxAtoi(Anniversary.Mid(0,4));
1542 DateMonth = (wxDateTime::Month)(wxAtoi(Anniversary.Mid(4,2)) - 1);
1543 DateDay = wxAtoi(Anniversary.Mid(6,2));
1545 wxDateTime ADayDate(DateDay,DateMonth,DateYear);
1547 dapAnniversary->SetValue(ADayDate);
1551 AnniversaryTokens = PropertyTokens;
1553 AnniversaryProcessed = TRUE;
1555 } else if (wxSProperty == wxT("TZ")){
1557 int intPropertyLen = wxSPropertySeg1.Len();
1558 std::map<int, int> SplitPoints;
1559 std::map<int, int> SplitLength;
1560 std::map<int, int>::iterator SLiter;
1561 wxString PropertyData;
1562 wxString PropertyName;
1563 wxString PropertyValue;
1564 wxString PropertyTokens;
1565 bool AfterFirstToken = FALSE;
1566 bool FirstToken = TRUE;
1567 int intSplitsFound = 0;
1568 int intSplitSize = 0;
1569 int intPrevValue = 4;
1572 int intSplitSeek = 0;
1575 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
1579 // Look for type before continuing.
1581 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1582 intiter != SplitPoints.end(); ++intiter){
1584 SLiter = SplitLength.find(intiter->first);
1586 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
1588 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1589 PropertyName = PropertyElement.GetNextToken();
1590 PropertyValue = PropertyElement.GetNextToken();
1592 intPrevValue = intiter->second;
1594 if (PropertyName == wxT("TYPE")){
1596 if (PropertyValue == wxT("work")){
1600 } else if (PropertyValue == wxT("home")){
1614 // Setup blank lines for later on.
1618 GeneralTZList.insert(std::make_pair(intValueSeek, wxT("")));
1619 GeneralTZListAltID.insert(std::make_pair(intValueSeek, wxT("")));
1620 GeneralTZListPID.insert(std::make_pair(intValueSeek, wxT("")));
1621 GeneralTZListPref.insert(std::make_pair(intValueSeek, 0));
1622 GeneralTZListMediatype.insert(std::make_pair(intValueSeek, wxT("")));
1623 GeneralTZListTokens.insert(std::make_pair(intValueSeek, wxT("")));
1625 } else if (intType == 1){
1627 HomeTZList.insert(std::make_pair(intValueSeek, wxT("")));
1628 HomeTZListAltID.insert(std::make_pair(intValueSeek, wxT("")));
1629 HomeTZListPID.insert(std::make_pair(intValueSeek, wxT("")));
1630 HomeTZListPref.insert(std::make_pair(intValueSeek, 0));
1631 HomeTZListMediatype.insert(std::make_pair(intValueSeek, wxT("")));
1632 HomeTZListTokens.insert(std::make_pair(intValueSeek, wxT("")));
1634 } else if (intType == 2){
1636 BusinessTZList.insert(std::make_pair(intValueSeek, wxT("")));
1637 BusinessTZListAltID.insert(std::make_pair(intValueSeek, wxT("")));
1638 BusinessTZListPID.insert(std::make_pair(intValueSeek, wxT("")));
1639 BusinessTZListPref.insert(std::make_pair(intValueSeek, 0));
1640 BusinessTZListMediatype.insert(std::make_pair(intValueSeek, wxT("")));
1641 BusinessTZListTokens.insert(std::make_pair(intValueSeek, wxT("")));
1647 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1648 intiter != SplitPoints.end(); ++intiter){
1650 SLiter = SplitLength.find(intiter->first);
1652 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
1654 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1655 PropertyName = PropertyElement.GetNextToken();
1656 PropertyValue = PropertyElement.GetNextToken();
1658 intPrevValue = intiter->second;
1660 int intPropertyValueLen = PropertyValue.Len();
1662 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
1664 PropertyValue.Trim();
1665 PropertyValue.RemoveLast();
1669 if (PropertyValue.Mid(0, 1) == wxT("\"")){
1671 PropertyValue.Remove(0, 1);
1675 ProcessCaptureStrings(&PropertyValue);
1677 // Process properties.
1679 if (PropertyName == wxT("ALTID")){
1681 if (intType == 0){ GeneralTZListAltID.erase(intValueSeek); GeneralTZListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
1682 else if (intType == 1){ HomeTZListAltID.erase(intValueSeek); HomeTZListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
1683 else if (intType == 2){ BusinessTZListAltID.erase(intValueSeek); BusinessTZListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
1685 } else if (PropertyName == wxT("PID")){
1687 if (intType == 0){ GeneralTZListPID.erase(intValueSeek); GeneralTZListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
1688 else if (intType == 1){ HomeTZListPID.erase(intValueSeek); HomeTZListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
1689 else if (intType == 2){ BusinessTZListPID.erase(intValueSeek); BusinessTZListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
1691 } else if (PropertyName == wxT("MEDIATYPE")){
1693 if (intType == 0){ GeneralTZListMediatype.erase(intValueSeek); GeneralTZListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
1694 else if (intType == 1){ HomeTZListMediatype.erase(intValueSeek); HomeTZListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
1695 else if (intType == 2){ BusinessTZListMediatype.erase(intValueSeek); BusinessTZListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
1697 } else if (PropertyName == wxT("PREF")){
1699 intPref = wxAtoi(PropertyValue);
1701 if (intPref > 0 && intPref < 101){
1703 if (intType == 0){ GeneralTZListPref.erase(intValueSeek); GeneralTZListPref.insert(std::make_pair(intValueSeek, intPref)); }
1704 else if (intType == 1){ HomeTZListPref.erase(intValueSeek); HomeTZListPref.insert(std::make_pair(intValueSeek, intPref)); }
1705 else if (intType == 2){ BusinessTZListPref.erase(intValueSeek); BusinessTZListPref.insert(std::make_pair(intValueSeek, intPref)); }
1711 // Something else we don't know about so append
1712 // to the tokens variable.
1714 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
1716 if (FirstToken == TRUE){
1718 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
1723 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
1733 // Split the address.
1735 //std::map<int, int>::iterator SLiter;
1736 intPropertyLen = wxSPropertySeg2.Len();
1737 SplitPoints.clear();
1738 SplitLength.clear();
1743 for (int i = 0; i <= intPropertyLen; i++){
1747 if (wxSPropertySeg2.Mid(i, 1) == wxT(";") && wxSPropertySeg2.Mid((i - 1), 1) != wxT("\\")){
1750 SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
1752 if (intSplitsFound == 6){
1754 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
1759 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
1769 // Add the data to the General/Home/Work address variables.
1771 ProcessCaptureStrings(&wxSPropertySeg2);
1775 coldata.SetId(intValueSeek);
1776 coldata.SetData(intValueSeek);
1777 coldata.SetText(wxSPropertySeg2);
1781 ListCtrlIndex = lboTimezones->InsertItem(coldata);
1783 if (intPref > 0 && intPref < 101){
1785 lboTimezones->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
1789 GeneralTZList.erase(intValueSeek);
1790 GeneralTZListType.erase(intValueSeek);
1791 GeneralTZListTokens.erase(intValueSeek);
1792 GeneralTZList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
1793 GeneralTZListType.insert(std::make_pair(intValueSeek, wxT("")));
1794 GeneralTZListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
1796 } else if (intType == 1){
1798 ListCtrlIndex = lboHomeTimezones->InsertItem(coldata);
1800 if (intPref > 0 && intPref < 101){
1802 lboHomeTimezones->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
1806 HomeTZList.erase(intValueSeek);
1807 HomeTZListType.erase(intValueSeek);
1808 HomeTZListTokens.erase(intValueSeek);
1809 HomeTZList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
1810 HomeTZListType.insert(std::make_pair(intValueSeek, wxT("home")));
1811 HomeTZListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
1813 } else if (intType == 2){
1815 ListCtrlIndex = lboBusinessTimezones->InsertItem(coldata);
1817 if (intPref > 0 && intPref < 101){
1819 lboBusinessTimezones->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
1823 BusinessTZList.erase(intValueSeek);
1824 BusinessTZListType.erase(intValueSeek);
1825 BusinessTZListTokens.erase(intValueSeek);
1826 BusinessTZList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
1827 BusinessTZListType.insert(std::make_pair(intValueSeek, wxT("work")));
1828 BusinessTZListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
1835 } else if (wxSProperty == wxT("ADR")){
1837 int intPropertyLen = wxSPropertySeg1.Len();
1838 std::map<int, int> SplitPoints;
1839 std::map<int, int> SplitLength;
1840 std::map<int, int>::iterator SLiter;
1841 wxString PropertyData;
1842 wxString PropertyName;
1843 wxString PropertyValue;
1844 wxString PropertyTokens;
1845 wxString AddressLabel;
1846 wxString AddressLang;
1847 wxString AddressAltID;
1848 wxString AddressPID;
1849 wxString AddressTokens;
1850 wxString AddressGeo;
1851 wxString AddressTimezone;
1852 wxString AddressType;
1853 wxString AddressMediatype;
1854 wxString AddressPOBox;
1855 wxString AddressExtended;
1856 wxString AddressStreet;
1857 wxString AddressLocality;
1858 wxString AddressCity;
1859 wxString AddressRegion;
1860 wxString AddressPostalCode;
1861 wxString AddressCountry;
1862 bool AfterFirstToken = FALSE;
1863 bool FirstToken = TRUE;
1864 int intSplitsFound = 0;
1865 int intSplitSize = 0;
1866 int intPrevValue = 5;
1869 int intSplitSeek = 0;
1872 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
1876 // Look for type before continuing.
1878 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1879 intiter != SplitPoints.end(); ++intiter){
1881 SLiter = SplitLength.find(intiter->first);
1883 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
1885 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1886 PropertyName = PropertyElement.GetNextToken();
1887 PropertyValue = PropertyElement.GetNextToken();
1889 intPrevValue = intiter->second;
1891 if (PropertyName == wxT("TYPE")){
1893 if (PropertyValue == wxT("work")){
1897 } else if (PropertyValue == wxT("home")){
1911 // Setup blank lines for later on.
1915 GeneralAddressList.insert(std::make_pair(intValueSeek, wxT("")));
1916 GeneralAddressListTown.insert(std::make_pair(intValueSeek, wxT("")));
1917 GeneralAddressListCounty.insert(std::make_pair(intValueSeek, wxT("")));
1918 GeneralAddressListPostCode.insert(std::make_pair(intValueSeek, wxT("")));
1919 GeneralAddressListCountry.insert(std::make_pair(intValueSeek, wxT("")));
1920 GeneralAddressListLabel.insert(std::make_pair(intValueSeek, wxT("")));
1921 GeneralAddressListLang.insert(std::make_pair(intValueSeek, wxT("")));
1922 GeneralAddressListAltID.insert(std::make_pair(intValueSeek, wxT("")));
1923 GeneralAddressListPID.insert(std::make_pair(intValueSeek, wxT("")));
1924 GeneralAddressListGeo.insert(std::make_pair(intValueSeek, wxT("")));
1925 GeneralAddressListTimezone.insert(std::make_pair(intValueSeek, wxT("")));
1926 GeneralAddressListMediatype.insert(std::make_pair(intValueSeek, wxT("")));
1927 GeneralAddressListPref.insert(std::make_pair(intValueSeek, 0));
1928 GeneralAddressListTokens.insert(std::make_pair(intValueSeek, wxT("")));
1930 } else if (intType == 1){
1932 HomeAddressList.insert(std::make_pair(intValueSeek, wxT("")));
1933 HomeAddressListTown.insert(std::make_pair(intValueSeek, wxT("")));
1934 HomeAddressListCounty.insert(std::make_pair(intValueSeek, wxT("")));
1935 HomeAddressListPostCode.insert(std::make_pair(intValueSeek, wxT("")));
1936 HomeAddressListCountry.insert(std::make_pair(intValueSeek, wxT("")));
1937 HomeAddressListLabel.insert(std::make_pair(intValueSeek, wxT("")));
1938 HomeAddressListLang.insert(std::make_pair(intValueSeek, wxT("")));
1939 HomeAddressListAltID.insert(std::make_pair(intValueSeek, wxT("")));
1940 HomeAddressListPID.insert(std::make_pair(intValueSeek, wxT("")));
1941 HomeAddressListGeo.insert(std::make_pair(intValueSeek, wxT("")));
1942 HomeAddressListTimezone.insert(std::make_pair(intValueSeek, wxT("")));
1943 HomeAddressListMediatype.insert(std::make_pair(intValueSeek, wxT("")));
1944 HomeAddressListPref.insert(std::make_pair(intValueSeek, 0));
1945 HomeAddressListTokens.insert(std::make_pair(intValueSeek, wxT("")));
1947 } else if (intType == 2){
1949 BusinessAddressList.insert(std::make_pair(intValueSeek, wxT("")));
1950 BusinessAddressListTown.insert(std::make_pair(intValueSeek, wxT("")));
1951 BusinessAddressListCounty.insert(std::make_pair(intValueSeek, wxT("")));
1952 BusinessAddressListPostCode.insert(std::make_pair(intValueSeek, wxT("")));
1953 BusinessAddressListCountry.insert(std::make_pair(intValueSeek, wxT("")));
1954 BusinessAddressListLabel.insert(std::make_pair(intValueSeek, wxT("")));
1955 BusinessAddressListLang.insert(std::make_pair(intValueSeek, wxT("")));
1956 BusinessAddressListAltID.insert(std::make_pair(intValueSeek, wxT("")));
1957 BusinessAddressListPID.insert(std::make_pair(intValueSeek, wxT("")));
1958 BusinessAddressListGeo.insert(std::make_pair(intValueSeek, wxT("")));
1959 BusinessAddressListTimezone.insert(std::make_pair(intValueSeek, wxT("")));
1960 BusinessAddressListMediatype.insert(std::make_pair(intValueSeek, wxT("")));
1961 BusinessAddressListPref.insert(std::make_pair(intValueSeek, 0));
1962 BusinessAddressListTokens.insert(std::make_pair(intValueSeek, wxT("")));
1968 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1969 intiter != SplitPoints.end(); ++intiter){
1971 SLiter = SplitLength.find(intiter->first);
1973 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
1975 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1976 PropertyName = PropertyElement.GetNextToken();
1977 PropertyValue = PropertyElement.GetNextToken();
1979 intPrevValue = intiter->second;
1981 ProcessCaptureStrings(&PropertyValue);
1983 // Process properties.
1985 if (PropertyName == wxT("LABEL")){
1987 if (intType == 0){ GeneralAddressListLabel.erase(intValueSeek); GeneralAddressListLabel.insert(std::make_pair(intValueSeek, PropertyValue)); }
1988 else if (intType == 1){ HomeAddressListLabel.erase(intValueSeek); HomeAddressListLabel.insert(std::make_pair(intValueSeek, PropertyValue)); }
1989 else if (intType == 2){ BusinessAddressListLabel.erase(intValueSeek); BusinessAddressListLabel.insert(std::make_pair(intValueSeek, PropertyValue));}
1991 } else if (PropertyName == wxT("LANGUAGE")){
1993 if (intType == 0){ GeneralAddressListLang.erase(intValueSeek); GeneralAddressListLang.insert(std::make_pair(intValueSeek, PropertyValue)); }
1994 else if (intType == 1){ HomeAddressListLang.erase(intValueSeek); HomeAddressListLang.insert(std::make_pair(intValueSeek, PropertyValue)); }
1995 else if (intType == 2){ BusinessAddressListLang.erase(intValueSeek); BusinessAddressListLang.insert(std::make_pair(intValueSeek, PropertyValue)); }
1997 } else if (PropertyName == wxT("ALTID")){
1999 if (intType == 0){ GeneralAddressListAltID.erase(intValueSeek); GeneralAddressListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
2000 else if (intType == 1){ HomeAddressListAltID.erase(intValueSeek); HomeAddressListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
2001 else if (intType == 2){ BusinessAddressListAltID.erase(intValueSeek); BusinessAddressListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
2003 } else if (PropertyName == wxT("PID")){
2005 if (intType == 0){ GeneralAddressListPID.erase(intValueSeek); GeneralAddressListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
2006 else if (intType == 1){ HomeAddressListPID.erase(intValueSeek); HomeAddressListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
2007 else if (intType == 2){ BusinessAddressListPID.erase(intValueSeek); BusinessAddressListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
2009 } else if (PropertyName == wxT("GEO")){
2011 if (intType == 0){ GeneralAddressListGeo.erase(intValueSeek); GeneralAddressListGeo.insert(std::make_pair(intValueSeek, PropertyValue)); }
2012 else if (intType == 1){ HomeAddressListGeo.erase(intValueSeek); HomeAddressListGeo.insert(std::make_pair(intValueSeek, PropertyValue)); }
2013 else if (intType == 2){ BusinessAddressListGeo.erase(intValueSeek); BusinessAddressListGeo.insert(std::make_pair(intValueSeek, PropertyValue)); }
2015 } else if (PropertyName == wxT("TZ")){
2017 if (intType == 0){ GeneralAddressListTimezone.erase(intValueSeek); GeneralAddressListTimezone.insert(std::make_pair(intValueSeek, PropertyValue)); }
2018 else if (intType == 1){ HomeAddressListTimezone.erase(intValueSeek); HomeAddressListTimezone.insert(std::make_pair(intValueSeek, PropertyValue)); }
2019 else if (intType == 2){ BusinessAddressListTimezone.erase(intValueSeek); BusinessAddressListTimezone.insert(std::make_pair(intValueSeek, PropertyValue)); }
2021 } else if (PropertyName == wxT("MEDIATYPE")){
2023 if (intType == 0){ GeneralAddressListMediatype.erase(intValueSeek); GeneralAddressListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
2024 else if (intType == 1){ HomeAddressListMediatype.erase(intValueSeek); HomeAddressListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
2025 else if (intType == 2){ BusinessAddressListMediatype.erase(intValueSeek); BusinessAddressListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
2027 } else if (PropertyName == wxT("PREF")){
2029 intPref = wxAtoi(PropertyValue);
2031 if (intPref > 0 && intPref < 101){
2033 if (intType == 0){ GeneralAddressListPref.erase(intValueSeek); GeneralAddressListPref.insert(std::make_pair(intValueSeek, intPref)); }
2034 else if (intType == 1){ HomeAddressListPref.erase(intValueSeek); HomeAddressListPref.insert(std::make_pair(intValueSeek, intPref)); }
2035 else if (intType == 2){ BusinessAddressListPref.erase(intValueSeek); BusinessAddressListPref.insert(std::make_pair(intValueSeek, intPref)); }
2041 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
2043 if (FirstToken == TRUE){
2045 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
2050 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
2060 // Split the address.
2062 //std::map<int, int>::iterator SLiter;
2063 intPropertyLen = wxSPropertySeg2.Len();
2064 SplitPoints.clear();
2065 SplitLength.clear();
2070 for (int i = 0; i <= intPropertyLen; i++){
2074 if (wxSPropertySeg2.Mid(i, 1) == wxT(";") && wxSPropertySeg2.Mid((i - 1), 1) != wxT("\\")){
2077 SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
2079 if (intSplitsFound == 6){
2081 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
2086 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
2096 // Split the data into several parts.
2098 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2099 intiter != SplitPoints.end(); ++intiter){
2101 if (intiter->first == 1){
2103 // Deal with PO Box.
2105 SLiter = SplitLength.find(1);
2107 //txtSurname->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(0, SLiter->second), TRUE));
2108 AddressPOBox = wxSPropertySeg2.Mid(0, SLiter->second);
2109 intPrevValue = intiter->second;
2111 } else if (intiter->first == 2){
2113 // Deal with extended address.
2115 SLiter = SplitLength.find(2);
2117 AddressExtended = wxSPropertySeg2.Mid(intPrevValue, SLiter->second);
2118 //txtForename->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue, SLiter->second), TRUE));
2119 intPrevValue = intiter->second;
2121 } else if (intiter->first == 3){
2123 // Deal with street address.
2125 SLiter = SplitLength.find(3);
2127 AddressStreet = wxSPropertySeg2.Mid(intPrevValue, SLiter->second);
2128 //txtOtherNames->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue, SLiter->second), TRUE));
2129 intPrevValue = intiter->second;
2131 } else if (intiter->first == 4){
2133 // Deal with locality
2135 SLiter = SplitLength.find(4);
2137 AddressLocality = wxSPropertySeg2.Mid(intPrevValue, SLiter->second);
2138 //txtTitle->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue, SLiter->second), TRUE));
2139 intPrevValue = intiter->second;
2141 //txtSuffix->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue), TRUE));
2143 } else if (intiter->first == 5){
2145 // Deal with region.
2147 SLiter = SplitLength.find(5);
2149 AddressRegion = wxSPropertySeg2.Mid(intPrevValue, SLiter->second);
2150 //txtTitle->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue, SLiter->second), TRUE));
2151 intPrevValue = intiter->second;
2153 //txtSuffix->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue), TRUE));
2155 } else if (intiter->first == 6){
2157 // Deal with post code.
2159 SLiter = SplitLength.find(6);
2161 AddressPostalCode = wxSPropertySeg2.Mid(intPrevValue, SLiter->second);
2162 //txtTitle->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue, SLiter->second), TRUE));
2163 intPrevValue = intiter->second;
2165 // Deal with country.
2167 AddressCountry = wxSPropertySeg2.Mid(intPrevValue);
2168 //txtSuffix->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue), TRUE));
2174 // Add the data to the General/Home/Work address variables.
2176 ProcessCaptureStrings(&AddressStreet, &AddressLocality, &AddressRegion, &AddressPostalCode, &AddressCountry);
2180 coldata.SetId(intValueSeek);
2181 coldata.SetData(intValueSeek);
2182 coldata.SetText(AddressStreet);
2186 ListCtrlIndex = lboAddresses->InsertItem(coldata);
2187 lboAddresses->SetItem(ListCtrlIndex, 1, AddressLocality);
2188 lboAddresses->SetItem(ListCtrlIndex, 2, AddressRegion);
2189 lboAddresses->SetItem(ListCtrlIndex, 3, AddressPostalCode);
2191 if (intPref > 0 && intPref < 101){
2193 lboAddresses->SetItem(ListCtrlIndex, 4, wxString::Format(wxT("%i"), intPref));
2197 GeneralAddressList.erase(intValueSeek);
2198 GeneralAddressListTown.erase(intValueSeek);
2199 GeneralAddressListCounty.erase(intValueSeek);
2200 GeneralAddressListPostCode.erase(intValueSeek);
2201 GeneralAddressListCountry.erase(intValueSeek);
2202 GeneralAddressListType.erase(intValueSeek);
2203 GeneralAddressListTokens.erase(intValueSeek);
2204 GeneralAddressList.insert(std::make_pair(intValueSeek, AddressStreet));
2205 GeneralAddressListTown.insert(std::make_pair(intValueSeek, AddressLocality));
2206 GeneralAddressListCounty.insert(std::make_pair(intValueSeek, AddressRegion));
2207 GeneralAddressListPostCode.insert(std::make_pair(intValueSeek, AddressPostalCode));
2208 GeneralAddressListCountry.insert(std::make_pair(intValueSeek, AddressCountry));
2209 GeneralAddressListType.insert(std::make_pair(intValueSeek, wxT("")));
2210 GeneralAddressListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
2212 } else if (intType == 1){
2214 ListCtrlIndex = lboHomeAddresses->InsertItem(coldata);
2215 lboHomeAddresses->SetItem(ListCtrlIndex, 1, AddressLocality);
2216 lboHomeAddresses->SetItem(ListCtrlIndex, 2, AddressRegion);
2217 lboHomeAddresses->SetItem(ListCtrlIndex, 3, AddressPostalCode);
2219 if (intPref > 0 && intPref < 101){
2221 lboHomeAddresses->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
2225 HomeAddressList.erase(intValueSeek);
2226 HomeAddressListTown.erase(intValueSeek);
2227 HomeAddressListCounty.erase(intValueSeek);
2228 HomeAddressListPostCode.erase(intValueSeek);
2229 HomeAddressListCountry.erase(intValueSeek);
2230 HomeAddressListType.erase(intValueSeek);
2231 HomeAddressListTokens.erase(intValueSeek);
2232 HomeAddressList.insert(std::make_pair(intValueSeek, AddressStreet));
2233 HomeAddressListTown.insert(std::make_pair(intValueSeek, AddressLocality));
2234 HomeAddressListCounty.insert(std::make_pair(intValueSeek, AddressRegion));
2235 HomeAddressListPostCode.insert(std::make_pair(intValueSeek, AddressPostalCode));
2236 HomeAddressListCountry.insert(std::make_pair(intValueSeek, AddressCountry));
2237 HomeAddressListType.insert(std::make_pair(intValueSeek, wxT("home")));
2238 HomeAddressListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
2240 } else if (intType == 2){
2242 ListCtrlIndex = lboBusinessAddresses->InsertItem(coldata);
2243 lboBusinessAddresses->SetItem(ListCtrlIndex, 1, AddressLocality);
2244 lboBusinessAddresses->SetItem(ListCtrlIndex, 2, AddressRegion);
2245 lboBusinessAddresses->SetItem(ListCtrlIndex, 3, AddressPostalCode);
2247 if (intPref > 0 && intPref < 101){
2249 lboBusinessAddresses->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
2253 BusinessAddressList.erase(intValueSeek);
2254 BusinessAddressListTown.erase(intValueSeek);
2255 BusinessAddressListCounty.erase(intValueSeek);
2256 BusinessAddressListPostCode.erase(intValueSeek);
2257 BusinessAddressListCountry.erase(intValueSeek);
2258 BusinessAddressListType.erase(intValueSeek);
2259 BusinessAddressListTokens.erase(intValueSeek);
2260 BusinessAddressList.insert(std::make_pair(intValueSeek, AddressStreet));
2261 BusinessAddressListTown.insert(std::make_pair(intValueSeek, AddressLocality));
2262 BusinessAddressListCounty.insert(std::make_pair(intValueSeek, AddressRegion));
2263 BusinessAddressListPostCode.insert(std::make_pair(intValueSeek, AddressPostalCode));
2264 BusinessAddressListCountry.insert(std::make_pair(intValueSeek, AddressCountry));
2265 BusinessAddressListType.insert(std::make_pair(intValueSeek, wxT("work")));
2266 BusinessAddressListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
2273 } else if (wxSProperty == wxT("EMAIL")){
2275 int intPropertyLen = wxSPropertySeg1.Len();
2276 std::map<int, int> SplitPoints;
2277 std::map<int, int> SplitLength;
2278 std::map<int, int>::iterator SLiter;
2279 std::map<int, int>::iterator SPoint;
2280 wxString PropertyData;
2281 wxString PropertyName;
2282 wxString PropertyValue;
2283 wxString PropertyTokens;
2284 wxString AddressLabel;
2285 wxString AddressLang;
2286 wxString AddressAltID;
2287 wxString AddressPID;
2288 wxString AddressTokens;
2289 wxString AddressGeo;
2290 wxString AddressTimezone;
2291 wxString AddressType;
2292 wxString AddressMediatype;
2293 wxString AddressPOBox;
2294 wxString AddressExtended;
2295 wxString AddressStreet;
2296 wxString AddressLocality;
2297 wxString AddressCity;
2298 wxString AddressRegion;
2299 wxString AddressPostalCode;
2300 wxString AddressCountry;
2301 bool AfterFirstProperty = FALSE;
2302 bool FirstToken = TRUE;
2303 int intSplitSeek = 0;
2304 int intSplitsFound = 0;
2305 int intSplitSize = 0;
2306 int intPrevValue = 7;
2309 int intSplitPoint = 0;
2312 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
2316 // Look for type before continuing.
2318 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2319 intiter != SplitPoints.end(); ++intiter){
2321 SLiter = SplitLength.find(intiter->first);
2323 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
2325 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2326 PropertyName = PropertyElement.GetNextToken();
2327 PropertyValue = PropertyElement.GetNextToken();
2329 intPrevValue = intiter->second;
2331 if (PropertyName == wxT("TYPE")){
2333 if (PropertyValue == wxT("work")){
2337 } else if (PropertyValue == wxT("home")){
2351 // Setup blank lines for later on.
2355 GeneralEmailList.insert(std::make_pair(intValueSeek, wxT("")));
2356 GeneralEmailListAltID.insert(std::make_pair(intValueSeek, wxT("")));
2357 GeneralEmailListPID.insert(std::make_pair(intValueSeek, wxT("")));
2358 GeneralEmailListPref.insert(std::make_pair(intValueSeek, 0));
2359 GeneralEmailListTokens.insert(std::make_pair(intValueSeek, wxT("")));
2361 } else if (intType == 1){
2363 HomeEmailList.insert(std::make_pair(intValueSeek, wxT("")));
2364 HomeEmailListAltID.insert(std::make_pair(intValueSeek, wxT("")));
2365 HomeEmailListPID.insert(std::make_pair(intValueSeek, wxT("")));
2366 HomeEmailListPref.insert(std::make_pair(intValueSeek, 0));
2367 HomeEmailListTokens.insert(std::make_pair(intValueSeek, wxT("")));
2369 } else if (intType == 2){
2371 BusinessEmailList.insert(std::make_pair(intValueSeek, wxT("")));
2372 BusinessEmailListAltID.insert(std::make_pair(intValueSeek, wxT("")));
2373 BusinessEmailListPID.insert(std::make_pair(intValueSeek, wxT("")));
2374 BusinessEmailListPref.insert(std::make_pair(intValueSeek, 0));
2375 BusinessEmailListTokens.insert(std::make_pair(intValueSeek, wxT("")));
2381 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2382 intiter != SplitPoints.end(); ++intiter){
2384 SLiter = SplitLength.find(intiter->first);
2386 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
2388 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2389 PropertyName = PropertyElement.GetNextToken();
2390 PropertyValue = PropertyElement.GetNextToken();
2392 intPrevValue = intiter->second;
2394 ProcessCaptureStrings(&PropertyValue);
2396 // Process properties.
2398 if (PropertyName == wxT("ALTID")){
2400 if (intType == 0){ GeneralEmailListAltID.erase(intValueSeek); GeneralEmailListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
2401 else if (intType == 1){ HomeEmailListAltID.erase(intValueSeek); HomeEmailListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
2402 else if (intType == 2){ BusinessEmailListAltID.erase(intValueSeek); BusinessEmailListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
2404 } else if (PropertyName == wxT("PID")){
2406 if (intType == 0){ GeneralEmailListPID.erase(intValueSeek); GeneralEmailListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
2407 else if (intType == 1){ HomeEmailListPID.erase(intValueSeek); HomeEmailListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
2408 else if (intType == 2){ BusinessEmailListPID.erase(intValueSeek); BusinessEmailListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
2410 } else if (PropertyName == wxT("PREF")){
2412 intPref = wxAtoi(PropertyValue);
2414 if (intPref > 0 && intPref < 101){
2416 if (intType == 0){ GeneralEmailListPref.erase(intValueSeek); GeneralEmailListPref.insert(std::make_pair(intValueSeek, intPref)); }
2417 else if (intType == 1){ HomeEmailListPref.erase(intValueSeek); HomeEmailListPref.insert(std::make_pair(intValueSeek, intPref)); }
2418 else if (intType == 2){ BusinessEmailListPref.erase(intValueSeek); BusinessEmailListPref.insert(std::make_pair(intValueSeek, intPref)); }
2424 // Something else we don't know about so append
2425 // to the tokens variable.
2427 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
2429 if (FirstToken == TRUE){
2431 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
2436 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
2446 //std::map<int, int>::iterator SLiter;
2447 intPropertyLen = wxSPropertySeg2.Len();
2448 SplitPoints.clear();
2449 SplitLength.clear();
2454 // Add the data to the General/Home/Work email variables.
2456 ProcessCaptureStrings(&wxSPropertySeg2);
2460 coldata.SetId(intValueSeek);
2461 coldata.SetData(intValueSeek);
2462 coldata.SetText(wxSPropertySeg2);
2468 ListCtrlIndex = lboEmails->InsertItem(coldata);
2470 if (intPref > 0 && intPref < 101){
2472 lboEmails->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
2476 GeneralEmailList.erase(intValueSeek);
2477 GeneralEmailListType.erase(intValueSeek);
2478 GeneralEmailListTokens.erase(intValueSeek);
2479 GeneralEmailList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
2480 GeneralEmailListType.insert(std::make_pair(intValueSeek, wxT("")));
2481 GeneralEmailListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
2483 } else if (intType == 1){
2485 ListCtrlIndex = lboHomeEmails->InsertItem(coldata);
2487 if (intPref > 0 && intPref < 101){
2489 lboHomeEmails->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
2493 HomeEmailList.erase(intValueSeek);
2494 HomeEmailListType.erase(intValueSeek);
2495 HomeEmailListTokens.erase(intValueSeek);
2496 HomeEmailList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
2497 HomeEmailListType.insert(std::make_pair(intValueSeek, wxT("home")));
2498 HomeEmailListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
2500 } else if (intType == 2){
2502 ListCtrlIndex = lboBusinessEmail->InsertItem(coldata);
2504 if (intPref > 0 && intPref < 101){
2506 lboBusinessEmail->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
2510 BusinessEmailList.erase(intValueSeek);
2511 BusinessEmailListType.erase(intValueSeek);
2512 BusinessEmailListTokens.erase(intValueSeek);
2513 BusinessEmailList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
2514 BusinessEmailListType.insert(std::make_pair(intValueSeek, wxT("work")));
2515 BusinessEmailListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
2522 } else if (wxSProperty == wxT("IMPP")){
2524 int intPropertyLen = wxSPropertySeg1.Len();
2525 std::map<int, int> SplitPoints;
2526 std::map<int, int> SplitLength;
2527 std::map<int, int>::iterator SLiter;
2528 std::map<int, int>::iterator SPoint;
2529 wxString PropertyData;
2530 wxString PropertyName;
2531 wxString PropertyValue;
2532 wxString PropertyTokens;
2534 wxString IMPPAddress;
2535 bool AfterFirstProperty = FALSE;
2536 bool FirstToken = TRUE;
2537 int intSplitSeek = 0;
2538 int intSplitsFound = 0;
2539 int intSplitSize = 0;
2540 int intPrevValue = 6;
2543 int intSplitPoint = 0;
2546 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
2550 // Look for type before continuing.
2552 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2553 intiter != SplitPoints.end(); ++intiter){
2555 SLiter = SplitLength.find(intiter->first);
2557 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
2559 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2560 PropertyName = PropertyElement.GetNextToken();
2561 PropertyValue = PropertyElement.GetNextToken();
2563 intPrevValue = intiter->second;
2565 if (PropertyName == wxT("TYPE")){
2567 if (PropertyValue == wxT("work")){
2571 } else if (PropertyValue == wxT("home")){
2585 // Setup blank lines for later on.
2589 GeneralIMList.insert(std::make_pair(intValueSeek, wxT("")));
2590 GeneralIMListAltID.insert(std::make_pair(intValueSeek, wxT("")));
2591 GeneralIMListPID.insert(std::make_pair(intValueSeek, wxT("")));
2592 GeneralIMListPref.insert(std::make_pair(intValueSeek, 0));
2593 GeneralIMListTokens.insert(std::make_pair(intValueSeek, wxT("")));
2594 GeneralIMListMediatype.insert(std::make_pair(intValueSeek, wxT("")));
2596 } else if (intType == 1){
2598 HomeIMList.insert(std::make_pair(intValueSeek, wxT("")));
2599 HomeIMListAltID.insert(std::make_pair(intValueSeek, wxT("")));
2600 HomeIMListPID.insert(std::make_pair(intValueSeek, wxT("")));
2601 HomeIMListPref.insert(std::make_pair(intValueSeek, 0));
2602 HomeIMListTokens.insert(std::make_pair(intValueSeek, wxT("")));
2603 HomeIMListMediatype.insert(std::make_pair(intValueSeek, wxT("")));
2605 } else if (intType == 2){
2607 BusinessIMList.insert(std::make_pair(intValueSeek, wxT("")));
2608 BusinessIMListAltID.insert(std::make_pair(intValueSeek, wxT("")));
2609 BusinessIMListPID.insert(std::make_pair(intValueSeek, wxT("")));
2610 BusinessIMListPref.insert(std::make_pair(intValueSeek, 0));
2611 BusinessIMListTokens.insert(std::make_pair(intValueSeek, wxT("")));
2612 BusinessIMListMediatype.insert(std::make_pair(intValueSeek, wxT("")));
2618 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2619 intiter != SplitPoints.end(); ++intiter){
2621 SLiter = SplitLength.find(intiter->first);
2623 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
2625 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2626 PropertyName = PropertyElement.GetNextToken();
2627 PropertyValue = PropertyElement.GetNextToken();
2629 ProcessCaptureStrings(&PropertyValue);
2631 intPrevValue = intiter->second;
2633 // Process properties.
2635 if (PropertyName == wxT("ALTID")){
2637 if (intType == 0){ GeneralIMListAltID.erase(intValueSeek); GeneralIMListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
2638 else if (intType == 1){ HomeIMListAltID.erase(intValueSeek); HomeIMListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
2639 else if (intType == 2){ BusinessIMListAltID.erase(intValueSeek); BusinessIMListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
2641 } else if (PropertyName == wxT("PID")){
2643 if (intType == 0){ GeneralIMListPID.erase(intValueSeek); GeneralIMListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
2644 else if (intType == 1){ HomeIMListPID.erase(intValueSeek); HomeIMListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
2645 else if (intType == 2){ BusinessIMListPID.erase(intValueSeek); BusinessIMListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
2647 } else if (PropertyName == wxT("PREF")){
2649 intPref = wxAtoi(PropertyValue);
2651 if (intPref > 0 && intPref < 101){
2653 if (intType == 0){ GeneralIMListPref.erase(intValueSeek); GeneralIMListPref.insert(std::make_pair(intValueSeek, intPref)); }
2654 else if (intType == 1){ HomeIMListPref.erase(intValueSeek); HomeIMListPref.insert(std::make_pair(intValueSeek, intPref)); }
2655 else if (intType == 2){ BusinessIMListPref.erase(intValueSeek); BusinessIMListPref.insert(std::make_pair(intValueSeek, intPref)); }
2659 } else if (PropertyName == wxT("MEDIATYPE")){
2661 if (intType == 0){ GeneralIMListMediatype.erase(intValueSeek); GeneralIMListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
2662 else if (intType == 1){ HomeIMListMediatype.erase(intValueSeek); HomeIMListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
2663 else if (intType == 2){ BusinessIMListMediatype.erase(intValueSeek); BusinessIMListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
2667 // Something else we don't know about so append
2668 // to the tokens variable.
2670 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
2672 if (FirstToken == TRUE){
2674 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
2679 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
2689 // Split the address.
2691 //std::map<int, int>::iterator SLiter;
2692 intPropertyLen = wxSPropertySeg2.Len();
2693 SplitPoints.clear();
2694 SplitLength.clear();
2699 for (int i = 0; i <= intPropertyLen; i++){
2703 if (wxSPropertySeg2.Mid(i, 1) == wxT(":") && wxSPropertySeg2.Mid((i - 1), 1) != wxT("\\")){
2706 SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
2708 if (intSplitsFound == 1){
2710 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
2721 // Split the data into several parts.
2723 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2724 intiter != SplitPoints.end(); ++intiter){
2726 if (intiter->first == 1){
2728 // Deal with PO Box.
2730 SLiter = SplitLength.find(1);
2732 //txtSurname->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(0, SLiter->second), TRUE));
2733 IMPPType = wxSPropertySeg2.Mid(0, SLiter->second);
2734 intPrevValue = intiter->second;
2736 IMPPAddress = wxSPropertySeg2.Mid(intPrevValue);
2742 // Check what IM type it is.
2744 if (IMPPType == wxT("aim")){
2746 IMPPType = wxT("AIM");
2748 } else if (IMPPType == wxT("gg")){
2750 IMPPType = wxT("Gadu-Gadu");
2752 } else if (IMPPType == wxT("icq")){
2754 IMPPType = wxT("ICQ");
2756 } else if (IMPPType == wxT("skype")){
2758 IMPPType = wxT("Skype");
2760 } else if (IMPPType == wxT("xmpp")){
2762 IMPPType = wxT("XMPP");
2764 } else if (IMPPType == wxT("yahoo")){
2766 IMPPType = wxT("Yahoo");
2774 // Add the data to the General/Home/Work address variables.
2776 ProcessCaptureStrings(&wxSPropertySeg2);
2780 coldata.SetId(intValueSeek);
2781 coldata.SetData(intValueSeek);
2782 coldata.SetText(IMPPType);
2786 ListCtrlIndex = lboIM->InsertItem(coldata);
2788 lboIM->SetItem(ListCtrlIndex, 1, IMPPAddress);
2790 if (intPref > 0 && intPref < 101){
2792 lboIM->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
2796 GeneralIMList.erase(intValueSeek);
2797 GeneralIMListType.erase(intValueSeek);
2798 GeneralIMListTokens.erase(intValueSeek);
2799 GeneralIMList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
2800 GeneralIMListType.insert(std::make_pair(intValueSeek, wxT("")));
2801 GeneralIMListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
2803 } else if (intType == 1){
2805 ListCtrlIndex = lboHomeIM->InsertItem(coldata);
2807 lboHomeIM->SetItem(ListCtrlIndex, 1, IMPPAddress);
2809 if (intPref > 0 && intPref < 101){
2811 lboHomeIM->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
2815 HomeIMList.erase(intValueSeek);
2816 HomeIMListType.erase(intValueSeek);
2817 HomeIMListTokens.erase(intValueSeek);
2818 HomeIMList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
2819 HomeIMListType.insert(std::make_pair(intValueSeek, wxT("home")));
2820 HomeIMListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
2822 } else if (intType == 2){
2824 ListCtrlIndex = lboBusinessIM->InsertItem(coldata);
2826 lboBusinessIM->SetItem(ListCtrlIndex, 1, IMPPAddress);
2828 if (intPref > 0 && intPref < 101){
2830 lboBusinessIM->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
2834 BusinessIMList.erase(intValueSeek);
2835 BusinessIMListType.erase(intValueSeek);
2836 BusinessIMListTokens.erase(intValueSeek);
2837 BusinessIMList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
2838 BusinessIMListType.insert(std::make_pair(intValueSeek, wxT("work")));
2839 BusinessIMListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
2846 } else if (wxSProperty == wxT("TEL")){
2848 // Check TEL and make sure it is functioning properly.
2850 int intPropertyLen = wxSPropertySeg1.Len();
2851 std::map<int, int> SplitPoints;
2852 std::map<int, int> SplitLength;
2853 std::map<int, int> TypeSplitPoints;
2854 std::map<int, int> TypeSplitLength;
2855 std::map<int, int>::iterator SLiter;
2856 std::map<int, int>::iterator SPoint;
2857 std::map<int, int>::iterator TSLiter;
2858 std::map<int, int>::iterator TSPoint;
2859 wxString PropertyData;
2860 wxString PropertyName;
2861 wxString PropertyValue;
2862 wxString PropertyTokens;
2866 wxString TelTypeDetail;
2867 bool AfterFirstProperty = FALSE;
2868 bool FirstToken = TRUE;
2869 int intSplitSeek = 0;
2870 int intSplitsFound = 0;
2871 int intSplitSize = 0;
2872 int intPrevValue = 5;
2875 int intSplitPoint = 0;
2878 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
2882 // Look for type before continuing.
2884 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2885 intiter != SplitPoints.end(); ++intiter){
2887 SLiter = SplitLength.find(intiter->first);
2889 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
2891 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2892 PropertyName = PropertyElement.GetNextToken();
2893 PropertyValue = PropertyElement.GetNextToken();
2895 intPrevValue = intiter->second;
2897 if (PropertyName == wxT("TYPE")){
2899 // Process each value in type and translate each
2902 // Strip out the quotes if they are there.
2904 int intPropertyValueLen = PropertyValue.Len();
2906 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
2908 PropertyValue.Trim();
2909 PropertyValue.RemoveLast();
2913 if (PropertyValue.Mid(0, 1) == wxT("\"")){
2915 PropertyValue.Remove(0, 1);
2919 TelTypeDetail = PropertyValue;
2925 for (int i = 0; i <= intPropertyValueLen; i++){
2929 if (PropertyValue.Mid(i, 1) == wxT(",") && PropertyValue.Mid((i - 1), 1) != wxT("\\")){
2931 if (intSplitsFound == 0){
2933 TypeSplitPoints.insert(std::make_pair(intSplitsFound, intSplitPoint));
2934 TypeSplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
2938 TypeSplitPoints.insert(std::make_pair(intSplitsFound, intSplitPoint));
2939 TypeSplitLength.insert(std::make_pair(intSplitsFound, intSplitSize));
2952 TypeSplitPoints.insert(std::make_pair(intSplitsFound, intSplitPoint));
2953 TypeSplitLength.insert(std::make_pair(intSplitsFound, intSplitSize));
2955 int intTypeSeek = 0;
2957 for (std::map<int, int>::iterator typeiter = TypeSplitPoints.begin();
2958 typeiter != TypeSplitPoints.end(); ++typeiter){
2960 wxString TypePropertyName;
2962 TSLiter = TypeSplitLength.find(typeiter->first);
2964 TypePropertyName = PropertyValue.Mid(typeiter->second, TSLiter->second);
2966 if (intTypeSeek == 0){
2971 TelTypeUI.Append(wxT(","));
2975 if (TypePropertyName == wxT("home")){
2979 } else if (TypePropertyName == wxT("work")){
2986 if (TypePropertyName == wxT("text")){
2988 TelTypeUI.Append(_("text"));
2991 } else if (TypePropertyName == wxT("voice")){
2993 TelTypeUI.Append(_("voice"));
2996 } else if (TypePropertyName == wxT("fax")){
2998 TelTypeUI.Append(_("fax"));
3001 } else if (TypePropertyName == wxT("cell")){
3003 TelTypeUI.Append(_("mobile"));
3006 } else if (TypePropertyName == wxT("video")){
3008 TelTypeUI.Append(_("video"));
3011 } else if (TypePropertyName == wxT("pager")){
3013 TelTypeUI.Append(_("pager"));
3016 } else if (TypePropertyName == wxT("textphone")){
3018 TelTypeUI.Append(_("textphone"));
3031 // Setup blank lines for later on.
3035 GeneralTelephoneList.insert(std::make_pair(intValueSeek, wxT("")));
3036 GeneralTelephoneListAltID.insert(std::make_pair(intValueSeek, wxT("")));
3037 GeneralTelephoneListPID.insert(std::make_pair(intValueSeek, wxT("")));
3038 GeneralTelephoneListPref.insert(std::make_pair(intValueSeek, 0));
3039 GeneralTelephoneListTokens.insert(std::make_pair(intValueSeek, wxT("")));
3041 } else if (intType == 1){
3043 HomeTelephoneList.insert(std::make_pair(intValueSeek, wxT("")));
3044 HomeTelephoneListAltID.insert(std::make_pair(intValueSeek, wxT("")));
3045 HomeTelephoneListPID.insert(std::make_pair(intValueSeek, wxT("")));
3046 HomeTelephoneListPref.insert(std::make_pair(intValueSeek, 0));
3047 HomeTelephoneListTokens.insert(std::make_pair(intValueSeek, wxT("")));
3049 } else if (intType == 2){
3051 BusinessTelephoneList.insert(std::make_pair(intValueSeek, wxT("")));
3052 BusinessTelephoneListAltID.insert(std::make_pair(intValueSeek, wxT("")));
3053 BusinessTelephoneListPID.insert(std::make_pair(intValueSeek, wxT("")));
3054 BusinessTelephoneListPref.insert(std::make_pair(intValueSeek, 0));
3055 BusinessTelephoneListTokens.insert(std::make_pair(intValueSeek, wxT("")));
3061 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3062 intiter != SplitPoints.end(); ++intiter){
3064 SLiter = SplitLength.find(intiter->first);
3066 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
3068 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3069 PropertyName = PropertyElement.GetNextToken();
3070 PropertyValue = PropertyElement.GetNextToken();
3072 intPrevValue = intiter->second;
3074 int intPropertyValueLen = PropertyValue.Len();
3076 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
3078 PropertyValue.Trim();
3079 PropertyValue.RemoveLast();
3083 if (PropertyValue.Mid(0, 1) == wxT("\"")){
3085 PropertyValue.Remove(0, 1);
3089 ProcessCaptureStrings(&PropertyValue);
3091 // Process properties.
3093 if (PropertyName == wxT("ALTID")){
3095 if (intType == 0){ GeneralTelephoneListAltID.erase(intValueSeek); GeneralTelephoneListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
3096 else if (intType == 1){ HomeTelephoneListAltID.erase(intValueSeek); HomeTelephoneListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
3097 else if (intType == 2){ BusinessTelephoneListAltID.erase(intValueSeek); BusinessTelephoneListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
3099 } else if (PropertyName == wxT("PID")){
3101 if (intType == 0){ GeneralTelephoneListPID.erase(intValueSeek); GeneralTelephoneListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
3102 else if (intType == 1){ HomeTelephoneListPID.erase(intValueSeek); HomeTelephoneListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
3103 else if (intType == 2){ BusinessTelephoneListPID.erase(intValueSeek); BusinessTelephoneListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
3105 } else if (PropertyName == wxT("PREF")){
3107 intPref = wxAtoi(PropertyValue);
3109 if (intPref > 0 && intPref < 101){
3111 if (intType == 0){ GeneralTelephoneListPref.erase(intValueSeek); GeneralTelephoneListPref.insert(std::make_pair(intValueSeek, intPref)); }
3112 else if (intType == 1){ HomeTelephoneListPref.erase(intValueSeek); HomeTelephoneListPref.insert(std::make_pair(intValueSeek, intPref)); }
3113 else if (intType == 2){ BusinessTelephoneListPref.erase(intValueSeek); BusinessTelephoneListPref.insert(std::make_pair(intValueSeek, intPref)); }
3119 // Something else we don't know about so append
3120 // to the tokens variable.
3122 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
3124 if (FirstToken == TRUE){
3126 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
3131 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
3141 // Split the address.
3143 //std::map<int, int>::iterator SLiter;
3144 intPropertyLen = wxSPropertySeg2.Len();
3145 SplitPoints.clear();
3146 SplitLength.clear();
3151 for (int i = 0; i <= intPropertyLen; i++){
3155 if (wxSPropertySeg2.Mid(i, 1) == wxT(":") && wxSPropertySeg2.Mid((i - 1), 1) != wxT("\\")){
3158 SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
3160 if (intSplitsFound == 1){
3162 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
3173 // Split the data into several parts.
3175 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3176 intiter != SplitPoints.end(); ++intiter){
3178 if (intiter->first == 1){
3180 // Deal with PO Box.
3182 SLiter = SplitLength.find(1);
3184 //txtSurname->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(0, SLiter->second), TRUE));
3185 TelType = wxSPropertySeg2.Mid(0, SLiter->second);
3186 intPrevValue = intiter->second;
3188 TelNumber = wxSPropertySeg2.Mid(intPrevValue);
3194 // Add the data to the General/Home/Work address variables.
3196 ProcessCaptureStrings(&PropertyValue);
3199 coldata.SetId(intValueSeek);
3200 coldata.SetData(intValueSeek);
3201 coldata.SetText(TelNumber);
3205 ListCtrlIndex = lboTelephone->InsertItem(coldata);
3207 lboTelephone->SetItem(ListCtrlIndex, 1, TelTypeUI);
3209 if (intPref > 0 && intPref < 101){
3211 lboTelephone->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
3215 GeneralTelephoneList.erase(intValueSeek);
3216 GeneralTelephoneListType.erase(intValueSeek);
3217 GeneralTelephoneListTokens.erase(intValueSeek);
3218 GeneralTelephoneList.insert(std::make_pair(intValueSeek, TelNumber));
3219 GeneralTelephoneListType.insert(std::make_pair(intValueSeek, TelTypeDetail));
3220 GeneralTelephoneListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
3222 } else if (intType == 1){
3224 ListCtrlIndex = lboHomeTelephone->InsertItem(coldata);
3226 lboHomeTelephone->SetItem(ListCtrlIndex, 1, TelTypeUI);
3228 if (intPref > 0 && intPref < 101){
3230 lboHomeTelephone->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
3234 HomeTelephoneList.erase(intValueSeek);
3235 HomeTelephoneListType.erase(intValueSeek);
3236 HomeTelephoneListTokens.erase(intValueSeek);
3237 HomeTelephoneList.insert(std::make_pair(intValueSeek, TelNumber));
3238 HomeTelephoneListType.insert(std::make_pair(intValueSeek, TelTypeDetail));
3239 HomeTelephoneListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
3241 } else if (intType == 2){
3243 ListCtrlIndex = lboBusinessTelephone->InsertItem(coldata);
3245 lboBusinessTelephone->SetItem(ListCtrlIndex, 1, TelTypeUI);
3247 if (intPref > 0 && intPref < 101){
3249 lboBusinessTelephone->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
3253 BusinessTelephoneList.erase(intValueSeek);
3254 BusinessTelephoneListType.erase(intValueSeek);
3255 BusinessTelephoneListTokens.erase(intValueSeek);
3256 BusinessTelephoneList.insert(std::make_pair(intValueSeek, TelNumber));
3257 BusinessTelephoneListType.insert(std::make_pair(intValueSeek, TelTypeDetail));
3258 BusinessTelephoneListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
3265 } else if (wxSProperty == wxT("LANG")){
3267 int intPropertyLen = wxSPropertySeg1.Len();
3268 std::map<int, int> SplitPoints;
3269 std::map<int, int> SplitLength;
3270 std::map<int, int>::iterator SLiter;
3271 wxString PropertyData;
3272 wxString PropertyName;
3273 wxString PropertyValue;
3274 wxString PropertyTokens;
3275 bool AfterFirstToken = FALSE;
3276 bool FirstToken = TRUE;
3277 int intSplitsFound = 0;
3278 int intSplitSize = 0;
3279 int intPrevValue = 6;
3282 int intSplitSeek = 0;
3285 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
3289 // Look for type before continuing.
3291 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3292 intiter != SplitPoints.end(); ++intiter){
3294 SLiter = SplitLength.find(intiter->first);
3296 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
3298 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3299 PropertyName = PropertyElement.GetNextToken();
3300 PropertyValue = PropertyElement.GetNextToken();
3302 intPrevValue = intiter->second;
3304 if (PropertyName == wxT("TYPE")){
3306 if (PropertyValue == wxT("work")){
3310 } else if (PropertyValue == wxT("home")){
3324 // Setup blank lines for later on.
3328 GeneralLanguageList.insert(std::make_pair(intValueSeek, wxT("")));
3329 GeneralLanguageListAltID.insert(std::make_pair(intValueSeek, wxT("")));
3330 GeneralLanguageListPID.insert(std::make_pair(intValueSeek, wxT("")));
3331 GeneralLanguageListPref.insert(std::make_pair(intValueSeek, 0));
3332 GeneralLanguageListTokens.insert(std::make_pair(intValueSeek, wxT("")));
3334 } else if (intType == 1){
3336 HomeLanguageList.insert(std::make_pair(intValueSeek, wxT("")));
3337 HomeLanguageListAltID.insert(std::make_pair(intValueSeek, wxT("")));
3338 HomeLanguageListPID.insert(std::make_pair(intValueSeek, wxT("")));
3339 HomeLanguageListPref.insert(std::make_pair(intValueSeek, 0));
3340 HomeLanguageListTokens.insert(std::make_pair(intValueSeek, wxT("")));
3342 } else if (intType == 2){
3344 BusinessLanguageList.insert(std::make_pair(intValueSeek, wxT("")));
3345 BusinessLanguageListAltID.insert(std::make_pair(intValueSeek, wxT("")));
3346 BusinessLanguageListPID.insert(std::make_pair(intValueSeek, wxT("")));
3347 BusinessLanguageListPref.insert(std::make_pair(intValueSeek, 0));
3348 BusinessLanguageListTokens.insert(std::make_pair(intValueSeek, wxT("")));
3354 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3355 intiter != SplitPoints.end(); ++intiter){
3357 SLiter = SplitLength.find(intiter->first);
3359 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
3361 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3362 PropertyName = PropertyElement.GetNextToken();
3363 PropertyValue = PropertyElement.GetNextToken();
3365 intPrevValue = intiter->second;
3367 // Process properties.
3369 int intPropertyValueLen = PropertyValue.Len();
3371 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
3373 PropertyValue.Trim();
3374 PropertyValue.RemoveLast();
3378 if (PropertyValue.Mid(0, 1) == wxT("\"")){
3380 PropertyValue.Remove(0, 1);
3384 ProcessCaptureStrings(&PropertyValue);
3386 if (PropertyName == wxT("ALTID")){
3388 if (intType == 0){ GeneralLanguageListAltID.erase(intValueSeek); GeneralLanguageListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
3389 else if (intType == 1){ HomeLanguageListAltID.erase(intValueSeek); HomeLanguageListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
3390 else if (intType == 2){ BusinessLanguageListAltID.erase(intValueSeek); BusinessLanguageListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
3392 } else if (PropertyName == wxT("PID")){
3394 if (intType == 0){ GeneralLanguageListPID.erase(intValueSeek); GeneralLanguageListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
3395 else if (intType == 1){ HomeLanguageListPID.erase(intValueSeek); HomeLanguageListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
3396 else if (intType == 2){ BusinessLanguageListPID.erase(intValueSeek); BusinessLanguageListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
3398 } else if (PropertyName == wxT("PREF")){
3400 intPref = wxAtoi(PropertyValue);
3402 if (intType == 0){ GeneralLanguageListPref.erase(intValueSeek); GeneralLanguageListPref.insert(std::make_pair(intValueSeek, intPref)); }
3403 else if (intType == 1){ HomeLanguageListPref.erase(intValueSeek); HomeLanguageListPref.insert(std::make_pair(intValueSeek, intPref)); }
3404 else if (intType == 2){ BusinessLanguageListPref.erase(intValueSeek); BusinessLanguageListPref.insert(std::make_pair(intValueSeek, intPref)); }
3408 // Something else we don't know about so append
3409 // to the tokens variable.
3411 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
3413 if (FirstToken == TRUE){
3415 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
3420 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
3430 // Add the data to the General/Home/Work address variables.
3432 ProcessCaptureStrings(&wxSPropertySeg2);
3436 coldata.SetId(intValueSeek);
3437 coldata.SetData(intValueSeek);
3438 coldata.SetText(wxSPropertySeg2);
3442 ListCtrlIndex = lboLanguages->InsertItem(coldata);
3444 if (intPref > 0 && intPref < 101){
3446 lboLanguages->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
3450 GeneralLanguageList.erase(intValueSeek);
3451 GeneralLanguageListType.erase(intValueSeek);
3452 GeneralLanguageListTokens.erase(intValueSeek);
3453 GeneralLanguageList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
3454 GeneralLanguageListType.insert(std::make_pair(intValueSeek, wxT("")));
3455 GeneralLanguageListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
3457 } else if (intType == 1){
3459 ListCtrlIndex = lboHomeLanguages->InsertItem(coldata);
3461 if (intPref > 0 && intPref < 101){
3463 lboHomeLanguages->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
3467 HomeLanguageList.erase(intValueSeek);
3468 HomeLanguageListType.erase(intValueSeek);
3469 HomeLanguageListTokens.erase(intValueSeek);
3470 HomeLanguageList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
3471 HomeLanguageListType.insert(std::make_pair(intValueSeek, wxT("home")));
3472 HomeLanguageListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
3474 } else if (intType == 2){
3476 ListCtrlIndex = lboBusinessLanguages->InsertItem(coldata);
3478 if (intPref > 0 && intPref < 101){
3480 lboBusinessLanguages->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
3484 BusinessLanguageList.erase(intValueSeek);
3485 BusinessLanguageListType.erase(intValueSeek);
3486 BusinessLanguageListTokens.erase(intValueSeek);
3487 BusinessLanguageList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
3488 BusinessLanguageListType.insert(std::make_pair(intValueSeek, wxT("work")));
3489 BusinessLanguageListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
3496 } else if (wxSProperty == wxT("GEO")){
3498 int intPropertyLen = wxSPropertySeg1.Len();
3499 std::map<int, int> SplitPoints;
3500 std::map<int, int> SplitLength;
3501 std::map<int, int>::iterator SLiter;
3502 wxString PropertyData;
3503 wxString PropertyName;
3504 wxString PropertyValue;
3505 wxString PropertyTokens;
3508 bool AfterFirstToken = FALSE;
3509 bool FirstToken = TRUE;
3510 int intSplitsFound = 0;
3511 int intSplitSize = 0;
3512 int intPrevValue = 5;
3515 int intSplitSeek = 0;
3518 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
3522 // Look for type before continuing.
3524 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3525 intiter != SplitPoints.end(); ++intiter){
3527 SLiter = SplitLength.find(intiter->first);
3529 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
3531 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3532 PropertyName = PropertyElement.GetNextToken();
3533 PropertyValue = PropertyElement.GetNextToken();
3535 intPrevValue = intiter->second;
3537 if (PropertyName == wxT("TYPE")){
3539 if (PropertyValue == wxT("work")){
3543 } else if (PropertyValue == wxT("home")){
3557 // Setup blank lines for later on.
3561 GeneralGeographyList.insert(std::make_pair(intValueSeek, wxT("")));
3562 GeneralGeographyListAltID.insert(std::make_pair(intValueSeek, wxT("")));
3563 GeneralGeographyListPID.insert(std::make_pair(intValueSeek, wxT("")));
3564 GeneralGeographyListPref.insert(std::make_pair(intValueSeek, 0));
3565 GeneralGeographyListTokens.insert(std::make_pair(intValueSeek, wxT("")));
3567 } else if (intType == 1){
3569 HomeGeographyList.insert(std::make_pair(intValueSeek, wxT("")));
3570 HomeGeographyListAltID.insert(std::make_pair(intValueSeek, wxT("")));
3571 HomeGeographyListPID.insert(std::make_pair(intValueSeek, wxT("")));
3572 HomeGeographyListPref.insert(std::make_pair(intValueSeek, 0));
3573 HomeGeographyListTokens.insert(std::make_pair(intValueSeek, wxT("")));
3575 } else if (intType == 2){
3577 BusinessGeographyList.insert(std::make_pair(intValueSeek, wxT("")));
3578 BusinessGeographyListAltID.insert(std::make_pair(intValueSeek, wxT("")));
3579 BusinessGeographyListPID.insert(std::make_pair(intValueSeek, wxT("")));
3580 BusinessGeographyListPref.insert(std::make_pair(intValueSeek, 0));
3581 BusinessGeographyListTokens.insert(std::make_pair(intValueSeek, wxT("")));
3587 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3588 intiter != SplitPoints.end(); ++intiter){
3590 SLiter = SplitLength.find(intiter->first);
3592 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
3594 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3595 PropertyName = PropertyElement.GetNextToken();
3596 PropertyValue = PropertyElement.GetNextToken();
3598 intPrevValue = intiter->second;
3600 // Process properties.
3602 int intPropertyValueLen = PropertyValue.Len();
3604 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
3606 PropertyValue.Trim();
3607 PropertyValue.RemoveLast();
3611 if (PropertyValue.Mid(0, 1) == wxT("\"")){
3613 PropertyValue.Remove(0, 1);
3617 ProcessCaptureStrings(&PropertyValue);
3619 if (PropertyName == wxT("ALTID")){
3621 if (intType == 0){ GeneralGeographyListAltID.erase(intValueSeek); GeneralGeographyListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
3622 else if (intType == 1){ HomeGeographyListAltID.erase(intValueSeek); HomeGeographyListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
3623 else if (intType == 2){ BusinessGeographyListAltID.erase(intValueSeek); BusinessGeographyListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
3625 } else if (PropertyName == wxT("PID")){
3627 if (intType == 0){ GeneralGeographyListPID.erase(intValueSeek); GeneralGeographyListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
3628 else if (intType == 1){ HomeGeographyListPID.erase(intValueSeek); HomeGeographyListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
3629 else if (intType == 2){ BusinessGeographyListPID.erase(intValueSeek); BusinessGeographyListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
3631 } else if (PropertyName == wxT("MEDIATYPE")){
3633 if (intType == 0){ GeneralGeographyListMediatype.erase(intValueSeek); GeneralGeographyListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
3634 else if (intType == 1){ HomeGeographyListMediatype.erase(intValueSeek); HomeGeographyListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
3635 else if (intType == 2){ BusinessGeographyListMediatype.erase(intValueSeek); BusinessGeographyListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
3637 } else if (PropertyName == wxT("PREF")){
3639 intPref = wxAtoi(PropertyValue);
3641 if (intPref > 0 && intPref < 101){
3643 if (intType == 0){ GeneralGeographyListPref.erase(intValueSeek); GeneralGeographyListPref.insert(std::make_pair(intValueSeek, intPref)); }
3644 else if (intType == 1){ HomeGeographyListPref.erase(intValueSeek); HomeGeographyListPref.insert(std::make_pair(intValueSeek, intPref)); }
3645 else if (intType == 2){ BusinessGeographyListPref.erase(intValueSeek); BusinessGeographyListPref.insert(std::make_pair(intValueSeek, intPref)); }
3651 // Something else we don't know about so append
3652 // to the tokens variable.
3654 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
3656 if (FirstToken == TRUE){
3658 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
3663 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
3673 // Split the address.
3675 //std::map<int, int>::iterator SLiter;
3676 intPropertyLen = wxSPropertySeg2.Len();
3677 SplitPoints.clear();
3678 SplitLength.clear();
3683 for (int i = 0; i <= intPropertyLen; i++){
3687 if (wxSPropertySeg2.Mid(i, 1) == wxT(":") && wxSPropertySeg2.Mid((i - 1), 1) != wxT("\\")){
3690 SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
3692 if (intSplitsFound == 1){
3694 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
3705 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3706 intiter != SplitPoints.end(); ++intiter){
3708 if (intiter->first == 1){
3710 // Deal with PO Box.
3712 SLiter = SplitLength.find(1);
3714 //txtSurname->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(0, SLiter->second), TRUE));
3715 GeoType = wxSPropertySeg2.Mid(0, SLiter->second);
3716 intPrevValue = intiter->second;
3718 GeoData = wxSPropertySeg2.Mid(intPrevValue);
3724 ProcessCaptureStrings(&wxSPropertySeg2);
3728 coldata.SetId(intValueSeek);
3729 coldata.SetData(intValueSeek);
3736 ListCtrlIndex = lboTimezones->InsertItem(coldata);
3738 if (intPref > 0 && intPref < 101){
3740 lboTimezones->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
3746 txtGeopositioning->SetValue(GeoData);
3749 GeneralGeographyList.erase(intValueSeek);
3750 GeneralGeographyListType.erase(intValueSeek);
3751 GeneralGeographyListTokens.erase(intValueSeek);
3752 GeneralGeographyList.insert(std::make_pair(intValueSeek, GeoData));
3753 GeneralGeographyListType.insert(std::make_pair(intValueSeek, wxT("")));
3754 GeneralGeographyListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
3756 CaptureString(&GeoData, FALSE);
3757 coldata.SetText(GeoData);
3758 ListCtrlIndex = lboGeoposition->InsertItem(coldata);
3760 if (intPref > 0 && intPref < 101){
3762 lboGeoposition->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
3766 } else if (intType == 1){
3770 ListCtrlIndex = lboHomeTimezones->InsertItem(coldata);
3772 if (intPref > 0 && intPref < 101){
3774 lboHomeTimezones->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
3781 txtHomeGeopositioning->SetValue(GeoData);
3784 HomeGeographyList.erase(intValueSeek);
3785 HomeGeographyListType.erase(intValueSeek);
3786 HomeGeographyListTokens.erase(intValueSeek);
3787 HomeGeographyList.insert(std::make_pair(intValueSeek, GeoData));
3788 HomeGeographyListType.insert(std::make_pair(intValueSeek, wxT("home")));
3789 HomeGeographyListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
3791 CaptureString(&GeoData, FALSE);
3792 coldata.SetText(GeoData);
3793 ListCtrlIndex = lboHomeGeoposition->InsertItem(coldata);
3795 if (intPref > 0 && intPref < 101){
3797 lboHomeGeoposition->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
3801 } else if (intType == 2){
3803 ListCtrlIndex = lboBusinessGeoposition->InsertItem(coldata);
3807 ListCtrlIndex = lboBusinessTimezones->InsertItem(coldata);
3809 if (intPref > 0 && intPref < 101){
3811 lboBusinessTimezones->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
3818 txtBusinessGeopositioning->SetValue(GeoData);
3821 BusinessGeographyList.erase(intValueSeek);
3822 BusinessGeographyListType.erase(intValueSeek);
3823 BusinessGeographyListTokens.erase(intValueSeek);
3824 BusinessGeographyList.insert(std::make_pair(intValueSeek, GeoData));
3825 BusinessGeographyListType.insert(std::make_pair(intValueSeek, wxT("work")));
3826 BusinessGeographyListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
3828 CaptureString(&GeoData, FALSE);
3829 coldata.SetText(GeoData);
3830 ListCtrlIndex = lboBusinessGeoposition->InsertItem(coldata);
3832 if (intPref > 0 && intPref < 101){
3834 lboBusinessGeoposition->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
3843 } else if (wxSProperty == wxT("RELATED")){
3845 int intPropertyLen = wxSPropertySeg1.Len();
3846 std::map<int, int> SplitPoints;
3847 std::map<int, int> SplitLength;
3848 std::map<int, int>::iterator SLiter;
3849 wxString PropertyData;
3850 wxString PropertyName;
3851 wxString PropertyValue;
3852 wxString PropertyTokens;
3853 wxString RelatedType;
3854 wxString RelatedTypeOriginal;
3855 wxString RelatedName;
3856 bool AfterFirstToken = FALSE;
3857 bool FirstToken = TRUE;
3858 int intSplitsFound = 0;
3859 int intSplitSize = 0;
3860 int intPrevValue = 9;
3863 int intSplitSeek = 0;
3866 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
3870 // Look for type before continuing.
3872 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3873 intiter != SplitPoints.end(); ++intiter){
3875 SLiter = SplitLength.find(intiter->first);
3877 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
3879 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3880 PropertyName = PropertyElement.GetNextToken();
3881 PropertyValue = PropertyElement.GetNextToken();
3883 intPrevValue = intiter->second;
3887 RelatedTypeOriginal = PropertyValue;
3889 if (PropertyName == wxT("TYPE")){
3891 if (PropertyValue == wxT("contact")){
3893 RelatedType = _("Contact");
3895 } else if (PropertyValue == wxT("acquaintance")){
3897 RelatedType = _("Acquaintance");
3899 } else if (PropertyValue == wxT("friend")){
3901 RelatedType = _("Friend");
3903 } else if (PropertyValue == wxT("met")){
3905 RelatedType = _("Met");
3907 } else if (PropertyValue == wxT("co-worker")){
3909 RelatedType = _("Co-worker");
3911 } else if (PropertyValue == wxT("colleague")){
3913 RelatedType = _("Colleague");
3915 } else if (PropertyValue == wxT("co-resident")){
3917 RelatedType = _("Co-resident");
3919 } else if (PropertyValue == wxT("neighbor")){
3921 RelatedType = _("Neighbour");
3923 } else if (PropertyValue == wxT("child")){
3925 RelatedType = _("Child");
3927 } else if (PropertyValue == wxT("parent")){
3929 RelatedType = _("Parent");
3931 } else if (PropertyValue == wxT("sibling")){
3933 RelatedType = _("Sibling");
3935 } else if (PropertyValue == wxT("spouse")){
3937 RelatedType = _("Spouse");
3939 } else if (PropertyValue == wxT("kin")){
3941 RelatedType = _("Kin");
3943 } else if (PropertyValue == wxT("muse")){
3945 RelatedType = _("Muse");
3947 } else if (PropertyValue == wxT("crush")){
3949 RelatedType = _("Crush");
3951 } else if (PropertyValue == wxT("date")){
3953 RelatedType = _("Date");
3955 } else if (PropertyValue == wxT("sweetheart")){
3957 RelatedType = _("Sweetheart");
3959 } else if (PropertyValue == wxT("me")){
3961 RelatedType = _("Me");
3963 } else if (PropertyValue == wxT("agent")){
3965 RelatedType = _("Agent");
3967 } else if (PropertyValue == wxT("emergency")){
3969 RelatedType = _("Emergency");
3973 RelatedType = PropertyValue;
3983 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3984 intiter != SplitPoints.end(); ++intiter){
3986 SLiter = SplitLength.find(intiter->first);
3988 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
3990 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3991 PropertyName = PropertyElement.GetNextToken();
3992 PropertyValue = PropertyElement.GetNextToken();
3994 intPrevValue = intiter->second;
3996 // Process properties.
3998 int intPropertyValueLen = PropertyValue.Len();
4000 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
4002 PropertyValue.Trim();
4003 PropertyValue.RemoveLast();
4007 if (PropertyValue.Mid(0, 1) == wxT("\"")){
4009 PropertyValue.Remove(0, 1);
4013 ProcessCaptureStrings(&PropertyValue);
4015 if (PropertyName == wxT("ALTID")){
4017 GeneralRelatedListAltID.erase(intValueSeek);
4018 GeneralRelatedListAltID.insert(std::make_pair(intValueSeek, PropertyValue));
4020 } else if (PropertyName == wxT("PID")){
4022 GeneralRelatedListPID.erase(intValueSeek);
4023 GeneralRelatedListPID.insert(std::make_pair(intValueSeek, PropertyValue));
4025 } else if (PropertyName == wxT("PREF")){
4027 intPref = wxAtoi(PropertyValue);
4029 if (intPref > 0 && intPref < 101){
4031 GeneralRelatedListPref.erase(intValueSeek);
4032 GeneralRelatedListPref.insert(std::make_pair(intValueSeek, intPref));
4037 } else if (PropertyName == wxT("LANGUAGE")){
4039 GeneralRelatedListLanguage.erase(intValueSeek);
4040 GeneralRelatedListLanguage.insert(std::make_pair(intValueSeek, PropertyValue));
4044 // Something else we don't know about so append
4045 // to the tokens variable.
4047 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
4049 if (FirstToken == TRUE){
4051 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
4056 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
4066 // Split the address.
4068 //std::map<int, int>::iterator SLiter;
4069 intPropertyLen = wxSPropertySeg2.Len();
4070 SplitPoints.clear();
4071 SplitLength.clear();
4076 // Add the data to the General/Home/Work address variables.
4080 coldata.SetId(intValueSeek);
4081 coldata.SetData(intValueSeek);
4082 coldata.SetText(RelatedType);
4084 ProcessCaptureStrings(&wxSPropertySeg2);
4086 ListCtrlIndex = lboRelated->InsertItem(coldata);
4088 lboRelated->SetItem(ListCtrlIndex, 1, wxSPropertySeg2);
4090 if (intPref > 0 && intPref < 101){
4092 lboRelated->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
4096 GeneralRelatedList.erase(intValueSeek);
4097 GeneralRelatedListRelType.erase(intValueSeek);
4098 GeneralRelatedListType.erase(intValueSeek);
4099 GeneralRelatedListTokens.erase(intValueSeek);
4100 GeneralRelatedList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
4101 GeneralRelatedListRelType.insert(std::make_pair(intValueSeek, RelatedTypeOriginal));
4102 GeneralRelatedListType.insert(std::make_pair(intValueSeek, RelatedTypeOriginal));
4103 GeneralRelatedListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
4108 } else if (wxSProperty == wxT("URL")){
4110 int intPropertyLen = wxSPropertySeg1.Len();
4111 std::map<int, int> SplitPoints;
4112 std::map<int, int> SplitLength;
4113 std::map<int, int>::iterator SLiter;
4114 wxString PropertyData;
4115 wxString PropertyName;
4116 wxString PropertyValue;
4117 wxString PropertyTokens;
4118 bool AfterFirstToken = FALSE;
4119 bool FirstToken = TRUE;
4120 int intSplitsFound = 0;
4121 int intSplitSize = 0;
4122 int intPrevValue = 5;
4125 int intSplitSeek = 0;
4128 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
4132 // Look for type before continuing.
4134 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4135 intiter != SplitPoints.end(); ++intiter){
4137 SLiter = SplitLength.find(intiter->first);
4139 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
4141 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4142 PropertyName = PropertyElement.GetNextToken();
4143 PropertyValue = PropertyElement.GetNextToken();
4145 intPrevValue = intiter->second;
4147 if (PropertyName == wxT("TYPE")){
4149 if (PropertyValue == wxT("work")){
4153 } else if (PropertyValue == wxT("home")){
4167 // Setup blank lines for later on.
4171 GeneralWebsiteList.insert(std::make_pair(intValueSeek, wxT("")));
4172 GeneralWebsiteListAltID.insert(std::make_pair(intValueSeek, wxT("")));
4173 GeneralWebsiteListPID.insert(std::make_pair(intValueSeek, wxT("")));
4174 GeneralWebsiteListPref.insert(std::make_pair(intValueSeek, 0));
4175 GeneralWebsiteListTokens.insert(std::make_pair(intValueSeek, wxT("")));
4177 } else if (intType == 1){
4179 HomeWebsiteList.insert(std::make_pair(intValueSeek, wxT("")));
4180 HomeWebsiteListAltID.insert(std::make_pair(intValueSeek, wxT("")));
4181 HomeWebsiteListPID.insert(std::make_pair(intValueSeek, wxT("")));
4182 HomeWebsiteListPref.insert(std::make_pair(intValueSeek, 0));
4183 HomeWebsiteListTokens.insert(std::make_pair(intValueSeek, wxT("")));
4185 } else if (intType == 2){
4187 BusinessWebsiteList.insert(std::make_pair(intValueSeek, wxT("")));
4188 BusinessWebsiteListAltID.insert(std::make_pair(intValueSeek, wxT("")));
4189 BusinessWebsiteListPID.insert(std::make_pair(intValueSeek, wxT("")));
4190 BusinessWebsiteListPref.insert(std::make_pair(intValueSeek, 0));
4191 BusinessWebsiteListTokens.insert(std::make_pair(intValueSeek, wxT("")));
4197 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4198 intiter != SplitPoints.end(); ++intiter){
4200 SLiter = SplitLength.find(intiter->first);
4202 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
4204 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4205 PropertyName = PropertyElement.GetNextToken();
4206 PropertyValue = PropertyElement.GetNextToken();
4208 intPrevValue = intiter->second;
4210 // Process properties.
4212 int intPropertyValueLen = PropertyValue.Len();
4214 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
4216 PropertyValue.Trim();
4217 PropertyValue.RemoveLast();
4221 if (PropertyValue.Mid(0, 1) == wxT("\"")){
4223 PropertyValue.Remove(0, 1);
4227 ProcessCaptureStrings(&PropertyValue);
4229 if (PropertyName == wxT("ALTID")){
4231 if (intType == 0){ GeneralWebsiteListAltID.erase(intValueSeek); GeneralWebsiteListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4232 else if (intType == 1){ HomeWebsiteListAltID.erase(intValueSeek); HomeWebsiteListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4233 else if (intType == 2){ BusinessWebsiteListAltID.erase(intValueSeek); BusinessWebsiteListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4235 } else if (PropertyName == wxT("PID")){
4237 if (intType == 0){ GeneralWebsiteListPID.erase(intValueSeek); GeneralWebsiteListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4238 else if (intType == 1){ HomeWebsiteListPID.erase(intValueSeek); HomeWebsiteListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4239 else if (intType == 2){ BusinessWebsiteListPID.erase(intValueSeek); BusinessWebsiteListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4241 } else if (PropertyName == wxT("PREF")){
4243 intPref = wxAtoi(PropertyValue);
4245 if (intType == 0){ GeneralWebsiteListPref.erase(intValueSeek); GeneralWebsiteListPref.insert(std::make_pair(intValueSeek, intPref)); }
4246 else if (intType == 1){ HomeWebsiteListPref.erase(intValueSeek); HomeWebsiteListPref.insert(std::make_pair(intValueSeek, intPref)); }
4247 else if (intType == 2){ BusinessWebsiteListPref.erase(intValueSeek); BusinessWebsiteListPref.insert(std::make_pair(intValueSeek, intPref)); }
4249 } else if (PropertyName == wxT("MEDIATYPE")){
4251 if (intType == 0){ GeneralWebsiteListMediatype.erase(intValueSeek); GeneralWebsiteListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
4252 else if (intType == 1){ HomeWebsiteListMediatype.erase(intValueSeek); HomeWebsiteListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
4253 else if (intType == 2){ BusinessWebsiteListMediatype.erase(intValueSeek); BusinessWebsiteListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
4257 // Something else we don't know about so append
4258 // to the tokens variable.
4260 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
4262 if (FirstToken == TRUE){
4264 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
4269 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
4279 // Add the data to the General/Home/Work address variables.
4281 ProcessCaptureStrings(&wxSPropertySeg2);
4285 coldata.SetId(intValueSeek);
4286 coldata.SetData(intValueSeek);
4287 coldata.SetText(wxSPropertySeg2);
4291 ListCtrlIndex = lboWebsites->InsertItem(coldata);
4293 if (intPref > 0 && intPref < 101){
4295 lboWebsites->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
4299 GeneralWebsiteList.erase(intValueSeek);
4300 GeneralWebsiteListType.erase(intValueSeek);
4301 GeneralWebsiteListTokens.erase(intValueSeek);
4302 GeneralWebsiteList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
4303 GeneralWebsiteListType.insert(std::make_pair(intValueSeek, wxT("")));
4304 GeneralWebsiteListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
4306 } else if (intType == 1){
4308 ListCtrlIndex = lboHomeWebsites->InsertItem(coldata);
4310 if (intPref > 0 && intPref < 101){
4312 lboHomeWebsites->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
4316 HomeWebsiteList.erase(intValueSeek);
4317 HomeWebsiteListType.erase(intValueSeek);
4318 HomeWebsiteListTokens.erase(intValueSeek);
4319 HomeWebsiteList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
4320 HomeWebsiteListType.insert(std::make_pair(intValueSeek, wxT("home")));
4321 HomeWebsiteListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
4323 } else if (intType == 2){
4325 ListCtrlIndex = lboBusinessWebsites->InsertItem(coldata);
4327 if (intPref > 0 && intPref < 101){
4329 lboBusinessWebsites->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
4333 BusinessWebsiteList.erase(intValueSeek);
4334 BusinessWebsiteListType.erase(intValueSeek);
4335 BusinessWebsiteListTokens.erase(intValueSeek);
4336 BusinessWebsiteList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
4337 BusinessWebsiteListType.insert(std::make_pair(intValueSeek, wxT("work")));
4338 BusinessWebsiteListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
4345 } else if (wxSProperty == wxT("TITLE")) {
4347 int intPropertyLen = wxSPropertySeg1.Len();
4348 std::map<int, int> SplitPoints;
4349 std::map<int, int> SplitLength;
4350 std::map<int, int>::iterator SLiter;
4351 wxString PropertyData;
4352 wxString PropertyName;
4353 wxString PropertyValue;
4354 wxString PropertyTokens;
4355 bool AfterFirstToken = FALSE;
4356 bool FirstToken = TRUE;
4357 int intSplitsFound = 0;
4358 int intSplitSize = 0;
4359 int intPrevValue = 7;
4362 int intSplitSeek = 0;
4365 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
4369 // Look for type before continuing.
4371 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4372 intiter != SplitPoints.end(); ++intiter){
4374 SLiter = SplitLength.find(intiter->first);
4376 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
4378 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4379 PropertyName = PropertyElement.GetNextToken();
4380 PropertyValue = PropertyElement.GetNextToken();
4382 intPrevValue = intiter->second;
4384 if (PropertyName == wxT("TYPE")){
4386 if (PropertyValue == wxT("work")){
4390 } else if (PropertyValue == wxT("home")){
4404 // Setup blank lines for later on.
4408 GeneralTitleList.insert(std::make_pair(intValueSeek, wxT("")));
4409 GeneralTitleListAltID.insert(std::make_pair(intValueSeek, wxT("")));
4410 GeneralTitleListPID.insert(std::make_pair(intValueSeek, wxT("")));
4411 GeneralTitleListPref.insert(std::make_pair(intValueSeek, 0));
4412 GeneralTitleListTokens.insert(std::make_pair(intValueSeek, wxT("")));
4413 GeneralTitleListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
4415 } else if (intType == 1){
4417 HomeTitleList.insert(std::make_pair(intValueSeek, wxT("")));
4418 HomeTitleListAltID.insert(std::make_pair(intValueSeek, wxT("")));
4419 HomeTitleListPID.insert(std::make_pair(intValueSeek, wxT("")));
4420 HomeTitleListPref.insert(std::make_pair(intValueSeek, 0));
4421 HomeTitleListTokens.insert(std::make_pair(intValueSeek, wxT("")));
4422 HomeTitleListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
4424 } else if (intType == 2){
4426 BusinessTitleList.insert(std::make_pair(intValueSeek, wxT("")));
4427 BusinessTitleListAltID.insert(std::make_pair(intValueSeek, wxT("")));
4428 BusinessTitleListPID.insert(std::make_pair(intValueSeek, wxT("")));
4429 BusinessTitleListPref.insert(std::make_pair(intValueSeek, 0));
4430 BusinessTitleListTokens.insert(std::make_pair(intValueSeek, wxT("")));
4431 BusinessTitleListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
4437 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4438 intiter != SplitPoints.end(); ++intiter){
4440 SLiter = SplitLength.find(intiter->first);
4442 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
4444 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4445 PropertyName = PropertyElement.GetNextToken();
4446 PropertyValue = PropertyElement.GetNextToken();
4448 intPrevValue = intiter->second;
4450 // Process properties.
4452 int intPropertyValueLen = PropertyValue.Len();
4454 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
4456 PropertyValue.Trim();
4457 PropertyValue.RemoveLast();
4461 if (PropertyValue.Mid(0, 1) == wxT("\"")){
4463 PropertyValue.Remove(0, 1);
4467 ProcessCaptureStrings(&PropertyValue);
4469 if (PropertyName == wxT("ALTID")){
4471 if (intType == 0){ GeneralTitleListAltID.erase(intValueSeek); GeneralTitleListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4472 else if (intType == 1){ HomeTitleListAltID.erase(intValueSeek); HomeTitleListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4473 else if (intType == 2){ BusinessTitleListAltID.erase(intValueSeek); BusinessTitleListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4475 } else if (PropertyName == wxT("PID")){
4477 if (intType == 0){ GeneralTitleListPID.erase(intValueSeek); GeneralTitleListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4478 else if (intType == 1){ HomeTitleListPID.erase(intValueSeek); HomeTitleListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4479 else if (intType == 2){ BusinessTitleListPID.erase(intValueSeek); BusinessTitleListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4481 } else if (PropertyName == wxT("PREF")){
4483 intPref = wxAtoi(PropertyValue);
4485 if (intType == 0){ GeneralTitleListPref.erase(intValueSeek); GeneralTitleListPref.insert(std::make_pair(intValueSeek, intPref)); }
4486 else if (intType == 1){ HomeTitleListPref.erase(intValueSeek); HomeTitleListPref.insert(std::make_pair(intValueSeek, intPref)); }
4487 else if (intType == 2){ BusinessTitleListPref.erase(intValueSeek); BusinessTitleListPref.insert(std::make_pair(intValueSeek, intPref)); }
4489 } else if (PropertyName == wxT("LANGUAGE")){
4491 if (intType == 0){ GeneralTitleListLanguage.erase(intValueSeek); GeneralTitleListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
4492 else if (intType == 1){ HomeTitleListLanguage.erase(intValueSeek); HomeTitleListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
4493 else if (intType == 2){ BusinessTitleListLanguage.erase(intValueSeek); BusinessTitleListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
4497 // Something else we don't know about so append
4498 // to the tokens variable.
4500 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
4502 if (FirstToken == TRUE){
4504 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
4509 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
4519 // Add the data to the General/Home/Work address variables.
4521 ProcessCaptureStrings(&wxSPropertySeg2);
4525 coldata.SetId(intValueSeek);
4526 coldata.SetData(intValueSeek);
4527 coldata.SetText(wxSPropertySeg2);
4531 ListCtrlIndex = lboTitles->InsertItem(coldata);
4533 if (intPref > 0 && intPref < 101){
4535 lboTitles->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
4539 GeneralTitleList.erase(intValueSeek);
4540 GeneralTitleListType.erase(intValueSeek);
4541 GeneralTitleListTokens.erase(intValueSeek);
4542 GeneralTitleList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
4543 GeneralTitleListType.insert(std::make_pair(intValueSeek, wxT("")));
4544 GeneralTitleListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
4546 } else if (intType == 1){
4548 ListCtrlIndex = lboHomeTitles->InsertItem(coldata);
4550 if (intPref > 0 && intPref < 101){
4552 lboHomeTitles->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
4556 HomeTitleList.erase(intValueSeek);
4557 HomeTitleListType.erase(intValueSeek);
4558 HomeTitleListTokens.erase(intValueSeek);
4559 HomeTitleList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
4560 HomeTitleListType.insert(std::make_pair(intValueSeek, wxT("home")));
4561 HomeTitleListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
4563 } else if (intType == 2){
4565 ListCtrlIndex = lboBusinessTitles->InsertItem(coldata);
4567 if (intPref > 0 && intPref < 101){
4569 lboBusinessTitles->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
4573 BusinessTitleList.erase(intValueSeek);
4574 BusinessTitleListType.erase(intValueSeek);
4575 BusinessTitleListTokens.erase(intValueSeek);
4576 BusinessTitleList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
4577 BusinessTitleListType.insert(std::make_pair(intValueSeek, wxT("work")));
4578 BusinessTitleListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
4585 } else if (wxSProperty == wxT("ROLE")) {
4587 int intPropertyLen = wxSPropertySeg1.Len();
4588 std::map<int, int> SplitPoints;
4589 std::map<int, int> SplitLength;
4590 std::map<int, int>::iterator SLiter;
4591 wxString PropertyData;
4592 wxString PropertyName;
4593 wxString PropertyValue;
4594 wxString PropertyTokens;
4595 bool AfterFirstToken = FALSE;
4596 bool FirstToken = TRUE;
4597 int intSplitsFound = 0;
4598 int intSplitSize = 0;
4599 int intPrevValue = 6;
4602 int intSplitSeek = 0;
4605 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
4609 // Look for type before continuing.
4611 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4612 intiter != SplitPoints.end(); ++intiter){
4614 SLiter = SplitLength.find(intiter->first);
4616 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
4618 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4619 PropertyName = PropertyElement.GetNextToken();
4620 PropertyValue = PropertyElement.GetNextToken();
4622 intPrevValue = intiter->second;
4624 if (PropertyName == wxT("TYPE")){
4626 if (PropertyValue == wxT("work")){
4630 } else if (PropertyValue == wxT("home")){
4644 // Setup blank lines for later on.
4648 GeneralRoleList.insert(std::make_pair(intValueSeek, wxT("")));
4649 GeneralRoleListAltID.insert(std::make_pair(intValueSeek, wxT("")));
4650 GeneralRoleListPID.insert(std::make_pair(intValueSeek, wxT("")));
4651 GeneralRoleListPref.insert(std::make_pair(intValueSeek, 0));
4652 GeneralRoleListTokens.insert(std::make_pair(intValueSeek, wxT("")));
4653 GeneralRoleListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
4655 } else if (intType == 1){
4657 HomeRoleList.insert(std::make_pair(intValueSeek, wxT("")));
4658 HomeRoleListAltID.insert(std::make_pair(intValueSeek, wxT("")));
4659 HomeRoleListPID.insert(std::make_pair(intValueSeek, wxT("")));
4660 HomeRoleListPref.insert(std::make_pair(intValueSeek, 0));
4661 HomeRoleListTokens.insert(std::make_pair(intValueSeek, wxT("")));
4662 HomeRoleListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
4664 } else if (intType == 2){
4666 BusinessRoleList.insert(std::make_pair(intValueSeek, wxT("")));
4667 BusinessRoleListAltID.insert(std::make_pair(intValueSeek, wxT("")));
4668 BusinessRoleListPID.insert(std::make_pair(intValueSeek, wxT("")));
4669 BusinessRoleListPref.insert(std::make_pair(intValueSeek, 0));
4670 BusinessRoleListTokens.insert(std::make_pair(intValueSeek, wxT("")));
4671 BusinessRoleListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
4677 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4678 intiter != SplitPoints.end(); ++intiter){
4680 SLiter = SplitLength.find(intiter->first);
4682 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
4684 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4685 PropertyName = PropertyElement.GetNextToken();
4686 PropertyValue = PropertyElement.GetNextToken();
4688 intPrevValue = intiter->second;
4690 // Process properties.
4692 int intPropertyValueLen = PropertyValue.Len();
4694 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
4696 PropertyValue.Trim();
4697 PropertyValue.RemoveLast();
4701 if (PropertyValue.Mid(0, 1) == wxT("\"")){
4703 PropertyValue.Remove(0, 1);
4707 ProcessCaptureStrings(&PropertyValue);
4709 if (PropertyName == wxT("ALTID")){
4711 if (intType == 0){ GeneralRoleListAltID.erase(intValueSeek); GeneralRoleListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4712 else if (intType == 1){ HomeRoleListAltID.erase(intValueSeek); HomeRoleListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4713 else if (intType == 2){ BusinessRoleListAltID.erase(intValueSeek); BusinessRoleListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4715 } else if (PropertyName == wxT("PID")){
4717 if (intType == 0){ GeneralRoleListPID.erase(intValueSeek); GeneralRoleListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4718 else if (intType == 1){ HomeRoleListPID.erase(intValueSeek); HomeRoleListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4719 else if (intType == 2){ BusinessRoleListPID.erase(intValueSeek); BusinessRoleListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4721 } else if (PropertyName == wxT("PREF")){
4723 intPref = wxAtoi(PropertyValue);
4725 if (intType == 0){ GeneralRoleListPref.erase(intValueSeek); GeneralRoleListPref.insert(std::make_pair(intValueSeek, intPref)); }
4726 else if (intType == 1){ HomeRoleListPref.erase(intValueSeek); HomeRoleListPref.insert(std::make_pair(intValueSeek, intPref)); }
4727 else if (intType == 2){ BusinessRoleListPref.erase(intValueSeek); BusinessRoleListPref.insert(std::make_pair(intValueSeek, intPref)); }
4729 } else if (PropertyName == wxT("LANGUAGE")){
4731 if (intType == 0){ GeneralRoleListLanguage.erase(intValueSeek); GeneralRoleListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
4732 else if (intType == 1){ HomeRoleListLanguage.erase(intValueSeek); HomeRoleListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
4733 else if (intType == 2){ BusinessRoleListLanguage.erase(intValueSeek); BusinessRoleListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
4737 // Something else we don't know about so append
4738 // to the tokens variable.
4740 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
4742 if (FirstToken == TRUE){
4744 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
4749 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
4759 // Add the data to the General/Home/Work address variables.
4761 ProcessCaptureStrings(&wxSPropertySeg2);
4765 coldata.SetId(intValueSeek);
4766 coldata.SetData(intValueSeek);
4767 coldata.SetText(wxSPropertySeg2);
4771 ListCtrlIndex = lboRoles->InsertItem(coldata);
4773 if (intPref > 0 && intPref < 101){
4775 lboRoles->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
4779 GeneralRoleList.erase(intValueSeek);
4780 GeneralRoleListType.erase(intValueSeek);
4781 GeneralRoleListTokens.erase(intValueSeek);
4782 GeneralRoleList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
4783 GeneralRoleListType.insert(std::make_pair(intValueSeek, wxT("")));
4784 GeneralRoleListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
4786 } else if (intType == 1){
4788 ListCtrlIndex = lboHomeRoles->InsertItem(coldata);
4790 if (intPref > 0 && intPref < 101){
4792 lboHomeRoles->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
4796 HomeRoleList.erase(intValueSeek);
4797 HomeRoleListType.erase(intValueSeek);
4798 HomeRoleListTokens.erase(intValueSeek);
4799 HomeRoleList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
4800 HomeRoleListType.insert(std::make_pair(intValueSeek, wxT("home")));
4801 HomeRoleListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
4803 } else if (intType == 2){
4805 ListCtrlIndex = lboBusinessRoles->InsertItem(coldata);
4807 if (intPref > 0 && intPref < 101){
4809 lboBusinessRoles->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
4813 BusinessRoleList.erase(intValueSeek);
4814 BusinessRoleListType.erase(intValueSeek);
4815 BusinessRoleListTokens.erase(intValueSeek);
4816 BusinessRoleList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
4817 BusinessRoleListType.insert(std::make_pair(intValueSeek, wxT("work")));
4818 BusinessRoleListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
4825 } else if (wxSProperty == wxT("ORG")) {
4827 int intPropertyLen = wxSPropertySeg1.Len();
4828 std::map<int, int> SplitPoints;
4829 std::map<int, int> SplitLength;
4830 std::map<int, int>::iterator SLiter;
4831 wxString PropertyData;
4832 wxString PropertyName;
4833 wxString PropertyValue;
4834 wxString PropertyTokens;
4835 bool AfterFirstToken = FALSE;
4836 bool FirstToken = TRUE;
4837 int intSplitsFound = 0;
4838 int intSplitSize = 0;
4839 int intPrevValue = 5;
4842 int intSplitSeek = 0;
4845 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
4849 // Look for type before continuing.
4851 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4852 intiter != SplitPoints.end(); ++intiter){
4854 SLiter = SplitLength.find(intiter->first);
4856 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
4858 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4859 PropertyName = PropertyElement.GetNextToken();
4860 PropertyValue = PropertyElement.GetNextToken();
4862 intPrevValue = intiter->second;
4864 if (PropertyName == wxT("TYPE")){
4866 if (PropertyValue == wxT("work")){
4870 } else if (PropertyValue == wxT("home")){
4884 // Setup blank lines for later on.
4888 GeneralOrganisationsList.insert(std::make_pair(intValueSeek, wxT("")));
4889 GeneralOrganisationsListAltID.insert(std::make_pair(intValueSeek, wxT("")));
4890 GeneralOrganisationsListPID.insert(std::make_pair(intValueSeek, wxT("")));
4891 GeneralOrganisationsListPref.insert(std::make_pair(intValueSeek, 0));
4892 GeneralOrganisationsListTokens.insert(std::make_pair(intValueSeek, wxT("")));
4893 GeneralOrganisationsListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
4894 GeneralOrganisationsListSortAs.insert(std::make_pair(intValueSeek, wxT("")));
4896 } else if (intType == 1){
4898 HomeOrganisationsList.insert(std::make_pair(intValueSeek, wxT("")));
4899 HomeOrganisationsListAltID.insert(std::make_pair(intValueSeek, wxT("")));
4900 HomeOrganisationsListPID.insert(std::make_pair(intValueSeek, wxT("")));
4901 HomeOrganisationsListPref.insert(std::make_pair(intValueSeek, 0));
4902 HomeOrganisationsListTokens.insert(std::make_pair(intValueSeek, wxT("")));
4903 HomeOrganisationsListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
4904 HomeOrganisationsListSortAs.insert(std::make_pair(intValueSeek, wxT("")));
4906 } else if (intType == 2){
4908 BusinessOrganisationsList.insert(std::make_pair(intValueSeek, wxT("")));
4909 BusinessOrganisationsListAltID.insert(std::make_pair(intValueSeek, wxT("")));
4910 BusinessOrganisationsListPID.insert(std::make_pair(intValueSeek, wxT("")));
4911 BusinessOrganisationsListPref.insert(std::make_pair(intValueSeek, 0));
4912 BusinessOrganisationsListTokens.insert(std::make_pair(intValueSeek, wxT("")));
4913 BusinessOrganisationsListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
4914 BusinessOrganisationsListSortAs.insert(std::make_pair(intValueSeek, wxT("")));
4920 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4921 intiter != SplitPoints.end(); ++intiter){
4923 SLiter = SplitLength.find(intiter->first);
4925 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
4927 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4928 PropertyName = PropertyElement.GetNextToken();
4929 PropertyValue = PropertyElement.GetNextToken();
4931 intPrevValue = intiter->second;
4933 // Process properties.
4935 int intPropertyValueLen = PropertyValue.Len();
4937 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
4939 PropertyValue.Trim();
4940 PropertyValue.RemoveLast();
4944 if (PropertyValue.Mid(0, 1) == wxT("\"")){
4946 PropertyValue.Remove(0, 1);
4950 ProcessCaptureStrings(&PropertyValue);
4952 if (PropertyName == wxT("ALTID")){
4954 if (intType == 0){ GeneralOrganisationsListAltID.erase(intValueSeek); GeneralOrganisationsListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4955 else if (intType == 1){ HomeOrganisationsListAltID.erase(intValueSeek); HomeOrganisationsListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4956 else if (intType == 2){ BusinessOrganisationsListAltID.erase(intValueSeek); BusinessOrganisationsListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4958 } else if (PropertyName == wxT("PID")){
4960 if (intType == 0){ GeneralOrganisationsListPID.erase(intValueSeek); GeneralOrganisationsListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4961 else if (intType == 1){ HomeOrganisationsListPID.erase(intValueSeek); HomeOrganisationsListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4962 else if (intType == 2){ BusinessOrganisationsListPID.erase(intValueSeek); BusinessOrganisationsListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
4964 } else if (PropertyName == wxT("PREF")){
4966 intPref = wxAtoi(PropertyValue);
4968 if (intType == 0){ GeneralOrganisationsListPref.erase(intValueSeek); GeneralOrganisationsListPref.insert(std::make_pair(intValueSeek, intPref)); }
4969 else if (intType == 1){ HomeOrganisationsListPref.erase(intValueSeek); HomeOrganisationsListPref.insert(std::make_pair(intValueSeek, intPref)); }
4970 else if (intType == 2){ BusinessOrganisationsListPref.erase(intValueSeek); BusinessOrganisationsListPref.insert(std::make_pair(intValueSeek, intPref)); }
4972 } else if (PropertyName == wxT("LANGUAGE")){
4974 if (intType == 0){ GeneralOrganisationsListLanguage.erase(intValueSeek); GeneralOrganisationsListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
4975 else if (intType == 1){ HomeOrganisationsListLanguage.erase(intValueSeek); HomeOrganisationsListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
4976 else if (intType == 2){ BusinessOrganisationsListLanguage.erase(intValueSeek); BusinessOrganisationsListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
4978 } else if (PropertyName == wxT("SORT-AS")){
4980 if (intType == 0){ GeneralOrganisationsListSortAs.erase(intValueSeek); GeneralOrganisationsListSortAs.insert(std::make_pair(intValueSeek, PropertyValue)); }
4981 else if (intType == 1){ HomeOrganisationsListSortAs.erase(intValueSeek); HomeOrganisationsListSortAs.insert(std::make_pair(intValueSeek, PropertyValue)); }
4982 else if (intType == 2){ BusinessOrganisationsListSortAs.erase(intValueSeek); BusinessOrganisationsListSortAs.insert(std::make_pair(intValueSeek, PropertyValue)); }
4986 // Something else we don't know about so append
4987 // to the tokens variable.
4989 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
4991 if (FirstToken == TRUE){
4993 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
4998 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
5008 // Add the data to the General/Home/Work address variables.
5012 ProcessCaptureStrings(&wxSPropertySeg2);
5014 coldata.SetId(intValueSeek);
5015 coldata.SetData(intValueSeek);
5016 coldata.SetText(wxSPropertySeg2);
5020 ListCtrlIndex = lboOrganisations->InsertItem(coldata);
5022 if (intPref > 0 && intPref < 101){
5024 lboOrganisations->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
5028 GeneralOrganisationsList.erase(intValueSeek);
5029 GeneralOrganisationsListType.erase(intValueSeek);
5030 GeneralOrganisationsListTokens.erase(intValueSeek);
5031 GeneralOrganisationsList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
5032 GeneralOrganisationsListType.insert(std::make_pair(intValueSeek, wxT("")));
5033 GeneralOrganisationsListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
5035 } else if (intType == 1){
5037 ListCtrlIndex = lboHomeOrganisations->InsertItem(coldata);
5039 if (intPref > 0 && intPref < 101){
5041 lboHomeOrganisations->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
5045 HomeOrganisationsList.erase(intValueSeek);
5046 HomeOrganisationsListType.erase(intValueSeek);
5047 HomeOrganisationsListTokens.erase(intValueSeek);
5048 HomeOrganisationsList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
5049 HomeOrganisationsListType.insert(std::make_pair(intValueSeek, wxT("home")));
5050 HomeOrganisationsListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
5052 } else if (intType == 2){
5054 ListCtrlIndex = lboBusinessOrganisations->InsertItem(coldata);
5056 if (intPref > 0 && intPref < 101){
5058 lboBusinessOrganisations->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
5062 BusinessOrganisationsList.erase(intValueSeek);
5063 BusinessOrganisationsListType.erase(intValueSeek);
5064 BusinessOrganisationsListTokens.erase(intValueSeek);
5065 BusinessOrganisationsList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
5066 BusinessOrganisationsListType.insert(std::make_pair(intValueSeek, wxT("work")));
5067 BusinessOrganisationsListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
5074 } else if (wxSProperty == wxT("NOTE")) {
5076 int intPropertyLen = wxSPropertySeg1.Len();
5077 std::map<int, int> SplitPoints;
5078 std::map<int, int> SplitLength;
5079 std::map<int, int>::iterator SLiter;
5080 wxString PropertyData;
5081 wxString PropertyName;
5082 wxString PropertyValue;
5083 wxString PropertyTokens;
5084 bool AfterFirstToken = FALSE;
5085 bool FirstToken = TRUE;
5086 int intSplitsFound = 0;
5087 int intSplitSize = 0;
5088 int intPrevValue = 6;
5091 int intSplitSeek = 0;
5094 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
5098 // Look for type before continuing.
5100 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5101 intiter != SplitPoints.end(); ++intiter){
5103 SLiter = SplitLength.find(intiter->first);
5105 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
5107 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5108 PropertyName = PropertyElement.GetNextToken();
5109 PropertyValue = PropertyElement.GetNextToken();
5111 intPrevValue = intiter->second;
5113 if (PropertyName == wxT("TYPE")){
5115 if (PropertyValue == wxT("work")){
5119 } else if (PropertyValue == wxT("home")){
5133 // Setup blank lines for later on.
5137 GeneralNoteList.insert(std::make_pair(intValueSeek, wxT("")));
5138 GeneralNoteListAltID.insert(std::make_pair(intValueSeek, wxT("")));
5139 GeneralNoteListPID.insert(std::make_pair(intValueSeek, wxT("")));
5140 GeneralNoteListPref.insert(std::make_pair(intValueSeek, 0));
5141 GeneralNoteListTokens.insert(std::make_pair(intValueSeek, wxT("")));
5142 GeneralNoteListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
5144 } else if (intType == 1){
5146 HomeNoteList.insert(std::make_pair(intValueSeek, wxT("")));
5147 HomeNoteListAltID.insert(std::make_pair(intValueSeek, wxT("")));
5148 HomeNoteListPID.insert(std::make_pair(intValueSeek, wxT("")));
5149 HomeNoteListPref.insert(std::make_pair(intValueSeek, 0));
5150 HomeNoteListTokens.insert(std::make_pair(intValueSeek, wxT("")));
5151 HomeNoteListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
5153 } else if (intType == 2){
5155 BusinessNoteList.insert(std::make_pair(intValueSeek, wxT("")));
5156 BusinessNoteListAltID.insert(std::make_pair(intValueSeek, wxT("")));
5157 BusinessNoteListPID.insert(std::make_pair(intValueSeek, wxT("")));
5158 BusinessNoteListPref.insert(std::make_pair(intValueSeek, 0));
5159 BusinessNoteListTokens.insert(std::make_pair(intValueSeek, wxT("")));
5160 BusinessNoteListLanguage.insert(std::make_pair(intValueSeek, wxT("")));
5166 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5167 intiter != SplitPoints.end(); ++intiter){
5169 SLiter = SplitLength.find(intiter->first);
5171 PropertyData = wxSPropertySeg1.Mid(intPrevValue, SLiter->second);
5173 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5174 PropertyName = PropertyElement.GetNextToken();
5175 PropertyValue = PropertyElement.GetNextToken();
5177 intPrevValue = intiter->second;
5179 // Process properties.
5181 int intPropertyValueLen = PropertyValue.Len();
5183 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
5185 PropertyValue.Trim();
5186 PropertyValue.RemoveLast();
5190 if (PropertyValue.Mid(0, 1) == wxT("\"")){
5192 PropertyValue.Remove(0, 1);
5196 ProcessCaptureStrings(&PropertyValue);
5198 if (PropertyName == wxT("ALTID")){
5200 if (intType == 0){ GeneralNoteListAltID.erase(intValueSeek); GeneralNoteListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5201 else if (intType == 1){ HomeNoteListAltID.erase(intValueSeek); HomeNoteListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5202 else if (intType == 2){ BusinessNoteListAltID.erase(intValueSeek); BusinessNoteListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5204 } else if (PropertyName == wxT("PID")){
5206 if (intType == 0){ GeneralNoteListPID.erase(intValueSeek); GeneralNoteListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5207 else if (intType == 1){ HomeNoteListPID.erase(intValueSeek); HomeNoteListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5208 else if (intType == 2){ BusinessNoteListPID.erase(intValueSeek); BusinessNoteListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5210 } else if (PropertyName == wxT("PREF")){
5212 intPref = wxAtoi(PropertyValue);
5214 if (intType == 0){ GeneralNoteListPref.erase(intValueSeek); GeneralNoteListPref.insert(std::make_pair(intValueSeek, intPref)); }
5215 else if (intType == 1){ HomeNoteListPref.erase(intValueSeek); HomeNoteListPref.insert(std::make_pair(intValueSeek, intPref)); }
5216 else if (intType == 2){ BusinessNoteListPref.erase(intValueSeek); BusinessNoteListPref.insert(std::make_pair(intValueSeek, intPref)); }
5218 } else if (PropertyName == wxT("LANGUAGE")){
5220 if (intType == 0){ GeneralNoteListLanguage.erase(intValueSeek); GeneralNoteListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
5221 else if (intType == 1){ HomeNoteListLanguage.erase(intValueSeek); HomeNoteListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
5222 else if (intType == 2){ BusinessNoteListLanguage.erase(intValueSeek); BusinessNoteListLanguage.insert(std::make_pair(intValueSeek, PropertyValue)); }
5226 // Something else we don't know about so append
5227 // to the tokens variable.
5229 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
5231 if (FirstToken == TRUE){
5233 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
5238 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
5248 // Add the data to the General/Home/Work address variables.
5250 ProcessCaptureStrings(&wxSPropertySeg2);
5254 coldata.SetId(intValueSeek);
5255 coldata.SetData(intValueSeek);
5259 GeneralNoteList.erase(intValueSeek);
5260 GeneralNoteListType.erase(intValueSeek);
5261 GeneralNoteListTokens.erase(intValueSeek);
5262 GeneralNoteList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
5263 GeneralNoteListType.insert(std::make_pair(intValueSeek, wxT("")));
5264 GeneralNoteListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
5266 //CaptureString(&wxSPropertySeg2, FALSE);
5268 coldata.SetText(wxSPropertySeg2);
5270 ListCtrlIndex = lboNotes->InsertItem(coldata);
5272 if (intPref > 0 && intPref < 101){
5274 lboNotes->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
5278 } else if (intType == 1){
5280 HomeNoteList.erase(intValueSeek);
5281 HomeNoteListType.erase(intValueSeek);
5282 HomeNoteListTokens.erase(intValueSeek);
5283 HomeNoteList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
5284 HomeNoteListType.insert(std::make_pair(intValueSeek, wxT("home")));
5285 HomeNoteListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
5287 CaptureString(&wxSPropertySeg2, FALSE);
5289 coldata.SetText(wxSPropertySeg2);
5291 ListCtrlIndex = lboHomeNotes->InsertItem(coldata);
5293 if (intPref > 0 && intPref < 101){
5295 lboHomeNotes->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
5299 } else if (intType == 2){
5301 BusinessNoteList.erase(intValueSeek);
5302 BusinessNoteListType.erase(intValueSeek);
5303 BusinessNoteListTokens.erase(intValueSeek);
5304 BusinessNoteList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
5305 BusinessNoteListType.insert(std::make_pair(intValueSeek, wxT("work")));
5306 BusinessNoteListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
5308 CaptureString(&wxSPropertySeg2, FALSE);
5310 coldata.SetText(wxSPropertySeg2);
5312 ListCtrlIndex = lboBusinessNotes->InsertItem(coldata);
5314 if (intPref > 0 && intPref < 101){
5316 lboBusinessNotes->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
5325 } else if (wxSProperty == wxT("CATEGORIES")) {
5327 int intPropertyLen = wxSPropertySeg1.Len();
5328 std::map<int, int> SplitPoints;
5329 std::map<int, int> SplitLength;
5330 std::map<int, int>::iterator SLiter;
5331 wxString PropertyData;
5332 wxString PropertyName;
5333 wxString PropertyValue;
5334 wxString PropertyTokens;
5335 wxString PropertyType;
5336 bool AfterFirstToken = FALSE;
5337 bool FirstToken = TRUE;
5338 int intSplitsFound = 0;
5339 int intSplitSize = 0;
5340 int intPrevValue = 12;
5343 int intSplitSeek = 0;
5346 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
5350 // Look for type before continuing.
5352 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5353 intiter != SplitPoints.end(); ++intiter){
5355 SLiter = SplitLength.find(intiter->first);
5357 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
5359 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5360 PropertyName = PropertyElement.GetNextToken();
5361 PropertyValue = PropertyElement.GetNextToken();
5363 intPrevValue = intiter->second;
5365 if (PropertyName == wxT("TYPE")){
5367 if (PropertyValue == wxT("work")){
5370 PropertyType = wxT("work");
5372 } else if (PropertyValue == wxT("home")){
5375 PropertyType = wxT("home");
5387 // Setup blank lines for later on.
5389 CategoriesList.insert(std::make_pair(intValueSeek, wxT("")));
5390 CategoriesListAltID.insert(std::make_pair(intValueSeek, wxT("")));
5391 CategoriesListPID.insert(std::make_pair(intValueSeek, wxT("")));
5392 CategoriesListPref.insert(std::make_pair(intValueSeek, 0));
5393 CategoriesListTokens.insert(std::make_pair(intValueSeek, wxT("")));
5397 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5398 intiter != SplitPoints.end(); ++intiter){
5400 SLiter = SplitLength.find(intiter->first);
5402 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
5404 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5405 PropertyName = PropertyElement.GetNextToken();
5406 PropertyValue = PropertyElement.GetNextToken();
5408 intPrevValue = intiter->second;
5410 // Process properties.
5412 int intPropertyValueLen = PropertyValue.Len();
5414 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
5416 PropertyValue.Trim();
5417 PropertyValue.RemoveLast();
5421 if (PropertyValue.Mid(0, 1) == wxT("\"")){
5423 PropertyValue.Remove(0, 1);
5427 ProcessCaptureStrings(&PropertyValue);
5429 if (PropertyName == wxT("ALTID")){
5431 if (intType == 0){ CategoriesListAltID.erase(intValueSeek); CategoriesListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5432 else if (intType == 1){ CategoriesListAltID.erase(intValueSeek); CategoriesListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5433 else if (intType == 2){ CategoriesListAltID.erase(intValueSeek); CategoriesListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5435 } else if (PropertyName == wxT("PID")){
5437 if (intType == 0){ CategoriesListPID.erase(intValueSeek); CategoriesListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5438 else if (intType == 1){ CategoriesListPID.erase(intValueSeek); CategoriesListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5439 else if (intType == 2){ CategoriesListPID.erase(intValueSeek); CategoriesListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5441 } else if (PropertyName == wxT("PREF")){
5443 intPref = wxAtoi(PropertyValue);
5445 if (intType == 0){ CategoriesListPref.erase(intValueSeek); CategoriesListPref.insert(std::make_pair(intValueSeek, intPref)); }
5446 else if (intType == 1){ CategoriesListPref.erase(intValueSeek); CategoriesListPref.insert(std::make_pair(intValueSeek, intPref)); }
5447 else if (intType == 2){ CategoriesListPref.erase(intValueSeek); CategoriesListPref.insert(std::make_pair(intValueSeek, intPref)); }
5451 // Something else we don't know about so append
5452 // to the tokens variable.
5454 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
5456 if (FirstToken == TRUE){
5458 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
5463 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
5473 // Deal with multiple categories.
5475 SplitPoints.clear();
5476 SplitLength.clear();
5481 intPropertyLen = wxSPropertySeg2.Len();
5483 for (int i = 0; i <= intPropertyLen; i++){
5485 if (intSplitSize == 0 && wxSPropertySeg2.Mid(i, 1) == wxT(" ")){
5493 if (wxSPropertySeg2.Mid(i, 1) == wxT(",") && wxSPropertySeg2.Mid((i - 1), 1) != wxT("\\")){
5495 if (AfterFirstToken == TRUE){
5497 SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
5498 SplitLength.insert(std::make_pair(intSplitsFound, intSplitSize));
5502 SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
5503 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
5504 AfterFirstToken = TRUE;
5516 SplitPoints.insert(std::make_pair(intSplitsFound, (intSplitSeek + 1)));
5517 SplitLength.insert(std::make_pair(intSplitsFound, intSplitSize));
5521 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5522 intiter != SplitPoints.end(); ++intiter){
5524 SLiter = SplitLength.find(intiter->first);
5526 PropertyData = wxSPropertySeg2.Mid(intPrevValue, (SLiter->second + 1));
5528 intPrevValue = intiter->second;
5530 // Process properties.
5534 int intPropertyValueLen = PropertyValue.Len();
5536 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
5538 PropertyValue.Trim();
5539 PropertyValue.RemoveLast();
5545 // Add the data to the General/Home/Work address variables.
5547 // Trim any whitespace from the start and end.
5549 PropertyData = PropertyData.Trim(FALSE);
5550 PropertyData = PropertyData.Trim(TRUE);
5552 ProcessCaptureStrings(&PropertyData);
5556 coldata.SetId(intValueSeek);
5557 coldata.SetData(intValueSeek);
5558 coldata.SetText(PropertyData);
5560 ListCtrlIndex = lboCategories->InsertItem(coldata);
5562 if (intPref > 0 && intPref < 101){
5564 lboCategories->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
5568 CategoriesList.erase(intValueSeek);
5569 CategoriesListType.erase(intValueSeek);
5570 CategoriesListTokens.erase(intValueSeek);
5571 CategoriesList.insert(std::make_pair(intValueSeek, PropertyData));
5572 CategoriesListType.insert(std::make_pair(intValueSeek, PropertyType));
5573 CategoriesListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
5580 } else if (wxSProperty == wxT("PHOTO")) {
5582 int intPropertyLen = wxSPropertySeg1.Len();
5583 std::map<int, int> SplitPoints;
5584 std::map<int, int> SplitLength;
5585 std::map<int, int>::iterator SLiter;
5586 wxString PropertyData;
5587 wxString PropertyName;
5588 wxString PropertyValue;
5589 wxString PropertyTokens;
5590 bool FirstToken = TRUE;
5591 int intSplitsFound = 0;
5592 int intSplitSize = 0;
5593 int intPrevValue = 7;
5596 int intSplitSeek = 0;
5599 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
5603 // Look for type before continuing.
5605 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5606 intiter != SplitPoints.end(); ++intiter){
5608 SLiter = SplitLength.find(intiter->first);
5610 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
5612 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5613 PropertyName = PropertyElement.GetNextToken();
5614 PropertyValue = PropertyElement.GetNextToken();
5616 intPrevValue = intiter->second;
5618 if (PropertyName == wxT("TYPE")){
5620 if (PropertyValue == wxT("work")){
5624 } else if (PropertyValue == wxT("home")){
5638 // Setup blank lines for later on.
5640 PicturesList.insert(std::make_pair(intValueSeek, ""));
5641 PicturesListType.insert(std::make_pair(intValueSeek, wxT("")));
5642 PicturesListAltID.insert(std::make_pair(intValueSeek, wxT("")));
5643 PicturesListPID.insert(std::make_pair(intValueSeek, wxT("")));
5644 PicturesListPref.insert(std::make_pair(intValueSeek, 0));
5645 PicturesListPicEncType.insert(std::make_pair(intValueSeek, wxT("")));
5646 PicturesListPictureType.insert(std::make_pair(intValueSeek, wxT("")));
5647 PicturesListTokens.insert(std::make_pair(intValueSeek, wxT("")));
5648 PicturesListMediatype.insert(std::make_pair(intValueSeek, wxT("")));
5652 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5653 intiter != SplitPoints.end(); ++intiter){
5655 SLiter = SplitLength.find(intiter->first);
5657 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
5659 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5660 PropertyName = PropertyElement.GetNextToken();
5661 PropertyValue = PropertyElement.GetNextToken();
5663 intPrevValue = intiter->second;
5665 // Process properties.
5667 int intPropertyValueLen = PropertyValue.Len();
5669 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
5671 PropertyValue.Trim();
5672 PropertyValue.RemoveLast();
5676 if (PropertyValue.Mid(0, 1) == wxT("\"")){
5678 PropertyValue.Remove(0, 1);
5682 ProcessCaptureStrings(&PropertyValue);
5684 if (PropertyName == wxT("ALTID")){
5686 if (intType == 0){ PicturesListAltID.erase(intValueSeek); PicturesListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5687 else if (intType == 1){ PicturesListAltID.erase(intValueSeek); PicturesListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5688 else if (intType == 2){ PicturesListAltID.erase(intValueSeek); PicturesListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5690 } else if (PropertyName == wxT("PID")){
5692 if (intType == 0){ PicturesListPID.erase(intValueSeek); PicturesListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5693 else if (intType == 1){ PicturesListPID.erase(intValueSeek); PicturesListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5694 else if (intType == 2){ PicturesListPID.erase(intValueSeek); PicturesListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5696 } else if (PropertyName == wxT("PREF")){
5698 intPref = wxAtoi(PropertyValue);
5700 if (intType == 0){ PicturesListPref.erase(intValueSeek); PicturesListPref.insert(std::make_pair(intValueSeek, intPref)); }
5701 else if (intType == 1){ PicturesListPref.erase(intValueSeek); PicturesListPref.insert(std::make_pair(intValueSeek, intPref)); }
5702 else if (intType == 2){ PicturesListPref.erase(intValueSeek); PicturesListPref.insert(std::make_pair(intValueSeek, intPref)); }
5704 } else if (PropertyName == wxT("MEDIATYPE")){
5706 if (intType == 0){ PicturesListMediatype.erase(intValueSeek); PicturesListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
5707 else if (intType == 1){ PicturesListMediatype.erase(intValueSeek); PicturesListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
5708 else if (intType == 2){ PicturesListMediatype.erase(intValueSeek); PicturesListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
5712 // Something else we don't know about so append
5713 // to the tokens variable.
5715 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
5717 if (FirstToken == TRUE){
5719 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
5724 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
5734 intPropertyLen = wxSPropertySeg2.Len();
5735 SplitPoints.clear();
5736 SplitLength.clear();
5741 ProcessCaptureStrings(&wxSPropertySeg2);
5743 for (int i = 0; i <= intPropertyLen; i++){
5747 if (wxSPropertySeg2.Mid(i, 1) == wxT(";")){
5750 SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
5752 if (intSplitsFound == 6){
5754 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
5759 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
5769 wxString wxSPhotoURI;
5770 wxString wxSPhotoMIME;
5771 wxString wxSPhotoEncoding;
5772 wxString wxSPhotoData;
5773 std::string base64enc;
5775 if (intSplitsFound = 0){
5779 std::map<int, int>::iterator striter;
5781 striter = SplitLength.find(1);
5783 wxStringTokenizer wSTDataType(wxSPropertySeg2.Mid(0, striter->second), wxT(":"));
5785 while (wSTDataType.HasMoreTokens() == TRUE){
5787 wxSPhotoURI = wSTDataType.GetNextToken();
5788 wxSPhotoMIME = wSTDataType.GetNextToken();
5793 wxStringTokenizer wSTDataInfo(wxSPropertySeg2.Mid((striter->second + 1)), wxT(","));
5795 while (wSTDataInfo.HasMoreTokens() == TRUE){
5797 wxSPhotoEncoding = wSTDataInfo.GetNextToken();
5798 wxSPhotoData = wSTDataInfo.GetNextToken();
5799 base64enc = wxSPhotoData.mb_str();
5806 // Add the data to the General/Home/Work address variables.
5810 coldata.SetId(intValueSeek);
5811 coldata.SetData(intValueSeek);
5812 coldata.SetText(_("Picture"));
5814 ListCtrlIndex = lboPictures->InsertItem(coldata);
5816 if (intPref > 0 && intPref < 101){
5818 lboPictures->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
5822 PicturesList.erase(intValueSeek);
5823 PicturesListType.erase(intValueSeek);
5824 PicturesListTokens.erase(intValueSeek);
5825 PicturesListPictureType.erase(intValueSeek);
5826 PicturesListPicEncType.erase(intValueSeek);
5827 PicturesList.insert(std::make_pair(intValueSeek, base64enc));
5828 PicturesListPictureType.insert(std::make_pair(intValueSeek, wxSPhotoMIME));
5829 PicturesListPicEncType.insert(std::make_pair(intValueSeek, wxSPhotoEncoding));
5833 PicturesListType.insert(std::make_pair(intValueSeek, wxT("")));
5835 } else if (intType == 1){
5837 PicturesListType.insert(std::make_pair(intValueSeek, wxT("home")));
5838 lboLogos->SetItem(ListCtrlIndex, 1, _("Home"));
5840 } else if (intType == 2){
5842 PicturesListType.insert(std::make_pair(intValueSeek, wxT("work")));
5843 lboLogos->SetItem(ListCtrlIndex, 1, _("Work"));
5847 PicturesListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
5852 } else if (wxSProperty == wxT("LOGO")) {
5854 int intPropertyLen = wxSPropertySeg1.Len();
5855 std::map<int, int> SplitPoints;
5856 std::map<int, int> SplitLength;
5857 std::map<int, int>::iterator SLiter;
5858 wxString PropertyData;
5859 wxString PropertyName;
5860 wxString PropertyValue;
5861 wxString PropertyTokens;
5862 bool FirstToken = TRUE;
5863 int intSplitsFound = 0;
5864 int intSplitSize = 0;
5865 int intPrevValue = 6;
5868 int intSplitSeek = 0;
5871 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
5875 // Look for type before continuing.
5877 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5878 intiter != SplitPoints.end(); ++intiter){
5880 SLiter = SplitLength.find(intiter->first);
5882 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
5884 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5885 PropertyName = PropertyElement.GetNextToken();
5886 PropertyValue = PropertyElement.GetNextToken();
5888 intPrevValue = intiter->second;
5890 if (PropertyName == wxT("TYPE")){
5892 if (PropertyValue == wxT("work")){
5896 } else if (PropertyValue == wxT("home")){
5910 // Setup blank lines for later on.
5912 LogosList.insert(std::make_pair(intValueSeek, ""));
5913 LogosListType.insert(std::make_pair(intValueSeek, wxT("")));
5914 LogosListAltID.insert(std::make_pair(intValueSeek, wxT("")));
5915 LogosListPID.insert(std::make_pair(intValueSeek, wxT("")));
5916 LogosListPref.insert(std::make_pair(intValueSeek, 0));
5917 LogosListPicEncType.insert(std::make_pair(intValueSeek, wxT("")));
5918 LogosListPictureType.insert(std::make_pair(intValueSeek, wxT("")));
5919 LogosListTokens.insert(std::make_pair(intValueSeek, wxT("")));
5920 LogosListMediatype.insert(std::make_pair(intValueSeek, wxT("")));
5924 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5925 intiter != SplitPoints.end(); ++intiter){
5927 SLiter = SplitLength.find(intiter->first);
5929 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
5931 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5932 PropertyName = PropertyElement.GetNextToken();
5933 PropertyValue = PropertyElement.GetNextToken();
5935 intPrevValue = intiter->second;
5937 // Process properties.
5939 int intPropertyValueLen = PropertyValue.Len();
5941 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
5943 PropertyValue.Trim();
5944 PropertyValue.RemoveLast();
5948 if (PropertyValue.Mid(0, 1) == wxT("\"")){
5950 PropertyValue.Remove(0, 1);
5954 ProcessCaptureStrings(&PropertyValue);
5956 if (PropertyName == wxT("ALTID")){
5958 if (intType == 0){ LogosListAltID.erase(intValueSeek); LogosListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5959 else if (intType == 1){ LogosListAltID.erase(intValueSeek); LogosListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5960 else if (intType == 2){ LogosListAltID.erase(intValueSeek); LogosListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5962 } else if (PropertyName == wxT("PID")){
5964 if (intType == 0){ LogosListPID.erase(intValueSeek); LogosListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5965 else if (intType == 1){ LogosListPID.erase(intValueSeek); LogosListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5966 else if (intType == 2){ LogosListPID.erase(intValueSeek); LogosListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
5968 } else if (PropertyName == wxT("PREF")){
5970 intPref = wxAtoi(PropertyValue);
5972 if (intType == 0){ LogosListPref.erase(intValueSeek); LogosListPref.insert(std::make_pair(intValueSeek, intPref)); }
5973 else if (intType == 1){ LogosListPref.erase(intValueSeek); LogosListPref.insert(std::make_pair(intValueSeek, intPref)); }
5974 else if (intType == 2){ LogosListPref.erase(intValueSeek); LogosListPref.insert(std::make_pair(intValueSeek, intPref)); }
5976 } else if (PropertyName == wxT("MEDIATYPE")){
5978 if (intType == 0){ LogosListMediatype.erase(intValueSeek); LogosListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
5979 else if (intType == 1){ LogosListMediatype.erase(intValueSeek); LogosListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
5980 else if (intType == 2){ LogosListMediatype.erase(intValueSeek); LogosListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
5984 // Something else we don't know about so append
5985 // to the tokens variable.
5987 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
5989 if (FirstToken == TRUE){
5991 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
5996 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
6006 intPropertyLen = wxSPropertySeg2.Len();
6007 SplitPoints.clear();
6008 SplitLength.clear();
6013 wxString wxSPhotoURI;
6014 wxString wxSPhotoMIME;
6015 wxString wxSPhotoEncoding;
6016 wxString wxSPhotoData;
6017 std::string base64enc;
6019 ProcessCaptureStrings(&wxSPropertySeg2);
6021 if (intSplitsFound = 0){
6025 std::map<int, int>::iterator striter;
6027 striter = SplitLength.find(1);
6029 wxStringTokenizer wSTDataType(wxSPropertySeg2.Mid(0, striter->second), wxT(":"));
6031 while (wSTDataType.HasMoreTokens() == TRUE){
6033 wxSPhotoURI = wSTDataType.GetNextToken();
6034 wxSPhotoMIME = wSTDataType.GetNextToken();
6039 wxStringTokenizer wSTDataInfo(wxSPropertySeg2.Mid((striter->second + 1)), wxT(","));
6041 while (wSTDataInfo.HasMoreTokens() == TRUE){
6043 wxSPhotoEncoding = wSTDataInfo.GetNextToken();
6044 wxSPhotoData = wSTDataInfo.GetNextToken();
6045 base64enc = wxSPhotoData.mb_str();
6052 // Add the data to the General/Home/Work address variables.
6056 coldata.SetId(intValueSeek);
6057 coldata.SetData(intValueSeek);
6058 coldata.SetText(_("Picture"));
6060 ListCtrlIndex = lboLogos->InsertItem(coldata);
6062 if (intPref > 0 && intPref < 101){
6064 lboLogos->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
6068 LogosList.erase(intValueSeek);
6069 LogosListType.erase(intValueSeek);
6070 LogosListTokens.erase(intValueSeek);
6071 LogosListPictureType.erase(intValueSeek);
6072 LogosListPicEncType.erase(intValueSeek);
6073 LogosList.insert(std::make_pair(intValueSeek, base64enc));
6074 LogosListPictureType.insert(std::make_pair(intValueSeek, wxSPhotoMIME));
6075 LogosListPicEncType.insert(std::make_pair(intValueSeek, wxSPhotoEncoding));
6079 LogosListType.insert(std::make_pair(intValueSeek, wxT("")));
6081 } else if (intType == 1){
6083 LogosListType.insert(std::make_pair(intValueSeek, wxT("home")));
6084 lboLogos->SetItem(ListCtrlIndex, 1, _("Home"));
6086 } else if (intType == 2){
6088 LogosListType.insert(std::make_pair(intValueSeek, wxT("work")));
6089 lboLogos->SetItem(ListCtrlIndex, 1, _("Work"));
6093 LogosListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
6098 } else if (wxSProperty == wxT("SOUND")) {
6100 int intPropertyLen = wxSPropertySeg1.Len();
6101 std::map<int, int> SplitPoints;
6102 std::map<int, int> SplitLength;
6103 std::map<int, int>::iterator SLiter;
6104 wxString PropertyData;
6105 wxString PropertyName;
6106 wxString PropertyValue;
6107 wxString PropertyTokens;
6108 bool FirstToken = TRUE;
6109 int intSplitsFound = 0;
6110 int intSplitSize = 0;
6111 int intPrevValue = 7;
6114 int intSplitSeek = 0;
6117 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
6121 // Look for type before continuing.
6123 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6124 intiter != SplitPoints.end(); ++intiter){
6126 SLiter = SplitLength.find(intiter->first);
6128 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
6130 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6131 PropertyName = PropertyElement.GetNextToken();
6132 PropertyValue = PropertyElement.GetNextToken();
6134 intPrevValue = intiter->second;
6136 if (PropertyName == wxT("TYPE")){
6138 if (PropertyValue == wxT("work")){
6142 } else if (PropertyValue == wxT("home")){
6156 // Setup blank lines for later on.
6158 SoundsList.insert(std::make_pair(intValueSeek, ""));
6159 SoundsListType.insert(std::make_pair(intValueSeek, wxT("")));
6160 SoundsListAltID.insert(std::make_pair(intValueSeek, wxT("")));
6161 SoundsListPID.insert(std::make_pair(intValueSeek, wxT("")));
6162 SoundsListPref.insert(std::make_pair(intValueSeek, 0));
6163 SoundsListAudioEncType.insert(std::make_pair(intValueSeek, wxT("")));
6164 SoundsListAudioType.insert(std::make_pair(intValueSeek, wxT("")));
6165 SoundsListTokens.insert(std::make_pair(intValueSeek, wxT("")));
6166 SoundsListMediatype.insert(std::make_pair(intValueSeek, wxT("")));
6170 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6171 intiter != SplitPoints.end(); ++intiter){
6173 SLiter = SplitLength.find(intiter->first);
6175 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
6177 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6178 PropertyName = PropertyElement.GetNextToken();
6179 PropertyValue = PropertyElement.GetNextToken();
6181 intPrevValue = intiter->second;
6183 // Process properties.
6185 int intPropertyValueLen = PropertyValue.Len();
6187 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
6189 PropertyValue.Trim();
6190 PropertyValue.RemoveLast();
6194 if (PropertyValue.Mid(0, 1) == wxT("\"")){
6196 PropertyValue.Remove(0, 1);
6200 ProcessCaptureStrings(&PropertyValue);
6202 if (PropertyName == wxT("ALTID")){
6204 if (intType == 0){ SoundsListAltID.erase(intValueSeek); SoundsListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
6205 else if (intType == 1){ SoundsListAltID.erase(intValueSeek); SoundsListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
6206 else if (intType == 2){ SoundsListAltID.erase(intValueSeek); SoundsListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
6208 } else if (PropertyName == wxT("PID")){
6210 if (intType == 0){ SoundsListPID.erase(intValueSeek); SoundsListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
6211 else if (intType == 1){ SoundsListPID.erase(intValueSeek); SoundsListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
6212 else if (intType == 2){ SoundsListPID.erase(intValueSeek); SoundsListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
6214 } else if (PropertyName == wxT("PREF")){
6216 intPref = wxAtoi(PropertyValue);
6218 if (intType == 0){ SoundsListPref.erase(intValueSeek); SoundsListPref.insert(std::make_pair(intValueSeek, intPref)); }
6219 else if (intType == 1){ SoundsListPref.erase(intValueSeek); SoundsListPref.insert(std::make_pair(intValueSeek, intPref)); }
6220 else if (intType == 2){ SoundsListPref.erase(intValueSeek); SoundsListPref.insert(std::make_pair(intValueSeek, intPref)); }
6222 } else if (PropertyName == wxT("MEDIATYPE")){
6224 if (intType == 0){ SoundsListMediatype.erase(intValueSeek); SoundsListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
6225 else if (intType == 1){ SoundsListMediatype.erase(intValueSeek); SoundsListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
6226 else if (intType == 2){ SoundsListMediatype.erase(intValueSeek); SoundsListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
6230 // Something else we don't know about so append
6231 // to the tokens variable.
6233 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
6235 if (FirstToken == TRUE){
6237 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
6242 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
6252 intPropertyLen = wxSPropertySeg2.Len();
6253 SplitPoints.clear();
6254 SplitLength.clear();
6259 ProcessCaptureStrings(&wxSPropertySeg2);
6261 for (int i = 0; i <= intPropertyLen; i++){
6265 if (wxSPropertySeg2.Mid(i, 1) == wxT(";")){
6268 SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
6270 if (intSplitsFound == 6){
6272 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
6277 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
6287 wxString wxSSoundURI;
6288 wxString wxSSoundMIME;
6289 wxString wxSSoundEncoding;
6290 wxString wxSSoundData;
6291 std::string base64enc;
6293 if (intSplitsFound = 0){
6297 std::map<int, int>::iterator striter;
6299 striter = SplitLength.find(1);
6301 wxStringTokenizer wSTDataType(wxSPropertySeg2.Mid(0, striter->second), wxT(":"));
6303 while (wSTDataType.HasMoreTokens() == TRUE){
6305 wxSSoundURI = wSTDataType.GetNextToken();
6306 wxSSoundMIME = wSTDataType.GetNextToken();
6311 wxStringTokenizer wSTDataInfo(wxSPropertySeg2.Mid((striter->second + 1)), wxT(","));
6313 while (wSTDataInfo.HasMoreTokens() == TRUE){
6315 wxSSoundEncoding = wSTDataInfo.GetNextToken();
6316 wxSSoundData = wSTDataInfo.GetNextToken();
6317 base64enc = wxSSoundData.mb_str();
6324 // Add the data to the General/Home/Work address variables.
6328 coldata.SetId(intValueSeek);
6329 coldata.SetData(intValueSeek);
6330 coldata.SetText(_("Sound"));
6332 ListCtrlIndex = lboSounds->InsertItem(coldata);
6334 if (intPref > 0 && intPref < 101){
6336 lboSounds->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
6340 SoundsList.erase(intValueSeek);
6341 SoundsListType.erase(intValueSeek);
6342 SoundsListTokens.erase(intValueSeek);
6343 SoundsListAudioType.erase(intValueSeek);
6344 SoundsListAudioEncType.erase(intValueSeek);
6345 SoundsList.insert(std::make_pair(intValueSeek, base64enc));
6346 SoundsListAudioType.insert(std::make_pair(intValueSeek, wxSSoundMIME));
6347 SoundsListAudioEncType.insert(std::make_pair(intValueSeek, wxSSoundEncoding));
6351 SoundsListType.insert(std::make_pair(intValueSeek, wxT("")));
6353 } else if (intType == 1){
6355 SoundsListType.insert(std::make_pair(intValueSeek, wxT("home")));
6356 lboLogos->SetItem(ListCtrlIndex, 1, _("Home"));
6358 } else if (intType == 2){
6360 SoundsListType.insert(std::make_pair(intValueSeek, wxT("work")));
6361 lboLogos->SetItem(ListCtrlIndex, 1, _("Work"));
6365 SoundsListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
6370 } else if (wxSProperty == wxT("CALURI")){
6372 int intPropertyLen = wxSPropertySeg1.Len();
6373 std::map<int, int> SplitPoints;
6374 std::map<int, int> SplitLength;
6375 std::map<int, int>::iterator SLiter;
6376 wxString PropertyData;
6377 wxString PropertyName;
6378 wxString PropertyValue;
6379 wxString PropertyTokens;
6380 bool AfterFirstToken = FALSE;
6381 bool FirstToken = TRUE;
6382 int intSplitsFound = 0;
6383 int intSplitSize = 0;
6384 int intPrevValue = 8;
6387 int intSplitSeek = 0;
6390 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
6394 // Look for type before continuing.
6396 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6397 intiter != SplitPoints.end(); ++intiter){
6399 SLiter = SplitLength.find(intiter->first);
6401 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
6403 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6404 PropertyName = PropertyElement.GetNextToken();
6405 PropertyValue = PropertyElement.GetNextToken();
6407 intPrevValue = intiter->second;
6409 if (PropertyName == wxT("TYPE")){
6411 if (PropertyValue == wxT("work")){
6415 } else if (PropertyValue == wxT("home")){
6429 // Setup blank lines for later on.
6431 CalendarList.insert(std::make_pair(intValueSeek, wxT("")));
6432 CalendarListAltID.insert(std::make_pair(intValueSeek, wxT("")));
6433 CalendarListPID.insert(std::make_pair(intValueSeek, wxT("")));
6434 CalendarListPref.insert(std::make_pair(intValueSeek, 0));
6435 CalendarListTokens.insert(std::make_pair(intValueSeek, wxT("")));
6439 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6440 intiter != SplitPoints.end(); ++intiter){
6442 SLiter = SplitLength.find(intiter->first);
6444 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
6446 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6447 PropertyName = PropertyElement.GetNextToken();
6448 PropertyValue = PropertyElement.GetNextToken();
6450 intPrevValue = intiter->second;
6452 // Process properties.
6454 int intPropertyValueLen = PropertyValue.Len();
6456 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
6458 PropertyValue.Trim();
6459 PropertyValue.RemoveLast();
6463 if (PropertyValue.Mid(0, 1) == wxT("\"")){
6465 PropertyValue.Remove(0, 1);
6469 if (PropertyName == wxT("ALTID")){
6471 CalendarListAltID.erase(intValueSeek); CalendarListAltID.insert(std::make_pair(intValueSeek, PropertyValue));
6473 } else if (PropertyName == wxT("PID")){
6475 CalendarListPID.erase(intValueSeek); CalendarListPID.insert(std::make_pair(intValueSeek, PropertyValue));
6477 } else if (PropertyName == wxT("PREF")){
6479 intPref = wxAtoi(PropertyValue);
6481 CalendarListPref.erase(intValueSeek); CalendarListPref.insert(std::make_pair(intValueSeek, intPref));
6483 } else if (PropertyName == wxT("MEDIATYPE")){
6485 CalendarListMediatype.erase(intValueSeek); CalendarListMediatype.insert(std::make_pair(intValueSeek, PropertyValue));
6489 // Something else we don't know about so append
6490 // to the tokens variable.
6492 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
6494 if (FirstToken == TRUE){
6496 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
6501 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
6511 // Add the data to the General/Home/Work address variables.
6515 coldata.SetId(intValueSeek);
6516 coldata.SetData(intValueSeek);
6517 coldata.SetText(wxSPropertySeg2);
6519 ListCtrlIndex = lboCalendarAddresses->InsertItem(coldata);
6521 if (intPref > 0 && intPref < 101){
6523 lboCalendarAddresses->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
6527 CaptureString(&wxSPropertySeg2, FALSE);
6529 CalendarList.erase(intValueSeek);
6530 CalendarListType.erase(intValueSeek);
6531 CalendarListTokens.erase(intValueSeek);
6532 CalendarList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
6536 CalendarListType.insert(std::make_pair(intValueSeek, wxT("")));
6538 } else if (intType == 1){
6540 CalendarListType.insert(std::make_pair(intValueSeek, wxT("home")));
6541 lboCalendarAddresses->SetItem(ListCtrlIndex, 1, _("Home"), intPref);
6543 } else if (intType == 2){
6545 CalendarListType.insert(std::make_pair(intValueSeek, wxT("work")));
6546 lboCalendarAddresses->SetItem(ListCtrlIndex, 1, _("Work"), intPref);
6550 CalendarListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
6555 } else if (wxSProperty == wxT("CALADRURI")){
6557 int intPropertyLen = wxSPropertySeg1.Len();
6558 std::map<int, int> SplitPoints;
6559 std::map<int, int> SplitLength;
6560 std::map<int, int>::iterator SLiter;
6561 wxString PropertyData;
6562 wxString PropertyName;
6563 wxString PropertyValue;
6564 wxString PropertyTokens;
6565 bool AfterFirstToken = FALSE;
6566 bool FirstToken = TRUE;
6567 int intSplitsFound = 0;
6568 int intSplitSize = 0;
6569 int intPrevValue = 11;
6572 int intSplitSeek = 0;
6575 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
6579 // Look for type before continuing.
6583 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6584 intiter != SplitPoints.end(); ++intiter){
6586 SLiter = SplitLength.find(intiter->first);
6588 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
6590 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6591 PropertyName = PropertyElement.GetNextToken();
6592 PropertyValue = PropertyElement.GetNextToken();
6594 intPrevValue = intiter->second;
6596 if (PropertyName == wxT("TYPE")){
6598 if (PropertyValue == wxT("work")){
6602 } else if (PropertyValue == wxT("home")){
6616 // Setup blank lines for later on.
6618 CalendarRequestList.insert(std::make_pair(intValueSeek, wxT("")));
6619 CalendarRequestListAltID.insert(std::make_pair(intValueSeek, wxT("")));
6620 CalendarRequestListPID.insert(std::make_pair(intValueSeek, wxT("")));
6621 CalendarRequestListPref.insert(std::make_pair(intValueSeek, 0));
6622 CalendarRequestListTokens.insert(std::make_pair(intValueSeek, wxT("")));
6626 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6627 intiter != SplitPoints.end(); ++intiter){
6629 SLiter = SplitLength.find(intiter->first);
6631 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
6633 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6634 PropertyName = PropertyElement.GetNextToken();
6635 PropertyValue = PropertyElement.GetNextToken();
6637 intPrevValue = intiter->second;
6639 // Process properties.
6641 int intPropertyValueLen = PropertyValue.Len();
6643 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
6645 PropertyValue.Trim();
6646 PropertyValue.RemoveLast();
6650 if (PropertyValue.Mid(0, 1) == wxT("\"")){
6652 PropertyValue.Remove(0, 1);
6656 if (PropertyName == wxT("ALTID")){
6658 CalendarRequestListAltID.erase(intValueSeek); CalendarRequestListAltID.insert(std::make_pair(intValueSeek, PropertyValue));
6660 } else if (PropertyName == wxT("PID")){
6662 CalendarRequestListPID.erase(intValueSeek); CalendarRequestListPID.insert(std::make_pair(intValueSeek, PropertyValue));
6664 } else if (PropertyName == wxT("PREF")){
6666 intPref = wxAtoi(PropertyValue);
6668 CalendarRequestListPref.erase(intValueSeek); CalendarRequestListPref.insert(std::make_pair(intValueSeek, intPref));
6670 } else if (PropertyName == wxT("MEDIATYPE")){
6672 CalendarRequestListMediatype.erase(intValueSeek); CalendarRequestListMediatype.insert(std::make_pair(intValueSeek, PropertyValue));
6676 // Something else we don't know about so append
6677 // to the tokens variable.
6679 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
6681 if (FirstToken == TRUE){
6683 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
6688 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
6698 // Add the data to the General/Home/Work address variables.
6702 coldata.SetId(intValueSeek);
6703 coldata.SetData(intValueSeek);
6704 coldata.SetText(wxSPropertySeg2);
6706 ListCtrlIndex = lboCalendarRequestAddress->InsertItem(coldata);
6708 if (intPref > 0 && intPref < 101){
6710 lboCalendarRequestAddress->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
6714 CaptureString(&wxSPropertySeg2, FALSE);
6716 CalendarRequestList.erase(intValueSeek);
6717 CalendarRequestListType.erase(intValueSeek);
6718 CalendarRequestListTokens.erase(intValueSeek);
6719 CalendarRequestList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
6723 CalendarRequestListType.insert(std::make_pair(intValueSeek, wxT("")));
6725 } else if (intType == 1){
6727 CalendarRequestListType.insert(std::make_pair(intValueSeek, wxT("home")));
6728 lboCalendarRequestAddress->SetItem(ListCtrlIndex, 1, _("Home"), intPref);
6730 } else if (intType == 2){
6732 CalendarRequestListType.insert(std::make_pair(intValueSeek, wxT("work")));
6733 lboCalendarRequestAddress->SetItem(ListCtrlIndex, 1, _("Work"), intPref);
6737 CalendarRequestListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
6742 } else if (wxSProperty == wxT("FBURL")){
6744 int intPropertyLen = wxSPropertySeg1.Len();
6745 std::map<int, int> SplitPoints;
6746 std::map<int, int> SplitLength;
6747 std::map<int, int>::iterator SLiter;
6748 wxString PropertyData;
6749 wxString PropertyName;
6750 wxString PropertyValue;
6751 wxString PropertyTokens;
6752 bool AfterFirstToken = FALSE;
6753 bool FirstToken = TRUE;
6754 int intSplitsFound = 0;
6755 int intSplitSize = 0;
6756 int intPrevValue = 7;
6759 int intSplitSeek = 0;
6762 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
6766 // Look for type before continuing.
6768 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6769 intiter != SplitPoints.end(); ++intiter){
6771 SLiter = SplitLength.find(intiter->first);
6773 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
6775 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6776 PropertyName = PropertyElement.GetNextToken();
6777 PropertyValue = PropertyElement.GetNextToken();
6779 intPrevValue = intiter->second;
6781 if (PropertyName == wxT("TYPE")){
6783 if (PropertyValue == wxT("work")){
6787 } else if (PropertyValue == wxT("home")){
6801 // Setup blank lines for later on.
6803 FreeBusyList.insert(std::make_pair(intValueSeek, wxT("")));
6804 FreeBusyListAltID.insert(std::make_pair(intValueSeek, wxT("")));
6805 FreeBusyListPID.insert(std::make_pair(intValueSeek, wxT("")));
6806 FreeBusyListPref.insert(std::make_pair(intValueSeek, 0));
6807 FreeBusyListTokens.insert(std::make_pair(intValueSeek, wxT("")));
6811 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6812 intiter != SplitPoints.end(); ++intiter){
6814 SLiter = SplitLength.find(intiter->first);
6816 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
6818 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6819 PropertyName = PropertyElement.GetNextToken();
6820 PropertyValue = PropertyElement.GetNextToken();
6822 intPrevValue = intiter->second;
6824 // Process properties.
6826 int intPropertyValueLen = PropertyValue.Len();
6828 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
6830 PropertyValue.Trim();
6831 PropertyValue.RemoveLast();
6835 if (PropertyValue.Mid(0, 1) == wxT("\"")){
6837 PropertyValue.Remove(0, 1);
6841 if (PropertyName == wxT("ALTID")){
6843 FreeBusyListAltID.erase(intValueSeek); FreeBusyListAltID.insert(std::make_pair(intValueSeek, PropertyValue));
6845 } else if (PropertyName == wxT("PID")){
6847 FreeBusyListPID.erase(intValueSeek); FreeBusyListPID.insert(std::make_pair(intValueSeek, PropertyValue));
6849 } else if (PropertyName == wxT("PREF")){
6851 intPref = wxAtoi(PropertyValue);
6853 FreeBusyListPref.erase(intValueSeek); FreeBusyListPref.insert(std::make_pair(intValueSeek, intPref));
6855 } else if (PropertyName == wxT("MEDIATYPE")){
6857 FreeBusyListMediatype.erase(intValueSeek); FreeBusyListMediatype.insert(std::make_pair(intValueSeek, PropertyValue));
6861 // Something else we don't know about so append
6862 // to the tokens variable.
6864 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
6866 if (FirstToken == TRUE){
6868 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
6873 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
6883 // Add the data to the General/Home/Work address variables.
6887 coldata.SetId(intValueSeek);
6888 coldata.SetData(intValueSeek);
6889 coldata.SetText(wxSPropertySeg2);
6891 ListCtrlIndex = lboFreeBusyAddresses->InsertItem(coldata);
6893 if (intPref > 0 && intPref < 101){
6895 lboFreeBusyAddresses->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), intPref));
6899 CaptureString(&wxSPropertySeg2, FALSE);
6901 FreeBusyList.erase(intValueSeek);
6902 FreeBusyListType.erase(intValueSeek);
6903 FreeBusyListTokens.erase(intValueSeek);
6904 FreeBusyList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
6908 FreeBusyListType.insert(std::make_pair(intValueSeek, wxT("")));
6910 } else if (intType == 1){
6912 FreeBusyListType.insert(std::make_pair(intValueSeek, wxT("home")));
6913 lboFreeBusyAddresses->SetItem(ListCtrlIndex, 1, _("Home"), intPref);
6915 } else if (intType == 2){
6917 FreeBusyListType.insert(std::make_pair(intValueSeek, wxT("work")));
6918 lboFreeBusyAddresses->SetItem(ListCtrlIndex, 1, _("Work"), intPref);
6922 FreeBusyListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
6926 } else if (wxSProperty == wxT("KEY")){
6928 int intPropertyLen = wxSPropertySeg1.Len();
6929 std::map<int, int> SplitPoints;
6930 std::map<int, int> SplitLength;
6931 std::map<int, int>::iterator SLiter;
6932 wxString PropertyData;
6933 wxString PropertyName;
6934 wxString PropertyValue;
6935 wxString PropertyTokens;
6936 bool AfterFirstToken = FALSE;
6937 bool FirstToken = TRUE;
6938 int intSplitsFound = 0;
6939 int intSplitSize = 0;
6940 int intPrevValue = 5;
6943 int intSplitSeek = 0;
6946 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
6950 // Look for type before continuing.
6952 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6953 intiter != SplitPoints.end(); ++intiter){
6955 SLiter = SplitLength.find(intiter->first);
6957 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
6959 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6960 PropertyName = PropertyElement.GetNextToken();
6961 PropertyValue = PropertyElement.GetNextToken();
6963 intPrevValue = intiter->second;
6965 if (PropertyName == wxT("TYPE")){
6967 if (PropertyValue == wxT("work")){
6971 } else if (PropertyValue == wxT("home")){
6985 // Setup blank lines for later on.
6987 KeyList.insert(std::make_pair(intValueSeek, wxT("")));
6988 KeyListAltID.insert(std::make_pair(intValueSeek, wxT("")));
6989 KeyListPID.insert(std::make_pair(intValueSeek, wxT("")));
6990 KeyListPref.insert(std::make_pair(intValueSeek, 0));
6991 KeyListKeyType.insert(std::make_pair(intValueSeek, FALSE));
6992 KeyListDataType.insert(std::make_pair(intValueSeek, wxT("")));
6993 KeyListDataEncType.insert(std::make_pair(intValueSeek, wxT("")));
6994 KeyListTokens.insert(std::make_pair(intValueSeek, wxT("")));
6998 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6999 intiter != SplitPoints.end(); ++intiter){
7001 SLiter = SplitLength.find(intiter->first);
7003 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
7005 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7006 PropertyName = PropertyElement.GetNextToken();
7007 PropertyValue = PropertyElement.GetNextToken();
7009 intPrevValue = intiter->second;
7011 // Process properties.
7013 int intPropertyValueLen = PropertyValue.Len();
7015 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
7017 PropertyValue.Trim();
7018 PropertyValue.RemoveLast();
7022 if (PropertyValue.Mid(0, 1) == wxT("\"")){
7024 PropertyValue.Remove(0, 1);
7028 if (PropertyName == wxT("ALTID")){
7030 KeyListAltID.erase(intValueSeek); KeyListAltID.insert(std::make_pair(intValueSeek, PropertyValue));
7032 } else if (PropertyName == wxT("PID")){
7034 KeyListPID.erase(intValueSeek); KeyListPID.insert(std::make_pair(intValueSeek, PropertyValue));
7036 } else if (PropertyName == wxT("PREF")){
7038 intPref = wxAtoi(PropertyValue);
7040 KeyListPref.erase(intValueSeek); KeyListPref.insert(std::make_pair(intValueSeek, intPref));
7044 // Something else we don't know about so append
7045 // to the tokens variable.
7047 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
7049 if (FirstToken == TRUE){
7051 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
7056 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
7066 intPropertyLen = wxSPropertySeg2.Len();
7067 SplitPoints.clear();
7068 SplitLength.clear();
7073 for (int i = 0; i <= intPropertyLen; i++){
7077 if (wxSPropertySeg2.Mid(i, 1) == wxT(";") && wxSPropertySeg2.Mid((i - 1), 1) != wxT("\\")){
7080 SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
7082 if (intSplitsFound == 6){
7084 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
7089 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
7100 wxString wxSKeyMIME;
7101 wxString wxSKeyEncoding;
7102 wxString wxSKeyData;
7103 std::string base64enc;
7105 if (intSplitsFound = 0){
7109 std::map<int, int>::iterator striter;
7111 striter = SplitLength.find(1);
7113 wxStringTokenizer wSTDataType(wxSPropertySeg2.Mid(0, striter->second), wxT(":"));
7115 while (wSTDataType.HasMoreTokens() == TRUE){
7117 wxSKeyURI = wSTDataType.GetNextToken();
7118 wxSKeyMIME = wSTDataType.GetNextToken();
7123 if (wxSKeyURI == wxT("data")){
7125 wxStringTokenizer wSTDataInfo(wxSPropertySeg2.Mid((striter->second + 2)), wxT(","));
7127 while (wSTDataInfo.HasMoreTokens() == TRUE){
7129 wxSKeyEncoding = wSTDataInfo.GetNextToken();
7130 wxSKeyData = wSTDataInfo.GetNextToken();
7139 // Add the data to the General/Home/Work address variables.
7143 coldata.SetId(intValueSeek);
7144 coldata.SetData(intValueSeek);
7146 if (wxSKeyURI == wxT("data")){
7148 if (wxSKeyMIME == wxT("application/pgp-keys")){
7150 coldata.SetText(_("PGP Key"));
7154 coldata.SetText(_("Key"));
7158 KeyListDataEncType.erase(intValueSeek);
7159 KeyListKeyType.erase(intValueSeek);
7160 KeyListDataEncType.insert(std::make_pair(intValueSeek, wxSKeyEncoding));
7161 KeyListKeyType.insert(std::make_pair(intValueSeek, TRUE));
7163 KeyList.erase(intValueSeek);
7164 KeyList.insert(std::make_pair(intValueSeek, wxSKeyData));
7168 coldata.SetText(wxSPropertySeg2);
7170 KeyList.erase(intValueSeek);
7171 KeyList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
7175 ListCtrlIndex = lboKeys->InsertItem(coldata);
7177 if (intPref > 0 && intPref < 101){
7179 lboKeys->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
7184 KeyListType.erase(intValueSeek);
7185 KeyListTokens.erase(intValueSeek);
7186 KeyListDataType.erase(intValueSeek);
7188 KeyListDataType.insert(std::make_pair(intValueSeek, wxSKeyMIME));
7192 KeyListType.insert(std::make_pair(intValueSeek, wxT("")));
7194 } else if (intType = 1){
7196 KeyListType.insert(std::make_pair(intValueSeek, wxT("home")));
7198 } else if (intType = 2){
7200 KeyListType.insert(std::make_pair(intValueSeek, wxT("work")));
7204 KeyListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
7209 } else if (wxSProperty == wxT("UID") && UIDProcessed == FALSE){
7211 UIDToken = wxSPropertySeg2;
7212 UIDProcessed = TRUE;
7214 } else if (wxSProperty.Mid(0, 3) == wxT("VND")){
7216 // Split the Vendor three ways.
7218 wxStringTokenizer wSTVendorDetails(wxSPropertySeg1, wxT("-"));
7221 wxString wxSVNDPropName;
7224 while (wSTVendorDetails.HasMoreTokens() == TRUE){
7226 wSTVendorDetails.GetNextToken();
7227 wxSVNDID = wSTVendorDetails.GetNextToken();
7228 wxSVNDPropName = wSTVendorDetails.GetNextToken();
7233 if (!wxSVNDID.IsEmpty() && !wxSVNDPropName.IsEmpty()){
7235 // Setup the values for later processing.
7237 VendorList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
7238 VendorListPEN.insert(std::make_pair(intValueSeek, wxSVNDID));
7239 VendorListElement.insert(std::make_pair(intValueSeek, wxSVNDPropName));
7241 // Add the data to the vendor variables.
7245 coldata.SetId(intValueSeek);
7246 coldata.SetData(intValueSeek);
7247 coldata.SetText(wxSVNDID + wxT("-") + wxSVNDPropName);
7249 ListCtrlIndex = lboVendorNamespace->InsertItem(coldata);
7251 VendorList.erase(intValueSeek);
7252 VendorListPEN.erase(intValueSeek);
7253 VendorListElement.erase(intValueSeek);
7255 VendorList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
7256 VendorListPEN.insert(std::make_pair(intValueSeek, wxSVNDID));
7257 VendorListElement.insert(std::make_pair(intValueSeek, wxSVNDPropName));
7264 } else if (wxSProperty.Mid(0, 2) == wxT("X-")){
7268 XTokenList.insert(std::make_pair(intValueSeek, wxSPropertySeg2));
7269 XTokenListTokens.insert(std::make_pair(intValueSeek, wxSPropertySeg1.Mid(2)));
7275 coldata.SetId(intValueSeek);
7276 coldata.SetData(intValueSeek);
7277 coldata.SetText(wxSPropertySeg1.Mid(2));
7279 ListCtrlIndex = lboXToken->InsertItem(coldata);
7287 // Reset the variables.
7290 PropertyFind = TRUE;
7291 ExtraLineSeek = TRUE;
7293 QuoteBreakPoint = 0;
7294 ContactLine.Clear();
7295 wxSProperty.Clear();
7299 FMTimer.SetFilename(Filename);
7300 FMTimer.Start(10000, FALSE);
7307 void frmContactEditor::SplitValues(wxString *PropertyLine,
7308 std::map<int,int> *SplitPoints,
7309 std::map<int,int> *SplitLength,
7312 int intPropertyLen = PropertyLine->Len();
7313 int intSplitsFound = 0;
7314 int intSplitSize = 0;
7315 int intSplitSeek = 0;
7317 for (int i = intSize; i <= intPropertyLen; i++){
7321 if (PropertyLine->Mid(i, 1) == wxT(";") &&
7322 PropertyLine->Mid((i - 1), 1) != wxT("\\")){
7324 if (intSplitsFound == 0){
7326 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
7330 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
7334 SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
7344 if (intSplitsFound == 0){
7346 SplitPoints->insert(std::make_pair(intSplitsFound, (8 + 1)));
7347 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
7351 SplitPoints->insert(std::make_pair(intSplitsFound, (intSplitSeek + 1)));
7352 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));