Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Fixed alignment in ConvertV4PropertyProc.
[xestiaab/.git] / source / vcard / vcard34conv.cpp
1 // vcard34conv.cpp - vCard34Conv Object
2 //
3 // (c) 2012-2015 Xestia Software Development.
4 //
5 // This file is part of Xestia Address Book.
6 //
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
10 //
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
19 #include "vcard34conv.h"
20 #include "vcard.h"
21 #include "../version.h"
22 #include "../common/textprocessing.h"
23 #include <wx/file.h>
24 #include <cmath>
25 #include <map>
27 #include <wx/ffile.h>
28 #include <wx/tokenzr.h>
29 #include <wx/datetime.h>
30 #include <wx/wx.h>
32 // vcard.cpp - Deals with vCard 4.0 formatted files meeting the
33 // RFC 6350 specification.
35 vCard34Conv::vCard34Conv(){
36     vCardBegin = FALSE;
37     vCardEnd = FALSE;
38     vCardFN = FALSE;
39     vCardVersion = 0.0;
40     SettingCount = 0;
41 }
43 void vCard34Conv::ConvertV4PropertyProc(wxString *wxSPropertyName, 
44         wxString *wxSPropertySeg1Ptr, wxString *wxSPropertySeg2Ptr, 
45         wxString *wxSPropertyPropValuesOut, wxString *wxSPropertyDataOut, 
46         wxString *wxSPropertyXVCard4Value, wxString *wxSPropertyDataNameOut,
47         std::map<wxString,wxString> *PropertyDataMap, 
48         std::map<wxString,bool> *PropertyLockMap,
49         bool ProcessItemData, bool *VCardV3Value, bool *XVCardV4Value){
51         wxString wxSProperty;
52         wxString wxSPropertySeg1Chopped;
53         size_t intPropertyLen;
54     
55         if (ProcessItemData == TRUE){
56                 
57                 wxStringTokenizer wxSPropertySplit(*wxSPropertyName, wxT("."));
58         
59                 wxSPropertySplit.GetNextToken();
60                 wxSProperty = wxSPropertySplit.GetNextToken();
61         
62                 // Look for . in wxSPropertySeg1Ptr and remove all data before
63                 // the .
64         
65                 int ItemSeek = wxSPropertySeg1Ptr->Find(wxT("."));
66                 wxSPropertySeg1Chopped = wxSPropertySeg1Ptr->Mid((ItemSeek + 1));
67                 
68         
69         } else {
70         
71                 wxSProperty = *wxSPropertyName;
72         
73         }
75         
76         // Go through each of the vCard 3.0 properties.
77         
78         // EMAIL
79         
80         if (wxSProperty == wxT("EMAIL")){
82                 if (ProcessItemData == TRUE){
83         
84                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
85                 
86                 } else {
87                 
88                         intPropertyLen = wxSPropertySeg1Ptr->Len();
89                 
90                 }
91                 
92                 std::map<int, int> SplitPoints;
93                 std::map<int, int> SplitLength;
94                 std::map<int, int>::iterator SLiter;                    
95                 wxString PropertyData;
96                 wxString PropertyName;
97                 wxString PropertyValue;
98                 wxString PropertyTokens;
99                 bool FirstToken = TRUE;
100                 int intPrevValue = 7;
101                 
102                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
103                 *wxSPropertyDataNameOut = wxT("EMAIL");
104                 *VCardV3Value = TRUE;
105                 
106                 if (ProcessItemData == TRUE){
107                 
108                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
109                         
110                 } else {
111                         
112                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
113                         
114                 }
115                 
116                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
117                 intiter != SplitPoints.end(); ++intiter){
118                 
119                         SLiter = SplitLength.find(intiter->first);
120                 
121                         if (ProcessItemData == TRUE){
122                 
123                                 if (FirstToken == TRUE){
124                         
125                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
126                                         FirstToken = FALSE;
127                         
128                                 } else {
129                                 
130                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
131                                 
132                                 }
133                         
134                         } else {                        
135                                 
136                                 if (FirstToken == TRUE){
137                         
138                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
139                                         FirstToken = FALSE;
140                         
141                                 } else {
142                                 
143                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
144                                 
145                                 }
146                         
147                         }
148                         
149                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
150                         PropertyName = PropertyElement.GetNextToken();                          
151                         PropertyValue = PropertyElement.GetNextToken();
152                         
153                         //ProcessCaptureStrings(&PropertyValue);
154                         
155                         intPrevValue = intiter->second;
156                         
157                         if (PropertyName == wxT("type") && PropertyValue == wxT("INTERNET")){
158                                 continue;
159                         }
160                                 
161                         if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
162                                 
163                                 if (ProcessItemData == FALSE){
164                                         PropertyName = wxT("PREF");
165                                         PropertyValue = wxT("50");
166                                 } else {
167                                         continue;
168                                 }
169                                 
170                         }
171                         
172                         if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
173                                 PropertyValue = wxT("home");
174                         }
175                         
176                         if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
177                                 PropertyValue = wxT("work");
178                         }
180                         if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
181                                 PropertyName = wxT("X-TYPE");
182                                 PropertyValue = wxT("other");
183                         }
184                         
185                         // Process properties.
186                         
187                         if (PropertyName.IsEmpty()){
188                         
189                                 continue;
190                         
191                         }
192                         
193                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
195                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
196                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
197         
198                         } else {
199                         
200                                 PropertyDataMap->erase(PropertyName);
201                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
202                                 PropertyLockMap->erase(PropertyName);
203                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
204                         
205                         }
206                 
207                 }
208         
209         }
210         
211         // ADR
212         
213         if (wxSProperty == wxT("ADR")){
215                 if (ProcessItemData == TRUE){
216         
217                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
218                 
219                 } else {
220                 
221                         intPropertyLen = wxSPropertySeg1Ptr->Len();
222                 
223                 }
224                 
225                 std::map<int, int> SplitPoints;
226                 std::map<int, int> SplitLength;
227                 std::map<int, int>::iterator SLiter;                    
228                 wxString PropertyData;
229                 wxString PropertyName;
230                 wxString PropertyValue;
231                 wxString PropertyTokens;
232                 bool FirstToken = TRUE;
233                 int intPrevValue = 5;
234                 
235                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
236                 *wxSPropertyDataNameOut = wxT("ADR");
237                 *VCardV3Value = TRUE;
238                 
239                 if (ProcessItemData == TRUE){
240                 
241                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
242                         
243                 } else {
244                         
245                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
246                         
247                 }
248                 
249                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
250                 intiter != SplitPoints.end(); ++intiter){
251                 
252                         SLiter = SplitLength.find(intiter->first);
253                 
254                         if (ProcessItemData == TRUE){
255                 
256                                 if (FirstToken == TRUE){
257                         
258                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
259                                         FirstToken = FALSE;
260                         
261                                 } else {
262                                 
263                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
264                                 
265                                 }
266                         
267                         } else {                        
268                                 
269                                 if (FirstToken == TRUE){
270                         
271                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
272                                         FirstToken = FALSE;
273                         
274                                 } else {
275                                 
276                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
277                                 
278                                 }
279                         
280                         }
281                         
282                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
283                         PropertyName = PropertyElement.GetNextToken();                          
284                         PropertyValue = PropertyElement.GetNextToken();
285                         
286                         intPrevValue = intiter->second;
287                                 
288                         if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
289                                 
290                                 if (ProcessItemData == FALSE){
291                                         PropertyName = wxT("PREF");
292                                         PropertyValue = wxT("50");
293                                 } else {
294                                         continue;
295                                 }
296                                 
297                         }
298                         
299                         if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
300                                 PropertyValue = wxT("home");
301                         }
302                         
303                         if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
304                                 PropertyValue = wxT("work");
305                         }
307                         if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
308                                 PropertyName = wxT("X-TYPE");
309                                 PropertyValue = wxT("other");
310                         }
311                         
312                         // Process properties.
313                         
314                         if (PropertyName.IsEmpty()){
315                         
316                                 continue;
317                         
318                         }
319                         
320                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
322                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
323                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
324         
325                         } else {
326                         
327                                 PropertyDataMap->erase(PropertyName);
328                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
329                                 PropertyLockMap->erase(PropertyName);
330                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
331                         
332                         }
333                 
334                 }
335         
336         }
337         
338         // LABEL
339         
340         if (wxSProperty == wxT("LABEL")){
342                 if (ProcessItemData == TRUE){
343         
344                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
345                 
346                 } else {
347                 
348                         intPropertyLen = wxSPropertySeg1Ptr->Len();
349                 
350                 }
351                 
352                 std::map<int, int> SplitPoints;
353                 std::map<int, int> SplitLength;
354                 std::map<int, int>::iterator SLiter;                    
355                 wxString PropertyData;
356                 wxString PropertyName;
357                 wxString PropertyValue;
358                 wxString PropertyTokens;
359                 bool FirstToken = TRUE;
360                 int intPrevValue = 7;
361                 
362                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
363                 *wxSPropertyDataNameOut = wxT("ADR");
364                 *VCardV3Value = TRUE;
365                 
366                 if (ProcessItemData == TRUE){
367                 
368                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
369                         
370                 } else {
371                         
372                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
373                         
374                 }
375                 
376                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
377                 intiter != SplitPoints.end(); ++intiter){
378                 
379                         SLiter = SplitLength.find(intiter->first);
380                 
381                         if (ProcessItemData == TRUE){
382                 
383                                 if (FirstToken == TRUE){
384                         
385                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
386                                         FirstToken = FALSE;
387                         
388                                 } else {
389                                 
390                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
391                                 
392                                 }
393                         
394                         } else {                        
395                                 
396                                 if (FirstToken == TRUE){
397                         
398                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
399                                         FirstToken = FALSE;
400                         
401                                 } else {
402                                 
403                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
404                                 
405                                 }
406                         
407                         }
408                         
409                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
410                         PropertyName = PropertyElement.GetNextToken();                          
411                         PropertyValue = PropertyElement.GetNextToken();
412                         
413                         intPrevValue = intiter->second;
414                                 
415                         if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
416                                 continue;
417                         }
418                         
419                         if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
420                                 PropertyValue = wxT("home");
421                         }
422                         
423                         if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
424                                 PropertyValue = wxT("work");
425                         }
427                         if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
428                                 PropertyName = wxT("X-TYPE");
429                                 PropertyValue = wxT("other");
430                         }
431                         
432                         // Process properties.
433                         
434                         if (PropertyName.IsEmpty()){
435                         
436                                 continue;
437                         
438                         }
439                         
440                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
442                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
443                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
444         
445                         } else {
446                         
447                                 PropertyDataMap->erase(PropertyName);
448                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
449                                 PropertyLockMap->erase(PropertyName);
450                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
451                         
452                         }
453                 
454                 }
455                 
456                 PropertyDataMap->insert(std::make_pair(wxT("X-LABEL"), wxT("TRUE")));
457         
458         }
459         
460         // IMPP
461         
462         if (wxSProperty == wxT("IMPP")){
464                 if (ProcessItemData == TRUE){
465         
466                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
467                 
468                 } else {
469                 
470                         intPropertyLen = wxSPropertySeg1Ptr->Len();
471                 
472                 }
473                 
474                 std::map<int, int> SplitPoints;
475                 std::map<int, int> SplitLength;
476                 std::map<int, int>::iterator SLiter;                    
477                 wxString PropertyData;
478                 wxString PropertyName;
479                 wxString PropertyValue;
480                 wxString PropertyTokens;
481                 bool FirstToken = TRUE;
482                 int intPrevValue = 6;
483                 
484                 wxStringTokenizer IMPPSplit(*wxSPropertySeg2Ptr, wxT(":"));
485                 wxString IMPPType;
486                 wxString IMPPData;
487                 
488                 IMPPType = IMPPSplit.GetNextToken();
489                 
490                 if (IMPPSplit.HasMoreTokens()){
491                 
492                         IMPPData = IMPPSplit.GetNextToken();
493                 
494                         if (IMPPType == wxT("ymsgr")){
495                         
496                                 IMPPType = wxT("yahoo");
497                         
498                         }
499                         
500                         *wxSPropertySeg2Ptr = IMPPType + wxT(":") + IMPPData;
501                 
502                 }
503                 
504                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
505                 *wxSPropertyDataNameOut = wxT("IMPP");
506                 *VCardV3Value = TRUE;
507                 
508                 if (ProcessItemData == TRUE){
509                 
510                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
511                         
512                 } else {
513                         
514                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
515                         
516                 }
517                 
518                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
519                 intiter != SplitPoints.end(); ++intiter){
520                 
521                         SLiter = SplitLength.find(intiter->first);
522                 
523                         if (ProcessItemData == TRUE){
524                 
525                                 if (FirstToken == TRUE){
526                         
527                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
528                                         FirstToken = FALSE;
529                         
530                                 } else {
531                                 
532                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
533                                 
534                                 }
535                         
536                         } else {                        
537                                 
538                                 if (FirstToken == TRUE){
539                         
540                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
541                                         FirstToken = FALSE;
542                         
543                                 } else {
544                                 
545                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
546                                 
547                                 }
548                         
549                         }
550                         
551                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
552                         PropertyName = PropertyElement.GetNextToken();                          
553                         PropertyValue = PropertyElement.GetNextToken();
554                         
555                         intPrevValue = intiter->second;
556                                 
557                         if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
558                                 continue;
559                         }
560                         
561                         if (PropertyName == wxT("X-SERVICE-TYPE")){
562                                 continue;
563                         }
564                         
565                         if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
566                                 PropertyValue = wxT("home");
567                         }
568                         
569                         if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
570                                 PropertyValue = wxT("work");
571                         }
573                         if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
574                                 PropertyName = wxT("X-TYPE");
575                                 PropertyValue = wxT("other");
576                         }
577                         
578                         // Process properties.
579                         
580                         if (PropertyName.IsEmpty()){
581                         
582                                 continue;
583                         
584                         }
585                         
586                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
588                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
589                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
590         
591                         } else {
592                         
593                                 PropertyDataMap->erase(PropertyName);
594                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
595                                 PropertyLockMap->erase(PropertyName);
596                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
597                         
598                         }
599                 
600                 }
601         
602         }
603         
604         // TEL
605         
606         if (wxSProperty == wxT("TEL")){
608                 if (ProcessItemData == TRUE){
609         
610                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
611                 
612                 } else {
613                 
614                         intPropertyLen = wxSPropertySeg1Ptr->Len();
615                 
616                 }
617                 
618                 std::map<int, int> SplitPoints;
619                 std::map<int, int> SplitLength;
620                 std::map<int, int>::iterator SLiter;
621                 std::map<wxString, wxString> TelType;                   
622                 wxString PropertyData;
623                 wxString PropertyName;
624                 wxString PropertyValue;
625                 wxString PropertyTokens;
626                 bool FirstToken = TRUE;
627                 int intPrevValue = 5;
628                 
629                 wxSPropertyDataOut->Append(wxT("tel:"));
630                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
631                 *wxSPropertyDataNameOut = wxT("TEL");
632                 *VCardV3Value = TRUE;
633                 
634                 if (ProcessItemData == TRUE){
635                 
636                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
637                         
638                 } else {
639                         
640                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
641                         
642                 }
643                 
644                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
645                 intiter != SplitPoints.end(); ++intiter){
646                 
647                         SLiter = SplitLength.find(intiter->first);
648                 
649                         if (ProcessItemData == TRUE){
650                 
651                                 if (FirstToken == TRUE){
652                         
653                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
654                                         FirstToken = FALSE;
655                         
656                                 } else {
657                                 
658                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
659                                 
660                                 }
661                         
662                         } else {                        
663                                 
664                                 if (FirstToken == TRUE){
665                         
666                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
667                                         FirstToken = FALSE;
668                         
669                                 } else {
670                                 
671                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
672                                 
673                                 }
674                         
675                         }
676                         
677                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
678                         PropertyName = PropertyElement.GetNextToken();                          
679                         PropertyValue = PropertyElement.GetNextToken();
680                         
681                         intPrevValue = intiter->second;
682                                 
683                         if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
684                                 continue;
685                         }
686                         
687                         if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
688                                 TelType.insert(std::make_pair(wxT("home"), wxT("home")));
689                                 continue;
690                         }
691                         
692                         if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
693                                 TelType.insert(std::make_pair(wxT("work"), wxT("work")));
694                                 continue;
695                         }
697                         if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
698                                 PropertyName = wxT("X-TYPE");
699                                 PropertyValue = wxT("other");
700                         }
701                         
702                         // Process the telephone type options.
703                         
704                         // text
705                         
706                         if (PropertyName == wxT("type") && (PropertyValue == wxT("TEXT") || PropertyValue == wxT("text"))){
707                                 TelType.insert(std::make_pair(wxT("text"), wxT("text")));
708                                 continue;
709                         }
710                         
711                         // voice
712                         
713                         if (PropertyName == wxT("type") && (PropertyValue == wxT("VOICE") || PropertyValue == wxT("voice"))){
714                                 TelType.insert(std::make_pair(wxT("voice"), wxT("voice")));
715                                 continue;
716                         }
717                         
718                         // fax
719                         
720                         if (PropertyName == wxT("type") && (PropertyValue == wxT("FAX") || PropertyValue == wxT("fax"))){
721                                 TelType.insert(std::make_pair(wxT("fax"), wxT("fax")));
722                                 continue;
723                         }
724                         
725                         // cell
726                         
727                         if (PropertyName == wxT("type") && (PropertyValue == wxT("CELL") || PropertyValue == wxT("cell"))){
728                                 TelType.insert(std::make_pair(wxT("cell"), wxT("cell")));
729                                 continue;
730                         }
731                         
732                         // video
733                         
734                         if (PropertyName == wxT("type") && (PropertyValue == wxT("VIDEO") || PropertyValue == wxT("video"))){
735                                 TelType.insert(std::make_pair(wxT("video"), wxT("video")));
736                                 continue;
737                         }
738                         
739                         // pager
740                         
741                         if (PropertyName == wxT("type") && (PropertyValue == wxT("PAGER") || PropertyValue == wxT("pager"))){
742                                 TelType.insert(std::make_pair(wxT("pager"), wxT("pager")));
743                                 continue;
744                         }
745                         
746                         // textphone
747                         
748                         if (PropertyName == wxT("type") && (PropertyValue == wxT("TEXTPHONE") || PropertyValue == wxT("textphone"))){
749                                 TelType.insert(std::make_pair(wxT("textphone"), wxT("textphone")));
750                                 continue;
751                         }
752                         
753                         if (PropertyName == wxT("type") && PropertyValue.Find(wxT(",")) != wxNOT_FOUND){
754                                 wxStringTokenizer TypeSplit(PropertyValue, wxT(","));
755                                 wxString TypeSplitData;
756                                 while (TypeSplit.HasMoreTokens()){
757                                 
758                                         TypeSplitData = TypeSplit.GetNextToken();
759                                         TelType.insert(std::make_pair(TypeSplitData, TypeSplitData));
760                                         TypeSplitData.clear();
761                                 
762                                 }
763                                 
764                         }
765                         
766                         // Process properties.
767                         
768                         if (PropertyName.IsEmpty()){
769                         
770                                 continue;
771                         
772                         }
773                         
774                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
776                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
777                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
778         
779                         } else {
780                         
781                                 PropertyDataMap->erase(PropertyName);
782                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
783                                 PropertyLockMap->erase(PropertyName);
784                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
785                         
786                         }
787                 
788                 }
789                 
790                 wxString TelFinalString;
791                 bool TelFirstToken = TRUE;
792                 
793                 for (std::map<wxString, wxString>::iterator intiter = TelType.begin(); 
794                 intiter != TelType.end(); ++intiter){
795                 
796                         // Process the type data into a single value. (e.g. TYPE="work,voice,cell").
797                         
798                         if (TelFirstToken == TRUE){
799                         
800                                 TelFinalString.Append(wxT("\""));
801                                 TelFinalString.Append(intiter->first);
802                                 TelFirstToken = FALSE;
803                         
804                         } else {
805                         
806                                 TelFinalString.Append(wxT(","));
807                                 TelFinalString.Append(intiter->first);
808                         
809                         }
810                 
811                 }
812                 
813                 if (TelFirstToken == FALSE){
814                 
815                         TelFinalString.Append(wxT("\""));
816                 
817                 }
818                 
819                 if (!TelFinalString.IsEmpty()){
820                 
821                         if (PropertyDataMap->find(wxT("TYPE")) == PropertyDataMap->end()){
823                                 PropertyDataMap->insert(std::make_pair(wxT("type"), TelFinalString));
824                                 PropertyLockMap->insert(std::make_pair(wxT("type"), TRUE));
825         
826                         } else {
827                         
828                                 PropertyDataMap->erase(PropertyName);
829                                 PropertyDataMap->insert(std::make_pair(wxT("type"), TelFinalString));
830                                 PropertyLockMap->erase(PropertyName);
831                                 PropertyLockMap->insert(std::make_pair(wxT("type"), TRUE));
832                         
833                         }
834                 
835                 }
836         
837         }
838         
839         // RELATED
840         
841         if (wxSProperty == wxT("X-ABRELATEDNAMES")){
843                 if (ProcessItemData == TRUE){
844         
845                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
846                 
847                 } else {
848                 
849                         intPropertyLen = wxSPropertySeg1Ptr->Len();
850                 
851                 }
852                 
853                 std::map<int, int> SplitPoints;
854                 std::map<int, int> SplitLength;
855                 std::map<int, int>::iterator SLiter;                    
856                 wxString PropertyData;
857                 wxString PropertyName;
858                 wxString PropertyValue;
859                 wxString PropertyTokens;
860                 bool FirstToken = TRUE;
861                 int intPrevValue = 18;
862                 
863                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
864                 *wxSPropertyDataNameOut = wxT("RELATED");
865                 *VCardV3Value = TRUE;
866                 
867                 if (ProcessItemData == TRUE){
868                 
869                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
870                         
871                 } else {
872                         
873                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
874                         
875                 }
876                 
877                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
878                 intiter != SplitPoints.end(); ++intiter){
879                 
880                         SLiter = SplitLength.find(intiter->first);
881                 
882                         if (ProcessItemData == TRUE){
883                 
884                                 if (FirstToken == TRUE){
885                         
886                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
887                                         FirstToken = FALSE;
888                         
889                                 } else {
890                                 
891                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
892                                 
893                                 }
894                         
895                         } else {                        
896                                 
897                                 if (FirstToken == TRUE){
898                         
899                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
900                                         FirstToken = FALSE;
901                         
902                                 } else {
903                                 
904                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
905                                 
906                                 }
907                         
908                         }
909                         
910                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
911                         PropertyName = PropertyElement.GetNextToken();                          
912                         PropertyValue = PropertyElement.GetNextToken();
913                         
914                         //ProcessCaptureStrings(&PropertyValue);
915                         
916                         intPrevValue = intiter->second;
917                                 
918                         if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
919                                 continue;
920                         }
921                         
922                         // Process properties.
923                         
924                         if (PropertyName.IsEmpty()){
925                         
926                                 continue;
927                         
928                         }
929                         
930                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
932                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
933                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
934         
935                         } else {
936                         
937                                 PropertyDataMap->erase(PropertyName);
938                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
939                                 PropertyLockMap->erase(PropertyName);
940                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
941                         
942                         }
943                 
944                 }
945         
946         }
947         
948         // URL
949         
950         if (wxSProperty == wxT("URL")){
952                 if (ProcessItemData == TRUE){
953         
954                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
955                 
956                 } else {
957                 
958                         intPropertyLen = wxSPropertySeg1Ptr->Len();
959                 
960                 }
961                 
962                 std::map<int, int> SplitPoints;
963                 std::map<int, int> SplitLength;
964                 std::map<int, int>::iterator SLiter;                    
965                 wxString PropertyData;
966                 wxString PropertyName;
967                 wxString PropertyValue;
968                 wxString PropertyTokens;
969                 bool FirstToken = TRUE;
970                 int intPrevValue = 5;
971                 
972                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
973                 *wxSPropertyDataNameOut = wxT("URL");
974                 *VCardV3Value = TRUE;
975                 
976                 if (ProcessItemData == TRUE){
977                 
978                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
979                         
980                 } else {
981                         
982                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
983                         
984                 }
985                 
986                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
987                 intiter != SplitPoints.end(); ++intiter){
988                 
989                         SLiter = SplitLength.find(intiter->first);
990                 
991                         if (ProcessItemData == TRUE){
992                 
993                                 if (FirstToken == TRUE){
994                         
995                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
996                                         FirstToken = FALSE;
997                         
998                                 } else {
999                                 
1000                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1001                                 
1002                                 }
1003                         
1004                         } else {                        
1005                                 
1006                                 if (FirstToken == TRUE){
1007                         
1008                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1009                                         FirstToken = FALSE;
1010                         
1011                                 } else {
1012                                 
1013                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1014                                 
1015                                 }
1016                         
1017                         }
1018                         
1019                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1020                         PropertyName = PropertyElement.GetNextToken();                          
1021                         PropertyValue = PropertyElement.GetNextToken();
1022                         
1023                         intPrevValue = intiter->second;
1024                                 
1025                         if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
1026                                 continue;
1027                         }
1028                         
1029                         if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
1030                                 PropertyValue = wxT("home");
1031                         }
1032                         
1033                         if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
1034                                 PropertyValue = wxT("work");
1035                         }
1037                         if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
1038                                 PropertyName = wxT("X-TYPE");
1039                                 PropertyValue = wxT("other");
1040                         }
1041                         
1042                         // Process properties.
1043                         
1044                         if (PropertyName.IsEmpty()){
1045                         
1046                                 continue;
1047                         
1048                         }
1049                         
1050                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1052                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1053                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1054         
1055                         } else {
1056                         
1057                                 PropertyDataMap->erase(PropertyName);
1058                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1059                                 PropertyLockMap->erase(PropertyName);
1060                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1061                         
1062                         }
1063                 
1064                 }
1065         
1066         }
1067         
1068         // TITLE
1069         
1070         if (wxSProperty == wxT("TITLE")){
1071                 
1072                 if (ProcessItemData == TRUE){
1073         
1074                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
1075                 
1076                 } else {
1077                 
1078                         intPropertyLen = wxSPropertySeg1Ptr->Len();
1079                 
1080                 }
1081                 
1082                 std::map<int, int> SplitPoints;
1083                 std::map<int, int> SplitLength;
1084                 std::map<int, int>::iterator SLiter;                    
1085                 wxString PropertyData;
1086                 wxString PropertyName;
1087                 wxString PropertyValue;
1088                 wxString PropertyTokens;
1089                 bool FirstToken = TRUE;
1090                 int intPrevValue = 7;
1091                 
1092                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1093                 *wxSPropertyDataNameOut = wxT("TITLE");
1094                 *VCardV3Value = TRUE;
1095                 
1096                 if (ProcessItemData == TRUE){
1097                 
1098                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1099                         
1100                 } else {
1101                         
1102                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1103                         
1104                 }
1105                 
1106                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
1107                 intiter != SplitPoints.end(); ++intiter){
1108                 
1109                         SLiter = SplitLength.find(intiter->first);
1110                 
1111                         if (ProcessItemData == TRUE){
1112                 
1113                                 if (FirstToken == TRUE){
1114                         
1115                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1116                                         FirstToken = FALSE;
1117                         
1118                                 } else {
1119                                 
1120                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1121                                 
1122                                 }
1123                         
1124                         } else {                        
1125                                 
1126                                 if (FirstToken == TRUE){
1127                         
1128                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1129                                         FirstToken = FALSE;
1130                         
1131                                 } else {
1132                                 
1133                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1134                                 
1135                                 }
1136                         
1137                         }
1138                         
1139                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1140                         PropertyName = PropertyElement.GetNextToken();                          
1141                         PropertyValue = PropertyElement.GetNextToken();
1143                         intPrevValue = intiter->second;
1144                         
1145                         // Process properties.
1146                         
1147                         if (PropertyName.IsEmpty()){
1148                         
1149                                 continue;
1150                         
1151                         }
1152                         
1153                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1155                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1156                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1157         
1158                         } else {
1159                         
1160                                 PropertyDataMap->erase(PropertyName);
1161                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1162                                 PropertyLockMap->erase(PropertyName);
1163                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1164                         
1165                         }
1166                 
1167                 }
1168         
1169         }
1170         
1171         // FN
1172         
1173         if (wxSProperty == wxT("FN")){
1175                 if (ProcessItemData == TRUE){
1176         
1177                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
1178                 
1179                 } else {
1180                 
1181                         intPropertyLen = wxSPropertySeg1Ptr->Len();
1182                 
1183                 }
1184                 
1185                 std::map<int, int> SplitPoints;
1186                 std::map<int, int> SplitLength;
1187                 std::map<int, int>::iterator SLiter;                    
1188                 wxString PropertyData;
1189                 wxString PropertyName;
1190                 wxString PropertyValue;
1191                 wxString PropertyTokens;
1192                 bool FirstToken = TRUE;
1193                 int intPrevValue = 4;
1194                 
1195                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1196                 *wxSPropertyDataNameOut = wxT("FN");
1197                 *VCardV3Value = TRUE;
1198                 
1199                 if (ProcessItemData == TRUE){
1200                 
1201                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1202                         
1203                 } else {
1204                         
1205                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1206                         
1207                 }
1208                 
1209                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
1210                 intiter != SplitPoints.end(); ++intiter){
1211                 
1212                         SLiter = SplitLength.find(intiter->first);
1213                 
1214                         if (ProcessItemData == TRUE){
1215                 
1216                                 if (FirstToken == TRUE){
1217                         
1218                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1219                                         FirstToken = FALSE;
1220                         
1221                                 } else {
1222                                 
1223                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1224                                 
1225                                 }
1226                         
1227                         } else {                        
1228                                 
1229                                 if (FirstToken == TRUE){
1230                         
1231                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1232                                         FirstToken = FALSE;
1233                         
1234                                 } else {
1235                                 
1236                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1237                                 
1238                                 }
1239                         
1240                         }
1241                         
1242                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1243                         PropertyName = PropertyElement.GetNextToken();                          
1244                         PropertyValue = PropertyElement.GetNextToken();
1245                         
1246                         intPrevValue = intiter->second;
1247                         
1248                         // Process properties.
1249                         
1250                         if (PropertyName.IsEmpty()){
1251                         
1252                                 continue;
1253                         
1254                         }
1255                         
1256                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1258                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1259                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1260         
1261                         } else {
1262                         
1263                                 PropertyDataMap->erase(PropertyName);
1264                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1265                                 PropertyLockMap->erase(PropertyName);
1266                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1267                         
1268                         }
1269                 
1270                 }
1271         
1272         }
1273         
1274         // N
1275         
1276         if (wxSProperty == wxT("N")){
1278                 if (ProcessItemData == TRUE){
1279         
1280                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
1281                 
1282                 } else {
1283                 
1284                         intPropertyLen = wxSPropertySeg1Ptr->Len();
1285                 
1286                 }
1287                 
1288                 std::map<int, int> SplitPoints;
1289                 std::map<int, int> SplitLength;
1290                 std::map<int, int>::iterator SLiter;                    
1291                 wxString PropertyData;
1292                 wxString PropertyName;
1293                 wxString PropertyValue;
1294                 wxString PropertyTokens;
1295                 bool FirstToken = TRUE;
1296         int intPrevValue = 3;
1297         
1298                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1299                 *wxSPropertyDataNameOut = wxT("N");
1300                 *VCardV3Value = TRUE;
1301                 
1302                 if (ProcessItemData == TRUE){
1303                 
1304                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1305                         
1306                 } else {
1307                         
1308                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1309                         
1310                 }
1311                 
1312                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
1313                 intiter != SplitPoints.end(); ++intiter){
1314                 
1315                         SLiter = SplitLength.find(intiter->first);
1316                 
1317                         if (ProcessItemData == TRUE){
1318                 
1319                                 if (FirstToken == TRUE){
1320                         
1321                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1322                                         FirstToken = FALSE;
1323                         
1324                                 } else {
1325                                 
1326                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1327                                 
1328                                 }
1329                         
1330                         } else {                        
1331                                 
1332                                 if (FirstToken == TRUE){
1333                         
1334                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1335                                         FirstToken = FALSE;
1336                         
1337                                 } else {
1338                                 
1339                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1340                                 
1341                                 }
1342                         
1343                         }
1344                         
1345                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1346                         PropertyName = PropertyElement.GetNextToken();                          
1347                         PropertyValue = PropertyElement.GetNextToken();
1348                         
1349                         intPrevValue = intiter->second;
1350                         
1351                         // Process properties.
1352                         
1353                         if (PropertyName.IsEmpty()){
1354                         
1355                                 continue;
1356                         
1357                         }
1358                         
1359                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1361                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1362                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1363         
1364                         } else {
1365                         
1366                                 PropertyDataMap->erase(PropertyName);
1367                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1368                                 PropertyLockMap->erase(PropertyName);
1369                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1370                         
1371                         }
1372                 
1373                 }
1374         
1375         }
1376         
1377         // UID
1379         if (wxSProperty == wxT("UID")){
1381                 if (ProcessItemData == TRUE){
1382         
1383                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
1384                 
1385                 } else {
1386                 
1387                         intPropertyLen = wxSPropertySeg1Ptr->Len();
1388                 
1389                 }
1390                 
1391                 std::map<int, int> SplitPoints;
1392                 std::map<int, int> SplitLength;
1393                 std::map<int, int>::iterator SLiter;                    
1394                 wxString PropertyData;
1395                 wxString PropertyName;
1396                 wxString PropertyValue;
1397                 wxString PropertyTokens;
1398                 bool FirstToken = TRUE;
1399                 int intPrevValue = 5;
1400                 
1401                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1402                 *wxSPropertyDataNameOut = wxT("UID");
1403                 *VCardV3Value = TRUE;
1404                 
1405                 if (ProcessItemData == TRUE){
1406                 
1407                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1408                         
1409                 } else {
1410                         
1411                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1412                         
1413                 }
1414                 
1415                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
1416                 intiter != SplitPoints.end(); ++intiter){
1417                 
1418                         SLiter = SplitLength.find(intiter->first);
1419                 
1420                         if (ProcessItemData == TRUE){
1421                 
1422                                 if (FirstToken == TRUE){
1423                         
1424                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1425                                         FirstToken = FALSE;
1426                         
1427                                 } else {
1428                                 
1429                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1430                                 
1431                                 }
1432                         
1433                         } else {                        
1434                                 
1435                                 if (FirstToken == TRUE){
1436                         
1437                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1438                                         FirstToken = FALSE;
1439                         
1440                                 } else {
1441                                 
1442                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1443                                 
1444                                 }
1445                         
1446                         }
1447                         
1448                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1449                         PropertyName = PropertyElement.GetNextToken();                          
1450                         PropertyValue = PropertyElement.GetNextToken();
1451                         
1452                         intPrevValue = intiter->second;
1453                         
1454                         // Process properties.
1456                         if (PropertyName.IsEmpty()){
1457                         
1458                                 continue;
1459                         
1460                         }
1461                                                 
1462                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1464                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1465                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1466         
1467                         } else {
1468                         
1469                                 PropertyDataMap->erase(PropertyName);
1470                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1471                                 PropertyLockMap->erase(PropertyName);
1472                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1473                         
1474                         }
1475                 
1476                 }
1477         
1478         }
1479         
1480         // NICKNAME
1481         
1482         if (wxSProperty == wxT("NICKNAME")){
1484                 if (ProcessItemData == TRUE){
1485         
1486                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
1487                 
1488                 } else {
1489                 
1490                         intPropertyLen = wxSPropertySeg1Ptr->Len();
1491                 
1492                 }
1493                 
1494                 std::map<int, int> SplitPoints;
1495                 std::map<int, int> SplitLength;
1496                 std::map<int, int>::iterator SLiter;                    
1497                 wxString PropertyData;
1498                 wxString PropertyName;
1499                 wxString PropertyValue;
1500                 wxString PropertyTokens;
1501                 bool FirstToken = TRUE;
1502                 int intPrevValue = 10;
1503                 
1504                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1505                 *wxSPropertyDataNameOut = wxT("NICKNAME");
1506                 *VCardV3Value = TRUE;
1507                 
1508                 if (ProcessItemData == TRUE){
1509                 
1510                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1511                         
1512                 } else {
1513                         
1514                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1515                         
1516                 }
1517                 
1518                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
1519                 intiter != SplitPoints.end(); ++intiter){
1520                 
1521                         SLiter = SplitLength.find(intiter->first);
1522                 
1523                         if (ProcessItemData == TRUE){
1524                 
1525                                 if (FirstToken == TRUE){
1526                         
1527                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1528                                         FirstToken = FALSE;
1529                         
1530                                 } else {
1531                                 
1532                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1533                                 
1534                                 }
1535                         
1536                         } else {                        
1537                                 
1538                                 if (FirstToken == TRUE){
1539                         
1540                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1541                                         FirstToken = FALSE;
1542                         
1543                                 } else {
1544                                 
1545                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1546                                 
1547                                 }
1548                         
1549                         }
1550                         
1551                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1552                         PropertyName = PropertyElement.GetNextToken();                          
1553                         PropertyValue = PropertyElement.GetNextToken();
1554                         
1555                         intPrevValue = intiter->second;
1556                         
1557                         // Process properties.
1559                         if (PropertyName.IsEmpty()){
1560                         
1561                                 continue;
1562                         
1563                         }
1564                                                 
1565                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1567                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1568                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1569         
1570                         } else {
1571                         
1572                                 PropertyDataMap->erase(PropertyName);
1573                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1574                                 PropertyLockMap->erase(PropertyName);
1575                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1576                         
1577                         }
1578                 
1579                 }
1580         
1581         }
1582         
1583         // GENDER
1584         
1585         if (wxSProperty == wxT("GENDER")){
1587                 if (ProcessItemData == TRUE){
1588         
1589                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
1590                 
1591                 } else {
1592                 
1593                         intPropertyLen = wxSPropertySeg1Ptr->Len();
1594                 
1595                 }
1596                 
1597                 std::map<int, int> SplitPoints;
1598                 std::map<int, int> SplitLength;
1599                 std::map<int, int>::iterator SLiter;                    
1600                 wxString PropertyData;
1601                 wxString PropertyName;
1602                 wxString PropertyValue;
1603                 wxString PropertyTokens;
1604                 bool FirstToken = TRUE;
1605                 int intPrevValue = 8;
1606                 
1607                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1608                 *wxSPropertyDataNameOut = wxT("GENDER");
1609                 *VCardV3Value = TRUE;
1610                 
1611                 if (ProcessItemData == TRUE){
1612                 
1613                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1614                         
1615                 } else {
1616                         
1617                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1618                         
1619                 }
1620                 
1621                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
1622                 intiter != SplitPoints.end(); ++intiter){
1623                 
1624                         SLiter = SplitLength.find(intiter->first);
1625                 
1626                         if (ProcessItemData == TRUE){
1627                 
1628                                 if (FirstToken == TRUE){
1629                         
1630                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1631                                         FirstToken = FALSE;
1632                         
1633                                 } else {
1634                                 
1635                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1636                                 
1637                                 }
1638                         
1639                         } else {                        
1640                                 
1641                                 if (FirstToken == TRUE){
1642                         
1643                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1644                                         FirstToken = FALSE;
1645                         
1646                                 } else {
1647                                 
1648                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1649                                 
1650                                 }
1651                         
1652                         }
1653                         
1654                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1655                         PropertyName = PropertyElement.GetNextToken();                          
1656                         PropertyValue = PropertyElement.GetNextToken();
1658                         intPrevValue = intiter->second;
1659                         
1660                         // Process properties.
1661                         
1662                         if (PropertyName.IsEmpty()){
1663                         
1664                                 continue;
1665                         
1666                         }
1667                         
1668                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1670                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1671                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1672         
1673                         } else {
1674                         
1675                                 PropertyDataMap->erase(PropertyName);
1676                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1677                                 PropertyLockMap->erase(PropertyName);
1678                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1679                         
1680                         }
1681                 
1682                 }
1683         
1684         }
1685         
1686         // BDAY
1687         
1688         if (wxSProperty == wxT("BDAY")){
1690                 if (ProcessItemData == TRUE){
1691         
1692                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
1693                 
1694                 } else {
1695                 
1696                         intPropertyLen = wxSPropertySeg1Ptr->Len();
1697                 
1698                 }
1699                 
1700                 std::map<int, int> SplitPoints;
1701                 std::map<int, int> SplitLength;
1702                 std::map<int, int>::iterator SLiter;                    
1703                 wxString PropertyData;
1704                 wxString PropertyName;
1705                 wxString PropertyValue;
1706                 wxString PropertyTokens;
1707                 wxString PropertyXOmitYear;
1708                 bool FirstToken = TRUE;
1709                 int intPrevValue = 6;
1710                 
1711                 *wxSPropertyDataNameOut = wxT("BDAY");
1712                 *VCardV3Value = TRUE;
1713                 
1714                 if (ProcessItemData == TRUE){
1715                 
1716                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1717                         
1718                 } else {
1719                         
1720                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1721                         
1722                 }
1723                 
1724                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
1725                 intiter != SplitPoints.end(); ++intiter){
1726                 
1727                         SLiter = SplitLength.find(intiter->first);
1728                 
1729                         if (ProcessItemData == TRUE){
1730                 
1731                                 if (FirstToken == TRUE){
1732                         
1733                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1734                                         FirstToken = FALSE;
1735                         
1736                                 } else {
1737                                 
1738                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1739                                 
1740                                 }
1741                         
1742                         } else {                        
1743                                 
1744                                 if (FirstToken == TRUE){
1745                         
1746                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1747                                         FirstToken = FALSE;
1748                         
1749                                 } else {
1750                                 
1751                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1752                                 
1753                                 }
1754                         
1755                         }
1756                         
1757                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1758                         PropertyName = PropertyElement.GetNextToken();                          
1759                         PropertyValue = PropertyElement.GetNextToken();
1761                         intPrevValue = intiter->second;
1762                         
1763                         if (PropertyName == wxT("X-APPLE-OMIT-YEAR")){
1764                                 PropertyXOmitYear = PropertyValue;
1765                         }
1766                         
1767                         // Process properties.
1768                         
1769                         if (PropertyName.IsEmpty()){
1770                         
1771                                 continue;
1772                         
1773                         }
1774                         
1775                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1777                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1778                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1779         
1780                         } else {
1781                         
1782                                 PropertyDataMap->erase(PropertyName);
1783                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1784                                 PropertyLockMap->erase(PropertyName);
1785                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1786                         
1787                         }
1788                 
1789                 }
1790                 
1791                 // Convert the date from YYYY-MM-DD to YYYYMMDD or --MMDD depending on if the
1792                 // year matches the X-APPLE-OMIT-YEAR value.
1793                 
1794                 wxStringTokenizer DateSplit(*wxSPropertySeg2Ptr, wxT("-"));
1795                 
1796                 wxString DateProc;
1797                 wxString FinalDate;
1798                 
1799                 DateProc = DateSplit.GetNextToken();
1800                 
1801                 if (DateProc == PropertyXOmitYear){
1802                 
1803                         FinalDate.Append(wxT("--"));
1804                 
1805                 } else {
1806                 
1807                         FinalDate.Append(DateProc);
1808                 
1809                 }
1810                 
1811                 DateProc.clear();
1812                 DateProc = DateSplit.GetNextToken();
1813                 
1814                 FinalDate.Append(DateProc);
1816                 DateProc.clear();
1817                 DateProc = DateSplit.GetNextToken();            
1818                 
1819                 FinalDate.Append(DateProc);
1820                 
1821                 wxSPropertyDataOut->Append(FinalDate);
1822         
1823         }
1824         
1825         // ANNIVERSARY
1826         
1827         if (wxSProperty == wxT("ANNIVERSARY")){
1829                 if (ProcessItemData == TRUE){
1830         
1831                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
1832                 
1833                 } else {
1834                 
1835                         intPropertyLen = wxSPropertySeg1Ptr->Len();
1836                 
1837                 }
1838                 
1839                 std::map<int, int> SplitPoints;
1840                 std::map<int, int> SplitLength;
1841                 std::map<int, int>::iterator SLiter;                    
1842                 wxString PropertyData;
1843                 wxString PropertyName;
1844                 wxString PropertyValue;
1845                 wxString PropertyTokens;
1846                 wxString PropertyXOmitYear;
1847                 bool FirstToken = TRUE;
1848                 int intPrevValue = 13;
1849                 
1850                 *wxSPropertyDataNameOut = wxT("ANNIVERSARY");
1851                 *VCardV3Value = TRUE;
1852                 
1853                 if (ProcessItemData == TRUE){
1854                 
1855                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1856                         
1857                 } else {
1858                         
1859                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1860                         
1861                 }
1862                 
1863                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
1864                 intiter != SplitPoints.end(); ++intiter){
1865                 
1866                         SLiter = SplitLength.find(intiter->first);
1867                 
1868                         if (ProcessItemData == TRUE){
1869                 
1870                                 if (FirstToken == TRUE){
1871                         
1872                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1873                                         FirstToken = FALSE;
1874                         
1875                                 } else {
1876                                 
1877                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1878                                 
1879                                 }
1880                         
1881                         } else {                        
1882                                 
1883                                 if (FirstToken == TRUE){
1884                         
1885                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1886                                         FirstToken = FALSE;
1887                         
1888                                 } else {
1889                                 
1890                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1891                                 
1892                                 }
1893                         
1894                         }
1895                         
1896                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1897                         PropertyName = PropertyElement.GetNextToken();                          
1898                         PropertyValue = PropertyElement.GetNextToken();
1899                         
1900                         intPrevValue = intiter->second;
1901                         
1902                         if (PropertyName == wxT("X-APPLE-OMIT-YEAR")){
1903                                 PropertyXOmitYear = PropertyValue;
1904                         }
1905                         
1906                         // Process properties.
1907                         
1908                         if (PropertyName.IsEmpty()){
1909                         
1910                                 continue;
1911                         
1912                         }
1913                         
1914                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1916                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1917                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1918         
1919                         } else {
1920                         
1921                                 PropertyDataMap->erase(PropertyName);
1922                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1923                                 PropertyLockMap->erase(PropertyName);
1924                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1925                         
1926                         }
1927                 
1928                 }
1929                 
1930                 // Convert the date from YYYY-MM-DD to YYYYMMDD or --MMDD depending on if the
1931                 // year matches the X-APPLE-OMIT-YEAR value.
1932                 
1933                 wxStringTokenizer DateSplit(*wxSPropertySeg2Ptr, wxT("-"));
1934                 
1935                 wxString DateProc;
1936                 wxString FinalDate;
1937                 
1938                 DateProc = DateSplit.GetNextToken();
1939                 
1940                 if (DateProc == PropertyXOmitYear){
1941                 
1942                         FinalDate.Append(wxT("--"));
1943                 
1944                 } else {
1945                 
1946                         FinalDate.Append(DateProc);
1947                 
1948                 }
1949                 
1950                 DateProc.clear();
1951                 DateProc = DateSplit.GetNextToken();
1952                 
1953                 FinalDate.Append(DateProc);
1955                 DateProc.clear();
1956                 DateProc = DateSplit.GetNextToken();            
1957                 
1958                 FinalDate.Append(DateProc);
1959                 
1960                 wxSPropertyDataOut->Append(FinalDate);
1961         
1962         }
1963         
1964         // TZ - Not sure how to process this correctly. So data
1965         // is kept as X-VCARD3-TZ for the time being.
1966         
1967         if (wxSProperty == wxT("TZ")){
1969                 if (ProcessItemData == TRUE){
1970         
1971                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
1972                 
1973                 } else {
1974                 
1975                         intPropertyLen = wxSPropertySeg1Ptr->Len();
1976                 
1977                 }
1978                 
1979                 std::map<int, int> SplitPoints;
1980                 std::map<int, int> SplitLength;
1981                 std::map<int, int>::iterator SLiter;                    
1982                 wxString PropertyData;
1983                 wxString PropertyName;
1984                 wxString PropertyValue;
1985                 wxString PropertyTokens;
1986                 wxString PropertyXOmitYear;
1987                 bool FirstToken = TRUE;
1988                 int intPrevValue = 4;
1989                 
1990                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1991                 *wxSPropertyDataNameOut = wxT("X-VCARD3-TZ");
1992                 *VCardV3Value = TRUE;
1993                 
1994                 if (ProcessItemData == TRUE){
1995                 
1996                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1997                         
1998                 } else {
1999                         
2000                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2001                         
2002                 }
2003                 
2004                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
2005                 intiter != SplitPoints.end(); ++intiter){
2006                 
2007                         SLiter = SplitLength.find(intiter->first);
2008                 
2009                         if (ProcessItemData == TRUE){
2010                 
2011                                 if (FirstToken == TRUE){
2012                         
2013                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2014                                         FirstToken = FALSE;
2015                         
2016                                 } else {
2017                                 
2018                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2019                                 
2020                                 }
2021                         
2022                         } else {                        
2023                                 
2024                                 if (FirstToken == TRUE){
2025                         
2026                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2027                                         FirstToken = FALSE;
2028                         
2029                                 } else {
2030                                 
2031                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2032                                 
2033                                 }
2034                         
2035                         }
2036                         
2037                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2038                         PropertyName = PropertyElement.GetNextToken();                          
2039                         PropertyValue = PropertyElement.GetNextToken();
2041                         intPrevValue = intiter->second;
2042                         
2043                         // Process properties.
2044                         
2045                         if (PropertyName.IsEmpty()){
2046                         
2047                                 continue;
2048                         
2049                         }
2050                         
2051                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2053                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2054                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2055         
2056                         } else {
2057                         
2058                                 PropertyDataMap->erase(PropertyName);
2059                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2060                                 PropertyLockMap->erase(PropertyName);
2061                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2062                         
2063                         }
2064                 
2065                 }
2066         
2067         }
2068         
2069         // ROLE
2070         
2071         if (wxSProperty == wxT("ROLE")){
2073                 if (ProcessItemData == TRUE){
2074         
2075                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
2076                 
2077                 } else {
2078                 
2079                         intPropertyLen = wxSPropertySeg1Ptr->Len();
2080                 
2081                 }
2082                 
2083                 std::map<int, int> SplitPoints;
2084                 std::map<int, int> SplitLength;
2085                 std::map<int, int>::iterator SLiter;                    
2086                 wxString PropertyData;
2087                 wxString PropertyName;
2088                 wxString PropertyValue;
2089                 wxString PropertyTokens;
2090                 wxString PropertyXOmitYear;
2091                 bool FirstToken = TRUE;
2092                 int intPrevValue = 6;
2093                 
2094                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2095                 *wxSPropertyDataNameOut = wxT("ROLE");
2096                 *VCardV3Value = TRUE;
2097                 
2098                 if (ProcessItemData == TRUE){
2099                 
2100                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2101                         
2102                 } else {
2103                         
2104                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2105                         
2106                 }
2107                 
2108                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
2109                 intiter != SplitPoints.end(); ++intiter){
2110                 
2111                         SLiter = SplitLength.find(intiter->first);
2112                 
2113                         if (ProcessItemData == TRUE){
2114                 
2115                                 if (FirstToken == TRUE){
2116                         
2117                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2118                                         FirstToken = FALSE;
2119                         
2120                                 } else {
2121                                 
2122                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2123                                 
2124                                 }
2125                         
2126                         } else {                        
2127                                 
2128                                 if (FirstToken == TRUE){
2129                         
2130                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2131                                         FirstToken = FALSE;
2132                         
2133                                 } else {
2134                                 
2135                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2136                                 
2137                                 }
2138                         
2139                         }
2140                         
2141                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2142                         PropertyName = PropertyElement.GetNextToken();                          
2143                         PropertyValue = PropertyElement.GetNextToken();
2145                         intPrevValue = intiter->second;
2146                         
2147                         // Process properties.
2148                         
2149                         if (PropertyName.IsEmpty()){
2150                         
2151                                 continue;
2152                         
2153                         }
2154                         
2155                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2157                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2158                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2159         
2160                         } else {
2161                         
2162                                 PropertyDataMap->erase(PropertyName);
2163                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2164                                 PropertyLockMap->erase(PropertyName);
2165                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2166                         
2167                         }
2168                 
2169                 }
2170         
2171         }
2172         
2173         // ORG
2174         
2175         if (wxSProperty == wxT("ORG")){
2177                 if (ProcessItemData == TRUE){
2178         
2179                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
2180                 
2181                 } else {
2182                 
2183                         intPropertyLen = wxSPropertySeg1Ptr->Len();
2184                 
2185                 }
2186                 
2187                 std::map<int, int> SplitPoints;
2188                 std::map<int, int> SplitLength;
2189                 std::map<int, int>::iterator SLiter;                    
2190                 wxString PropertyData;
2191                 wxString PropertyName;
2192                 wxString PropertyValue;
2193                 wxString PropertyTokens;
2194                 wxString PropertyXOmitYear;
2195                 bool FirstToken = TRUE;
2196                 int intPrevValue = 5;
2197                 
2198                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2199                 *wxSPropertyDataNameOut = wxT("ORG");
2200                 *VCardV3Value = TRUE;
2201                 
2202                 if (ProcessItemData == TRUE){
2203                 
2204                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2205                         
2206                 } else {
2207                         
2208                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2209                         
2210                 }
2211                 
2212                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
2213                 intiter != SplitPoints.end(); ++intiter){
2214                 
2215                         SLiter = SplitLength.find(intiter->first);
2216                 
2217                         if (ProcessItemData == TRUE){
2218                 
2219                                 if (FirstToken == TRUE){
2220                         
2221                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2222                                         FirstToken = FALSE;
2223                         
2224                                 } else {
2225                                 
2226                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2227                                 
2228                                 }
2229                         
2230                         } else {                        
2231                                 
2232                                 if (FirstToken == TRUE){
2233                         
2234                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2235                                         FirstToken = FALSE;
2236                         
2237                                 } else {
2238                                 
2239                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2240                                 
2241                                 }
2242                         
2243                         }
2244                         
2245                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2246                         PropertyName = PropertyElement.GetNextToken();                          
2247                         PropertyValue = PropertyElement.GetNextToken();
2249                         intPrevValue = intiter->second;
2250                         
2251                         // Process properties.
2252                         
2253                         if (PropertyName.IsEmpty()){
2254                         
2255                                 continue;
2256                         
2257                         }
2258                         
2259                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2261                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2262                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2263         
2264                         } else {
2265                         
2266                                 PropertyDataMap->erase(PropertyName);
2267                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2268                                 PropertyLockMap->erase(PropertyName);
2269                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2270                         
2271                         }
2272                 
2273                 }
2274         
2275         }
2276         
2277         // NOTE
2278         
2279         if (wxSProperty == wxT("NOTE")){
2281                 if (ProcessItemData == TRUE){
2282         
2283                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
2284                 
2285                 } else {
2286                 
2287                         intPropertyLen = wxSPropertySeg1Ptr->Len();
2288                 
2289                 }
2290                 
2291                 std::map<int, int> SplitPoints;
2292                 std::map<int, int> SplitLength;
2293                 std::map<int, int>::iterator SLiter;                    
2294                 wxString PropertyData;
2295                 wxString PropertyName;
2296                 wxString PropertyValue;
2297                 wxString PropertyTokens;
2298                 wxString PropertyXOmitYear;
2299                 bool FirstToken = TRUE;
2300                 int intPrevValue = 6;
2301                 
2302                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2303                 *wxSPropertyDataNameOut = wxT("NOTE");
2304                 *VCardV3Value = TRUE;
2305                 
2306                 if (ProcessItemData == TRUE){
2307                 
2308                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2309                         
2310                 } else {
2311                         
2312                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2313                         
2314                 }
2315                 
2316                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
2317                 intiter != SplitPoints.end(); ++intiter){
2318                 
2319                         SLiter = SplitLength.find(intiter->first);
2320                 
2321                         if (ProcessItemData == TRUE){
2322                 
2323                                 if (FirstToken == TRUE){
2324                         
2325                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2326                                         FirstToken = FALSE;
2327                         
2328                                 } else {
2329                                 
2330                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2331                                 
2332                                 }
2333                         
2334                         } else {                        
2335                                 
2336                                 if (FirstToken == TRUE){
2337                         
2338                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2339                                         FirstToken = FALSE;
2340                         
2341                                 } else {
2342                                 
2343                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2344                                 
2345                                 }
2346                         
2347                         }
2348                         
2349                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2350                         PropertyName = PropertyElement.GetNextToken();                          
2351                         PropertyValue = PropertyElement.GetNextToken();
2353                         intPrevValue = intiter->second;
2354                         
2355                         // Process properties.
2356                         
2357                         if (PropertyName.IsEmpty()){
2358                         
2359                                 continue;
2360                         
2361                         }
2362                         
2363                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2365                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2366                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2367         
2368                         } else {
2369                         
2370                                 PropertyDataMap->erase(PropertyName);
2371                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2372                                 PropertyLockMap->erase(PropertyName);
2373                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2374                         
2375                         }
2376                 
2377                 }
2378         
2379         }
2380         
2381         // PHOTO
2382         
2383         if (wxSProperty == wxT("PHOTO")){
2384                 
2385                 if (ProcessItemData == TRUE){
2386         
2387                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
2388                 
2389                 } else {
2390                 
2391                         intPropertyLen = wxSPropertySeg1Ptr->Len();
2392                 
2393                 }
2394                 
2395                 std::map<int, int> SplitPoints;
2396                 std::map<int, int> SplitLength;
2397                 std::map<int, int>::iterator SLiter;
2398                 std::map<wxString, wxString> SplitData;                         
2399                 wxString PropertyData;
2400                 wxString PropertyName;
2401                 wxString PropertyValue;
2402                 wxString PropertyTokens;
2403                 wxString PropertyXOmitYear;
2404                 int intPrevValue = 7;
2405                 
2406                 *wxSPropertyDataNameOut = wxT("PHOTO");
2407                 *VCardV3Value = TRUE;
2408                 
2409                 if (ProcessItemData == TRUE){
2410                 
2411                         SplitValuesData(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue, &SplitData);
2412                         
2413                 } else {
2414                         
2415                         SplitValuesData(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue, &SplitData);
2416                         
2417                 }
2418                 
2419                 wxString wxSMIMEType;
2420                 wxString wxSEncType;
2421                 
2422                 for (std::map<wxString, wxString>::iterator intiter = SplitData.begin();
2423                 intiter != SplitData.end(); ++intiter){
2424                 
2425                         PropertyName = intiter->first;                          
2426                         PropertyValue = intiter->second;
2428                         if (PropertyName == wxT("ENCODING") && PropertyValue == wxT("b")){
2429                                 wxSEncType = wxT("base64");
2430                                 continue;
2431                         }
2432                         
2433                         if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("PNG")){
2434                                 wxSMIMEType = wxT("image/png");
2435                                 continue;
2436                         } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("JPEG")){
2437                                 wxSMIMEType = wxT("image/jpeg");
2438                                 continue;
2439                         } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("GIF")){
2440                                 wxSMIMEType = wxT("image/gif");
2441                                 continue;
2442                         } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("BMP")){
2443                                 wxSMIMEType = wxT("image/bmp");
2444                                 continue;
2445                         } else if (PropertyName == wxT("TYPE") || PropertyName == wxT("type")) {
2446                                 wxSMIMEType = wxT("image/unknown");
2447                                 continue;
2448                         }
2450                         // Process properties.
2451                         
2452                         if (PropertyName.IsEmpty()){
2453                         
2454                                 continue;
2455                         
2456                         }
2457                         
2458                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2460                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2461                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2462         
2463                         } else {
2464                         
2465                                 PropertyDataMap->erase(PropertyName);
2466                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2467                                 PropertyLockMap->erase(PropertyName);
2468                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2469                         
2470                         }
2471                 
2472                 }
2473                 
2474                 wxSPropertyDataOut->Append(wxT("data:"));
2475                 wxSPropertyDataOut->Append(wxSMIMEType);
2476                 wxSPropertyDataOut->Append(wxT(";"));
2477                 wxSPropertyDataOut->Append(wxSEncType);
2478                 wxSPropertyDataOut->Append(wxT(","));
2479                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2480         
2481         }
2482         
2483         // SOUND
2484         
2485         if (wxSProperty == wxT("SOUND")){
2486         
2487                 if (ProcessItemData == TRUE){
2488         
2489                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
2490                 
2491                 } else {
2492                 
2493                         intPropertyLen = wxSPropertySeg1Ptr->Len();
2494                 
2495                 }
2496                 
2497                 std::map<int, int> SplitPoints;
2498                 std::map<int, int> SplitLength;
2499                 std::map<int, int>::iterator SLiter;                    
2500                 wxString PropertyData;
2501                 wxString PropertyName;
2502                 wxString PropertyValue;
2503                 wxString PropertyTokens;
2504                 wxString PropertyXOmitYear;
2505                 bool FirstToken = TRUE;
2506                 int intPrevValue = 7;
2507                 
2508                 *wxSPropertyDataNameOut = wxT("SOUND");
2509                 *VCardV3Value = TRUE;
2510                 
2511                 if (ProcessItemData == TRUE){
2512                 
2513                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2514                         
2515                 } else {
2516                         
2517                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2518                         
2519                 }
2520                 
2521                 wxString wxSMIMEType;
2522                 wxString wxSEncType;
2523                 
2524                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
2525                 intiter != SplitPoints.end(); ++intiter){
2526                 
2527                         SLiter = SplitLength.find(intiter->first);
2528                 
2529                         if (ProcessItemData == TRUE){
2530                 
2531                                 if (FirstToken == TRUE){
2532                         
2533                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2534                                         FirstToken = FALSE;
2535                         
2536                                 } else {
2537                                 
2538                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2539                                 
2540                                 }
2541                         
2542                         } else {                        
2543                                 
2544                                 if (FirstToken == TRUE){
2545                         
2546                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2547                                         FirstToken = FALSE;
2548                         
2549                                 } else {
2550                                 
2551                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2552                                 
2553                                 }
2554                         
2555                         }
2556                         
2557                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2558                         PropertyName = PropertyElement.GetNextToken();                          
2559                         PropertyValue = PropertyElement.GetNextToken();
2561                         if (PropertyName == wxT("ENCODING") && PropertyValue == wxT("b")){
2562                                 wxSEncType = wxT("base64");
2563                                 continue;
2564                         }
2565                         
2566                         if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type"))){
2567                                 wxSMIMEType = PropertyValue;
2568                                 continue;
2569                         }
2570                         
2571                         intPrevValue = intiter->second;
2572                         
2573                         // Process properties.
2574                         
2575                         if (PropertyName.IsEmpty()){
2576                         
2577                                 continue;
2578                         
2579                         }
2580                         
2581                         if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2583                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2584                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2585         
2586                         } else {
2587                         
2588                                 PropertyDataMap->erase(PropertyName);
2589                                 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2590                                 PropertyLockMap->erase(PropertyName);
2591                                 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2592                         
2593                         }
2594                 
2595                 }
2596                 
2597                 wxSPropertyDataOut->Append(wxT("data:"));
2598                 wxSPropertyDataOut->Append(wxSMIMEType);
2599                 wxSPropertyDataOut->Append(wxT(";"));
2600                 wxSPropertyDataOut->Append(wxSEncType);
2601                 wxSPropertyDataOut->Append(wxT(","));
2602                 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2603         
2604         }
2605         
2606         // Look for backward compatability vCard 4.0 properties.
2607         
2608         // X-VCARD4-FN
2609         
2610         if (wxSProperty == wxT("X-VCARD4-FN")){
2611         
2612                 if (ProcessItemData == TRUE){
2613         
2614                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
2615                 
2616                 } else {
2617                 
2618                         intPropertyLen = wxSPropertySeg1Ptr->Len();
2619                                 *wxSPropertyDataNameOut = wxT("FN");
2620                 
2621                 }
2622                 
2623                 std::map<int, int> SplitPoints;
2624                 std::map<int, int> SplitLength;
2625                 std::map<int, int>::iterator SLiter;
2626                 std::map<wxString, bool>::iterator BIter;;                      
2627                 wxString PropertyData;
2628                 wxString PropertyName;
2629                 wxString PropertyValue;
2630                 wxString PropertyTokens;
2631                 bool FirstToken = TRUE;
2632                 int intPrevValue = 13;
2634                 if (ProcessItemData == TRUE){
2635                 
2636                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2637                         
2638                 } else {
2639                         
2640                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2641                         
2642                 }
2643                 
2644                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
2645                 intiter != SplitPoints.end(); ++intiter){
2646                 
2647                         SLiter = SplitLength.find(intiter->first);
2648                 
2649                         if (ProcessItemData == TRUE){
2651                                 if (FirstToken == TRUE){
2652                 
2653                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2654                                         FirstToken = FALSE;
2655                                 
2656                                 } else {
2657                                 
2658                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2659                                 
2660                                 }
2661                         
2662                         } else {
2663                         
2664                                 if (FirstToken == TRUE){
2665                         
2666                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2667                                         FirstToken = FALSE;
2668                                                                 
2669                                 } else {
2670                                 
2671                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2672                                         
2673                                 }
2674                         
2675                         }
2676                         
2677                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2678                         PropertyName = PropertyElement.GetNextToken();                          
2679                         PropertyValue = PropertyElement.GetNextToken();
2680                         
2681                         intPrevValue = intiter->second;
2682                         
2683                         // Process properties.
2684                         
2685                         // Check if there is a lock on the property value. If there is a lock then
2686                         // the property value cannot be changed.
2687                         
2688                         if (PropertyName.IsEmpty()){
2689                         
2690                                 continue;
2691                         
2692                         }
2693                         
2694                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
2695                         
2696                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2697                         
2698                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2699                         
2700                                 } else {
2701                         
2702                                         PropertyDataMap->erase(PropertyName);
2703                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2704                         
2705                                 }
2706                                 
2707                         }
2709                 }
2710                 
2711                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
2712                 *XVCardV4Value = TRUE;
2713                                 
2714         }
2715         
2716         // X-VCARD4-N
2717         
2718         if (wxSProperty == wxT("X-VCARD4-N")){
2720                 if (ProcessItemData == TRUE){
2721         
2722                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
2723                 
2724                 } else {
2725                 
2726                         intPropertyLen = wxSPropertySeg1Ptr->Len();
2727                 
2728                 }
2729                 
2730                 std::map<int, int> SplitPoints;
2731                 std::map<int, int> SplitLength;
2732                 std::map<int, int>::iterator SLiter;
2733                 std::map<wxString, bool>::iterator BIter;;                      
2734                 wxString PropertyData;
2735                 wxString PropertyName;
2736                 wxString PropertyValue;
2737                 wxString PropertyTokens;
2738         bool FirstToken = TRUE;
2739                 int intPrevValue = 12;
2741                 if (ProcessItemData == TRUE){
2742                 
2743                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2744                         
2745                 } else {
2746                         
2747                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2748                         *wxSPropertyDataNameOut = wxT("N");
2749                         
2750                 }
2751                 
2752                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
2753                 intiter != SplitPoints.end(); ++intiter){
2754                 
2755                         SLiter = SplitLength.find(intiter->first);
2756                 
2757                         if (ProcessItemData == TRUE){
2759                                 if (FirstToken == TRUE){
2760                 
2761                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2762                                         FirstToken = FALSE;
2763                                 
2764                                 } else {
2765                                 
2766                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2767                                 
2768                                 }
2769                         
2770                         } else {
2771                         
2772                                 if (FirstToken == TRUE){
2773                         
2774                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2775                                         FirstToken = FALSE;
2776                                                                 
2777                                 } else {
2778                                 
2779                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2780                                         
2781                                 }
2782                         
2783                         }
2784                         
2785                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2786                         PropertyName = PropertyElement.GetNextToken();                          
2787                         PropertyValue = PropertyElement.GetNextToken();
2789                         intPrevValue = intiter->second;
2790                         
2791                         // Process properties.
2792                         
2793                         // Check if there is a lock on the property value. If there is a lock then
2794                         // the property value cannot be changed.
2795                         
2796                         if (PropertyName.IsEmpty()){
2797                         
2798                                 continue;
2799                         
2800                         }
2801                         
2802                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
2803                         
2804                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2805                         
2806                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2807                         
2808                                 } else {
2809                         
2810                                         PropertyDataMap->erase(PropertyName);
2811                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2812                         
2813                                 }
2814                                 
2815                         }
2816                         
2817                 }
2818                 
2819                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
2820                 *XVCardV4Value = TRUE;
2821                                 
2822         }
2823         
2824         // X-VCARD4-NICKNAME
2825         
2826         if (wxSProperty == wxT("X-VCARD4-NICKNAME")){
2828                 if (ProcessItemData == TRUE){
2829         
2830                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
2831                 
2832                 } else {
2833                 
2834                         intPropertyLen = wxSPropertySeg1Ptr->Len();
2835                 
2836                 }
2837                 
2838                 std::map<int, int> SplitPoints;
2839                 std::map<int, int> SplitLength;
2840                 std::map<int, int>::iterator SLiter;
2841                 std::map<wxString, bool>::iterator BIter;;                      
2842                 wxString PropertyData;
2843                 wxString PropertyName;
2844                 wxString PropertyValue;
2845                 wxString PropertyTokens;
2846                 bool FirstToken = TRUE;
2847                 int intPrevValue = 19;
2849                 if (ProcessItemData == TRUE){
2850                 
2851                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2852                         
2853                 } else {
2854                         
2855                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2856                         *wxSPropertyDataNameOut = wxT("NICKNAME");
2857                         
2858                 }
2859                 
2860                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
2861                 intiter != SplitPoints.end(); ++intiter){
2862                 
2863                         SLiter = SplitLength.find(intiter->first);
2864                 
2865                         if (ProcessItemData == TRUE){
2867                                 if (FirstToken == TRUE){
2868                 
2869                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2870                                         FirstToken = FALSE;
2871                                 
2872                                 } else {
2873                                 
2874                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2875                                 
2876                                 }
2877                         
2878                         } else {
2879                         
2880                                 if (FirstToken == TRUE){
2881                         
2882                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2883                                         FirstToken = FALSE;
2884                                                                 
2885                                 } else {
2886                                 
2887                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2888                                         
2889                                 }
2890                         
2891                         }
2892                         
2893                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2894                         PropertyName = PropertyElement.GetNextToken();                          
2895                         PropertyValue = PropertyElement.GetNextToken();
2896                         
2897                         intPrevValue = intiter->second;
2898                         
2899                         // Process properties.
2900                         
2901                         // Check if there is a lock on the property value. If there is a lock then
2902                         // the property value cannot be changed.
2903                         
2904                         if (PropertyName.IsEmpty()){
2905                         
2906                                 continue;
2907                         
2908                         }
2909                         
2910                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
2911                         
2912                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2913                         
2914                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2915                         
2916                                 } else {
2917                         
2918                                         PropertyDataMap->erase(PropertyName);
2919                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2920                         
2921                                 }
2922                                 
2923                         }
2924                 
2925                 }
2926                 
2927                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
2928                 *XVCardV4Value = TRUE;
2929                                 
2930         }
2931         
2932         // X-VCARD4-GENDER
2933         
2934         if (wxSProperty == wxT("X-VCARD4-GENDER")){
2936                 if (ProcessItemData == TRUE){
2937         
2938                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
2939                 
2940                 } else {
2941                 
2942                         intPropertyLen = wxSPropertySeg1Ptr->Len();
2943                 
2944                 }
2945                 
2946                 std::map<int, int> SplitPoints;
2947                 std::map<int, int> SplitLength;
2948                 std::map<int, int>::iterator SLiter;
2949                 std::map<wxString, bool>::iterator BIter;;                      
2950                 wxString PropertyData;
2951                 wxString PropertyName;
2952                 wxString PropertyValue;
2953                 wxString PropertyTokens;
2954                 bool FirstToken = TRUE;
2955                 int intPrevValue = 17;
2957                 if (ProcessItemData == TRUE){
2958                 
2959                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2960                         
2961                 } else {
2962                         
2963                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2964                         *wxSPropertyDataNameOut = wxT("GENDER");
2965                         
2966                 }
2967                 
2968                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
2969                 intiter != SplitPoints.end(); ++intiter){
2970                 
2971                         SLiter = SplitLength.find(intiter->first);
2972                 
2973                         if (ProcessItemData == TRUE){
2975                                 if (FirstToken == TRUE){
2976                 
2977                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2978                                         FirstToken = FALSE;
2979                                 
2980                                 } else {
2981                                 
2982                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2983                                 
2984                                 }
2985                         
2986                         } else {
2987                         
2988                                 if (FirstToken == TRUE){
2989                         
2990                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2991                                         FirstToken = FALSE;
2992                                                                 
2993                                 } else {
2994                                 
2995                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2996                                         
2997                                 }
2998                         
2999                         }
3000                         
3001                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3002                         PropertyName = PropertyElement.GetNextToken();                          
3003                         PropertyValue = PropertyElement.GetNextToken();
3004                         
3005                         //ProcessCaptureStrings(&PropertyValue);
3006                         
3007                         intPrevValue = intiter->second;
3008                         
3009                         // Process properties.
3010                         
3011                         // Check if there is a lock on the property value. If there is a lock then
3012                         // the property value cannot be changed.
3013                         
3014                         if (PropertyName.IsEmpty()){
3015                         
3016                                 continue;
3017                         
3018                         }
3019                         
3020                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3021                         
3022                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3023                         
3024                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3025                         
3026                                 } else {
3027                         
3028                                         PropertyDataMap->erase(PropertyName);
3029                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3030                         
3031                                 }
3032                                 
3033                         }
3034                 
3035                 }
3036                 
3037                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3038                 *XVCardV4Value = TRUE;
3039                                 
3040         }
3041         
3042         // X-VCARD4-BDAY
3043         
3044         if (wxSProperty == wxT("X-VCARD4-BDAY")){
3046                 if (ProcessItemData == TRUE){
3047         
3048                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
3049                 
3050                 } else {
3051                 
3052                         intPropertyLen = wxSPropertySeg1Ptr->Len();
3053                 
3054                 }
3055                 
3056                 std::map<int, int> SplitPoints;
3057                 std::map<int, int> SplitLength;
3058                 std::map<int, int>::iterator SLiter;
3059                 std::map<wxString, bool>::iterator BIter;;                      
3060                 wxString PropertyData;
3061                 wxString PropertyName;
3062                 wxString PropertyValue;
3063                 wxString PropertyTokens;
3064                 bool FirstToken = TRUE;
3065                 int intPrevValue = 15;
3067                 if (ProcessItemData == TRUE){
3068                 
3069                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3070                         
3071                 } else {
3072                         
3073                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3074                         *wxSPropertyDataNameOut = wxT("BDAY");
3075                         
3076                 }
3077                 
3078                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
3079                 intiter != SplitPoints.end(); ++intiter){
3080                 
3081                         SLiter = SplitLength.find(intiter->first);
3082                 
3083                         if (ProcessItemData == TRUE){
3085                                 if (FirstToken == TRUE){
3086                 
3087                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3088                                         FirstToken = FALSE;
3089                                 
3090                                 } else {
3091                                 
3092                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3093                                 
3094                                 }
3095                         
3096                         } else {
3097                         
3098                                 if (FirstToken == TRUE){
3099                         
3100                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3101                                         FirstToken = FALSE;
3102                                                                 
3103                                 } else {
3104                                 
3105                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3106                                         
3107                                 }
3108                         
3109                         }
3110                         
3111                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3112                         PropertyName = PropertyElement.GetNextToken();                          
3113                         PropertyValue = PropertyElement.GetNextToken();
3115                         intPrevValue = intiter->second;
3116                         
3117                         // Process properties.
3118                         
3119                         // Check if there is a lock on the property value. If there is a lock then
3120                         // the property value cannot be changed.
3121                         
3122                         if (PropertyName.IsEmpty()){
3123                         
3124                                 continue;
3125                         
3126                         }
3127                         
3128                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3129                         
3130                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3131                         
3132                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3133                         
3134                                 } else {
3135                         
3136                                         PropertyDataMap->erase(PropertyName);
3137                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3138                         
3139                                 }
3140                                 
3141                         }
3143                 }
3144                 
3145                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3146                 *XVCardV4Value = TRUE;
3147                                 
3148         }
3150         // X-VCARD4-ANNIVERSARY
3151         
3152         if (wxSProperty == wxT("X-VCARD4-ANNIVERSARY")){
3154                 if (ProcessItemData == TRUE){
3155         
3156                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
3157                 
3158                 } else {
3159                 
3160                         intPropertyLen = wxSPropertySeg1Ptr->Len();
3161                 
3162                 }
3163                 
3164                 std::map<int, int> SplitPoints;
3165                 std::map<int, int> SplitLength;
3166                 std::map<int, int>::iterator SLiter;
3167                 std::map<wxString, bool>::iterator BIter;;                      
3168                 wxString PropertyData;
3169                 wxString PropertyName;
3170                 wxString PropertyValue;
3171                 wxString PropertyTokens;
3172                 bool FirstToken = TRUE;
3173                 int intPrevValue = 22;
3175                 if (ProcessItemData == TRUE){
3176                 
3177                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3178                         
3179                 } else {
3180                         
3181                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3182                         *wxSPropertyDataNameOut = wxT("ANNIVERSARY");
3183                         
3184                 }
3185                 
3186                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
3187                 intiter != SplitPoints.end(); ++intiter){
3188                 
3189                         SLiter = SplitLength.find(intiter->first);
3190                 
3191                         if (ProcessItemData == TRUE){
3193                                 if (FirstToken == TRUE){
3194                 
3195                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3196                                         FirstToken = FALSE;
3197                                 
3198                                 } else {
3199                                 
3200                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3201                                 
3202                                 }
3203                         
3204                         } else {
3205                         
3206                                 if (FirstToken == TRUE){
3207                         
3208                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3209                                         FirstToken = FALSE;
3210                                                                 
3211                                 } else {
3212                                 
3213                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3214                                         
3215                                 }
3216                         
3217                         }
3218                         
3219                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3220                         PropertyName = PropertyElement.GetNextToken();                          
3221                         PropertyValue = PropertyElement.GetNextToken();
3223                         intPrevValue = intiter->second;
3224                         
3225                         // Process properties.
3226                         
3227                         // Check if there is a lock on the property value. If there is a lock then
3228                         // the property value cannot be changed.
3229                         
3230                         if (PropertyName.IsEmpty()){
3231                         
3232                                 continue;
3233                         
3234                         }
3235                         
3236                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3237                         
3238                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3239                         
3240                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3241                         
3242                                 } else {
3243                         
3244                                         PropertyDataMap->erase(PropertyName);
3245                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3246                         
3247                                 }
3248                                 
3249                         }
3251                 }
3252                 
3253                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3254                 *XVCardV4Value = TRUE;
3255                                 
3256         }
3258         // X-VCARD4-TZ
3259         
3260         if (wxSProperty == wxT("X-VCARD4-TZ")){
3262                 if (ProcessItemData == TRUE){
3263         
3264                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
3265                 
3266                 } else {
3267                 
3268                         intPropertyLen = wxSPropertySeg1Ptr->Len();
3269                 
3270                 }
3271                 
3272                 std::map<int, int> SplitPoints;
3273                 std::map<int, int> SplitLength;
3274                 std::map<int, int>::iterator SLiter;
3275                 std::map<wxString, bool>::iterator BIter;;                      
3276                 wxString PropertyData;
3277                 wxString PropertyName;
3278                 wxString PropertyValue;
3279                 wxString PropertyTokens;
3280                 bool FirstToken = TRUE;
3281                 int intPrevValue = 13;
3283                 if (ProcessItemData == TRUE){
3284                 
3285                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3286                         
3287                 } else {
3288                         
3289                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3290                         *wxSPropertyDataNameOut = wxT("TZ");
3291                         
3292                 }
3293                 
3294                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
3295                 intiter != SplitPoints.end(); ++intiter){
3296                 
3297                         SLiter = SplitLength.find(intiter->first);
3298                 
3299                         if (ProcessItemData == TRUE){
3301                                 if (FirstToken == TRUE){
3302                 
3303                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3304                                         FirstToken = FALSE;
3305                                 
3306                                 } else {
3307                                 
3308                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3309                                 
3310                                 }
3311                         
3312                         } else {
3313                         
3314                                 if (FirstToken == TRUE){
3315                         
3316                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3317                                         FirstToken = FALSE;
3318                                                                 
3319                                 } else {
3320                                 
3321                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3322                                         
3323                                 }
3324                         
3325                         }
3326                         
3327                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3328                         PropertyName = PropertyElement.GetNextToken();                          
3329                         PropertyValue = PropertyElement.GetNextToken();
3330                         
3331                         intPrevValue = intiter->second;
3332                         
3333                         // Process properties.
3334                         
3335                         // Check if there is a lock on the property value. If there is a lock then
3336                         // the property value cannot be changed.
3337                         
3338                         if (PropertyName.IsEmpty()){
3339                         
3340                                 continue;
3341                         
3342                         }
3343                         
3344                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3345                         
3346                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3347                         
3348                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3349                         
3350                                 } else {
3351                         
3352                                         PropertyDataMap->erase(PropertyName);
3353                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3354                         
3355                                 }
3356                                 
3357                         }
3358                 
3359                 }
3360                 
3361                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3362                 *XVCardV4Value = TRUE;
3363                                 
3364         }
3365         
3366         // X-VCARD4-ADR
3367         
3368         if (wxSProperty == wxT("X-VCARD4-ADR")){
3370                 if (ProcessItemData == TRUE){
3371         
3372                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
3373                 
3374                 } else {
3375                 
3376                         intPropertyLen = wxSPropertySeg1Ptr->Len();
3377                 
3378                 }
3379                 
3380                 std::map<int, int> SplitPoints;
3381                 std::map<int, int> SplitLength;
3382                 std::map<int, int>::iterator SLiter;
3383                 std::map<wxString, bool>::iterator BIter;;                      
3384                 wxString PropertyData;
3385                 wxString PropertyName;
3386                 wxString PropertyValue;
3387                 wxString PropertyTokens;
3388                 bool FirstToken = TRUE;
3389                 int intPrevValue = 14;
3391                 if (ProcessItemData == TRUE){
3392                 
3393                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3394                         
3395                 } else {
3396                         
3397                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3398                         *wxSPropertyDataNameOut = wxT("ADR");
3399                         
3400                 }
3401                 
3402                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
3403                 intiter != SplitPoints.end(); ++intiter){
3404                 
3405                         SLiter = SplitLength.find(intiter->first);
3406                 
3407                         if (ProcessItemData == TRUE){
3409                                 if (FirstToken == TRUE){
3410                 
3411                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3412                                         FirstToken = FALSE;
3413                                 
3414                                 } else {
3415                                 
3416                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3417                                 
3418                                 }
3419                         
3420                         } else {
3421                         
3422                                 if (FirstToken == TRUE){
3423                         
3424                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3425                                         FirstToken = FALSE;
3426                                                                 
3427                                 } else {
3428                                 
3429                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3430                                         
3431                                 }
3432                         
3433                         }
3434                         
3435                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3436                         PropertyName = PropertyElement.GetNextToken();                          
3437                         PropertyValue = PropertyElement.GetNextToken();
3439                         intPrevValue = intiter->second;
3440                         
3441                         // Process properties.
3442                         
3443                         // Check if there is a lock on the property value. If there is a lock then
3444                         // the property value cannot be changed.
3445                         
3446                         if (PropertyName.IsEmpty()){
3447                         
3448                                 continue;
3449                         
3450                         }
3451                         
3452                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3453                         
3454                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3455                         
3456                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3457                         
3458                                 } else {
3459                         
3460                                         PropertyDataMap->erase(PropertyName);
3461                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3462                         
3463                                 }
3464                                 
3465                         }
3466                 
3467                 }
3468                 
3469                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3470                 *XVCardV4Value = TRUE;
3471                                 
3472         }
3473         
3474         // X-VCARD4-EMAIL
3475         
3476         if (wxSProperty == wxT("X-VCARD4-EMAIL")){
3478                 if (ProcessItemData == TRUE){
3479         
3480                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
3481                 
3482                 } else {
3483                 
3484                         intPropertyLen = wxSPropertySeg1Ptr->Len();
3485                 
3486                 }
3487                 
3488                 std::map<int, int> SplitPoints;
3489                 std::map<int, int> SplitLength;
3490                 std::map<int, int>::iterator SLiter;
3491                 std::map<wxString, bool>::iterator BIter;;                      
3492                 wxString PropertyData;
3493                 wxString PropertyName;
3494                 wxString PropertyValue;
3495                 wxString PropertyTokens;
3496                 bool FirstToken = TRUE;
3497                 int intPrevValue = 16;
3499                 if (ProcessItemData == TRUE){
3500                 
3501                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3502                         
3503                 } else {
3504                         
3505                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3506                         *wxSPropertyDataNameOut = wxT("EMAIL");
3507                         
3508                 }
3509                 
3510                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
3511                 intiter != SplitPoints.end(); ++intiter){
3512                 
3513                         SLiter = SplitLength.find(intiter->first);
3514                 
3515                         if (ProcessItemData == TRUE){
3517                                 if (FirstToken == TRUE){
3518                 
3519                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3520                                         FirstToken = FALSE;
3521                                 
3522                                 } else {
3523                                 
3524                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3525                                 
3526                                 }
3527                         
3528                         } else {
3529                         
3530                                 if (FirstToken == TRUE){
3531                         
3532                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3533                                         FirstToken = FALSE;
3534                                                                 
3535                                 } else {
3536                                 
3537                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3538                                         
3539                                 }
3540                         
3541                         }
3542                         
3543                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3544                         PropertyName = PropertyElement.GetNextToken();                          
3545                         PropertyValue = PropertyElement.GetNextToken();
3546                         
3547                         intPrevValue = intiter->second;
3548                         
3549                         // Process properties.
3550                         
3551                         // Check if there is a lock on the property value. If there is a lock then
3552                         // the property value cannot be changed.
3553                         
3554                         if (PropertyName.IsEmpty()){
3555                         
3556                                 continue;
3557                         
3558                         }
3559                         
3560                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3561                         
3562                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3563                         
3564                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3565                         
3566                                 } else {
3567                         
3568                                         PropertyDataMap->erase(PropertyName);
3569                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3570                         
3571                                 }
3572                                 
3573                         }
3575                 }
3576                 
3577                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3578                 *XVCardV4Value = TRUE;
3579                                 
3580         }
3581         
3582         // X-VCARD4-IMPP
3583         
3584         if (wxSProperty == wxT("X-VCARD4-IMPP")){
3586                 if (ProcessItemData == TRUE){
3587         
3588                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
3589                 
3590                 } else {
3591                 
3592                         intPropertyLen = wxSPropertySeg1Ptr->Len();
3593                 
3594                 }
3595                 
3596                 std::map<int, int> SplitPoints;
3597                 std::map<int, int> SplitLength;
3598                 std::map<int, int>::iterator SLiter;
3599                 std::map<wxString, bool>::iterator BIter;;                      
3600                 wxString PropertyData;
3601                 wxString PropertyName;
3602                 wxString PropertyValue;
3603                 wxString PropertyTokens;
3604                 bool FirstToken = TRUE;
3605                 int intPrevValue = 15;
3607                 if (ProcessItemData == TRUE){
3608                 
3609                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3610                         
3611                 } else {
3612                         
3613                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3614                         *wxSPropertyDataNameOut = wxT("IMPP");
3615                         
3616                 }
3617                 
3618                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
3619                 intiter != SplitPoints.end(); ++intiter){
3620                 
3621                         SLiter = SplitLength.find(intiter->first);
3622                 
3623                         if (ProcessItemData == TRUE){
3625                                 if (FirstToken == TRUE){
3626                 
3627                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3628                                         FirstToken = FALSE;
3629                                 
3630                                 } else {
3631                                 
3632                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3633                                 
3634                                 }
3635                         
3636                         } else {
3637                         
3638                                 if (FirstToken == TRUE){
3639                         
3640                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3641                                         FirstToken = FALSE;
3642                                                                 
3643                                 } else {
3644                                 
3645                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3646                                         
3647                                 }
3648                         
3649                         }
3650                         
3651                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3652                         PropertyName = PropertyElement.GetNextToken();                          
3653                         PropertyValue = PropertyElement.GetNextToken();
3655                         intPrevValue = intiter->second;
3656                         
3657                         // Process properties.
3658                         
3659                         // Check if there is a lock on the property value. If there is a lock then
3660                         // the property value cannot be changed.
3661                         
3662                         if (PropertyName.IsEmpty()){
3663                         
3664                                 continue;
3665                         
3666                         }
3667                         
3668                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3669                         
3670                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3671                         
3672                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3673                         
3674                                 } else {
3675                         
3676                                         PropertyDataMap->erase(PropertyName);
3677                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3678                         
3679                                 }
3680                                 
3681                         }
3682                 
3683                 }
3684                 
3685                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3686                 *XVCardV4Value = TRUE;
3687                                 
3688         }
3689         
3690         // X-VCARD4-TEL
3691         
3692         if (wxSProperty == wxT("X-VCARD4-TEL")){
3694                 if (ProcessItemData == TRUE){
3695         
3696                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
3697                 
3698                 } else {
3699                 
3700                         intPropertyLen = wxSPropertySeg1Ptr->Len();
3701                 
3702                 }
3703                 
3704                 std::map<int, int> SplitPoints;
3705                 std::map<int, int> SplitLength;
3706                 std::map<int, int>::iterator SLiter;
3707                 std::map<wxString, bool>::iterator BIter;;                      
3708                 wxString PropertyData;
3709                 wxString PropertyName;
3710                 wxString PropertyValue;
3711                 wxString PropertyTokens;
3712                 bool FirstToken = TRUE;
3713                 int intPrevValue = 14;
3715                 if (ProcessItemData == TRUE){
3716                 
3717                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3718                         
3719                 } else {
3720                         
3721                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3722                         *wxSPropertyDataNameOut = wxT("TEL");
3723                         
3724                 }
3725                 
3726                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
3727                 intiter != SplitPoints.end(); ++intiter){
3728                 
3729                         SLiter = SplitLength.find(intiter->first);
3730                 
3731                         if (ProcessItemData == TRUE){
3733                                 if (FirstToken == TRUE){
3734                 
3735                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3736                                         FirstToken = FALSE;
3737                                 
3738                                 } else {
3739                                 
3740                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3741                                 
3742                                 }
3743                         
3744                         } else {
3745                         
3746                                 if (FirstToken == TRUE){
3747                         
3748                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3749                                         FirstToken = FALSE;
3750                                                                 
3751                                 } else {
3752                                 
3753                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3754                                         
3755                                 }
3756                         
3757                         }
3758                         
3759                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3760                         PropertyName = PropertyElement.GetNextToken();                          
3761                         PropertyValue = PropertyElement.GetNextToken();
3762                         
3763                         intPrevValue = intiter->second;
3764                         
3765                         // Process properties.
3766                         
3767                         // Check if there is a lock on the property value. If there is a lock then
3768                         // the property value cannot be changed.
3769                         
3770                         if (PropertyName.IsEmpty()){
3771                         
3772                                 continue;
3773                         
3774                         }
3775                         
3776                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3777                         
3778                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3779                         
3780                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3781                         
3782                                 } else {
3783                         
3784                                         PropertyDataMap->erase(PropertyName);
3785                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3786                         
3787                                 }
3788                                 
3789                         }
3790                 
3791                 }
3792                 
3793                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3794                 *XVCardV4Value = TRUE;
3795                                 
3796         }
3797         
3798         // X-VCARD4-LANG
3799         
3800         if (wxSProperty == wxT("X-VCARD4-LANG")){
3802                 if (ProcessItemData == TRUE){
3803         
3804                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
3805                 
3806                 } else {
3807                 
3808                         intPropertyLen = wxSPropertySeg1Ptr->Len();
3809                 
3810                 }
3811                 
3812                 std::map<int, int> SplitPoints;
3813                 std::map<int, int> SplitLength;
3814                 std::map<int, int>::iterator SLiter;
3815                 std::map<wxString, bool>::iterator BIter;;                      
3816                 wxString PropertyData;
3817                 wxString PropertyName;
3818                 wxString PropertyValue;
3819                 wxString PropertyTokens;
3820                 bool FirstToken = TRUE;
3821                 int intPrevValue = 15;
3823                 if (ProcessItemData == TRUE){
3824                 
3825                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3826                         
3827                 } else {
3828                         
3829                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3830                         *wxSPropertyDataNameOut = wxT("LANG");
3831                         
3832                 }
3833                 
3834                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
3835                 intiter != SplitPoints.end(); ++intiter){
3836                 
3837                         SLiter = SplitLength.find(intiter->first);
3838                 
3839                         if (ProcessItemData == TRUE){
3841                                 if (FirstToken == TRUE){
3842                 
3843                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3844                                         FirstToken = FALSE;
3845                                 
3846                                 } else {
3847                                 
3848                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3849                                 
3850                                 }
3851                         
3852                         } else {
3853                         
3854                                 if (FirstToken == TRUE){
3855                         
3856                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3857                                         FirstToken = FALSE;
3858                                                                 
3859                                 } else {
3860                                 
3861                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3862                                         
3863                                 }
3864                         
3865                         }
3866                         
3867                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3868                         PropertyName = PropertyElement.GetNextToken();                          
3869                         PropertyValue = PropertyElement.GetNextToken();
3870                         
3871                         intPrevValue = intiter->second;
3872                         
3873                         // Process properties.
3874                         
3875                         // Check if there is a lock on the property value. If there is a lock then
3876                         // the property value cannot be changed.
3877                         
3878                         if (PropertyName.IsEmpty()){
3879                         
3880                                 continue;
3881                         
3882                         }
3883                         
3884                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3885                         
3886                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3887                         
3888                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3889                         
3890                                 } else {
3891                         
3892                                         PropertyDataMap->erase(PropertyName);
3893                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3894                         
3895                                 }
3896                                 
3897                         }
3898                 
3899                 }
3900                 
3901                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3902                 *XVCardV4Value = TRUE;
3903                                 
3904         }
3905         
3906         // X-VCARD4-GEO
3907         
3908         if (wxSProperty == wxT("X-VCARD4-GEO")){
3910                 if (ProcessItemData == TRUE){
3911         
3912                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
3913                 
3914                 } else {
3915                 
3916                         intPropertyLen = wxSPropertySeg1Ptr->Len();
3917                 
3918                 }
3919                 
3920                 std::map<int, int> SplitPoints;
3921                 std::map<int, int> SplitLength;
3922                 std::map<int, int>::iterator SLiter;
3923                 std::map<wxString, bool>::iterator BIter;;                      
3924                 wxString PropertyData;
3925                 wxString PropertyName;
3926                 wxString PropertyValue;
3927                 wxString PropertyTokens;
3928                 bool FirstToken = TRUE;
3929                 int intPrevValue = 14;
3931                 if (ProcessItemData == TRUE){
3932                 
3933                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3934                         
3935                 } else {
3936                         
3937                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3938                         *wxSPropertyDataNameOut = wxT("GEO");
3939                         
3940                 }
3941                 
3942                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
3943                 intiter != SplitPoints.end(); ++intiter){
3944                 
3945                         SLiter = SplitLength.find(intiter->first);
3946                 
3947                         if (ProcessItemData == TRUE){
3949                                 if (FirstToken == TRUE){
3950                 
3951                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3952                                         FirstToken = FALSE;
3953                                 
3954                                 } else {
3955                                 
3956                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3957                                 
3958                                 }
3959                         
3960                         } else {
3961                         
3962                                 if (FirstToken == TRUE){
3963                         
3964                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3965                                         FirstToken = FALSE;
3966                                                                 
3967                                 } else {
3968                                 
3969                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3970                                         
3971                                 }
3972                         
3973                         }
3974                         
3975                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3976                         PropertyName = PropertyElement.GetNextToken();                          
3977                         PropertyValue = PropertyElement.GetNextToken();
3978                         
3979                         intPrevValue = intiter->second;
3980                         
3981                         // Process properties.
3982                         
3983                         // Check if there is a lock on the property value. If there is a lock then
3984                         // the property value cannot be changed.
3985                         
3986                         if (PropertyName.IsEmpty()){
3987                         
3988                                 continue;
3989                         
3990                         }
3991                         
3992                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3993                         
3994                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3995                         
3996                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3997                         
3998                                 } else {
3999                         
4000                                         PropertyDataMap->erase(PropertyName);
4001                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4002                         
4003                                 }
4004                                 
4005                         }
4006                 
4007                 }
4008                 
4009                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4010                 *XVCardV4Value = TRUE;
4011                                 
4012         }
4013         
4014         // X-VCARD4-RELATED
4015         
4016         if (wxSProperty == wxT("X-VCARD4-RELATED")){
4018                 if (ProcessItemData == TRUE){
4019         
4020                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
4021                 
4022                 } else {
4023                 
4024                         intPropertyLen = wxSPropertySeg1Ptr->Len();
4025                 
4026                 }
4027                 
4028                 std::map<int, int> SplitPoints;
4029                 std::map<int, int> SplitLength;
4030                 std::map<int, int>::iterator SLiter;
4031                 std::map<wxString, bool>::iterator BIter;;                      
4032                 wxString PropertyData;
4033                 wxString PropertyName;
4034                 wxString PropertyValue;
4035                 wxString PropertyTokens;
4036                 bool FirstToken = TRUE;
4037                 int intPrevValue = 18;
4039                 if (ProcessItemData == TRUE){
4040                 
4041                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4042                         
4043                 } else {
4044                         
4045                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4046                         *wxSPropertyDataNameOut = wxT("RELATED");
4047                         
4048                 }
4049                 
4050                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
4051                 intiter != SplitPoints.end(); ++intiter){
4052                 
4053                         SLiter = SplitLength.find(intiter->first);
4054                 
4055                         if (ProcessItemData == TRUE){
4057                                 if (FirstToken == TRUE){
4058                 
4059                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4060                                         FirstToken = FALSE;
4061                                 
4062                                 } else {
4063                                 
4064                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4065                                 
4066                                 }
4067                         
4068                         } else {
4069                         
4070                                 if (FirstToken == TRUE){
4071                         
4072                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4073                                         FirstToken = FALSE;
4074                                                                 
4075                                 } else {
4076                                 
4077                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4078                                         
4079                                 }
4080                         
4081                         }
4082                         
4083                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4084                         PropertyName = PropertyElement.GetNextToken();                          
4085                         PropertyValue = PropertyElement.GetNextToken();
4086                         
4087                         intPrevValue = intiter->second;
4088                         
4089                         // Process properties.
4090                         
4091                         // Check if there is a lock on the property value. If there is a lock then
4092                         // the property value cannot be changed.
4093                         
4094                         if (PropertyName.IsEmpty()){
4095                         
4096                                 continue;
4097                         
4098                         }
4099                         
4100                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4101                         
4102                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4103                         
4104                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4105                         
4106                                 } else {
4107                         
4108                                         PropertyDataMap->erase(PropertyName);
4109                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4110                         
4111                                 }
4112                                 
4113                         }
4114                 
4115                 }
4116                 
4117                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4118                 *XVCardV4Value = TRUE;
4119                                 
4120         }
4121         
4122         // X-VCARD4-URL
4123         
4124         if (wxSProperty == wxT("X-VCARD4-URL")){
4126                 if (ProcessItemData == TRUE){
4127         
4128                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
4129                 
4130                 } else {
4131                 
4132                         intPropertyLen = wxSPropertySeg1Ptr->Len();
4133                 
4134                 }
4135                 
4136                 std::map<int, int> SplitPoints;
4137                 std::map<int, int> SplitLength;
4138                 std::map<int, int>::iterator SLiter;
4139                 std::map<wxString, bool>::iterator BIter;;                      
4140                 wxString PropertyData;
4141                 wxString PropertyName;
4142                 wxString PropertyValue;
4143                 wxString PropertyTokens;
4144                 bool FirstToken = TRUE;
4145                 int intPrevValue = 14;
4147                 if (ProcessItemData == TRUE){
4148                 
4149                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4150                         
4151                 } else {
4152                         
4153                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4154                         *wxSPropertyDataNameOut = wxT("URL");
4155                         
4156                 }
4157                 
4158                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
4159                 intiter != SplitPoints.end(); ++intiter){
4160                 
4161                         SLiter = SplitLength.find(intiter->first);
4162                 
4163                         if (ProcessItemData == TRUE){
4165                                 if (FirstToken == TRUE){
4166                 
4167                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4168                                         FirstToken = FALSE;
4169                                 
4170                                 } else {
4171                                 
4172                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4173                                 
4174                                 }
4175                         
4176                         } else {
4177                         
4178                                 if (FirstToken == TRUE){
4179                         
4180                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4181                                         FirstToken = FALSE;
4182                                                                 
4183                                 } else {
4184                                 
4185                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4186                                         
4187                                 }
4188                         
4189                         }
4190                         
4191                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4192                         PropertyName = PropertyElement.GetNextToken();                          
4193                         PropertyValue = PropertyElement.GetNextToken();
4194                         
4195                         intPrevValue = intiter->second;
4196                         
4197                         // Process properties.
4198                         
4199                         // Check if there is a lock on the property value. If there is a lock then
4200                         // the property value cannot be changed.
4201                         
4202                         if (PropertyName.IsEmpty()){
4203                         
4204                                 continue;
4205                         
4206                         }
4207                         
4208                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4209                         
4210                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4211                         
4212                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4213                         
4214                                 } else {
4215                         
4216                                         PropertyDataMap->erase(PropertyName);
4217                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4218                         
4219                                 }
4220                                 
4221                         }
4222                 
4223                 }
4224                 
4225                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4226                 *XVCardV4Value = TRUE;
4227                                 
4228         }
4229         
4230         // X-VCARD4-TITLE
4231         
4232         if (wxSProperty == wxT("X-VCARD4-TITLE")){
4234                 if (ProcessItemData == TRUE){
4235         
4236                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
4237                 
4238                 } else {
4239                 
4240                         intPropertyLen = wxSPropertySeg1Ptr->Len();
4241                 
4242                 }
4243                 
4244                 std::map<int, int> SplitPoints;
4245                 std::map<int, int> SplitLength;
4246                 std::map<int, int>::iterator SLiter;
4247                 std::map<wxString, bool>::iterator BIter;;                      
4248                 wxString PropertyData;
4249                 wxString PropertyName;
4250                 wxString PropertyValue;
4251                 wxString PropertyTokens;
4252                 bool FirstToken = TRUE;
4253                 int intPrevValue = 16;
4255                 if (ProcessItemData == TRUE){
4256                 
4257                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4258                         
4259                 } else {
4260                         
4261                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4262                         *wxSPropertyDataNameOut = wxT("TITLE");
4263                         
4264                 }
4265                 
4266                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
4267                 intiter != SplitPoints.end(); ++intiter){
4268                 
4269                         SLiter = SplitLength.find(intiter->first);
4270                 
4271                         if (ProcessItemData == TRUE){
4273                                 if (FirstToken == TRUE){
4274                 
4275                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4276                                         FirstToken = FALSE;
4277                                 
4278                                 } else {
4279                                 
4280                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4281                                 
4282                                 }
4283                         
4284                         } else {
4285                         
4286                                 if (FirstToken == TRUE){
4287                         
4288                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4289                                         FirstToken = FALSE;
4290                                                                 
4291                                 } else {
4292                                 
4293                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4294                                         
4295                                 }
4296                         
4297                         }
4298                         
4299                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4300                         PropertyName = PropertyElement.GetNextToken();                          
4301                         PropertyValue = PropertyElement.GetNextToken();
4302                         
4303                         intPrevValue = intiter->second;
4304                         
4305                         // Process properties.
4306                         
4307                         // Check if there is a lock on the property value. If there is a lock then
4308                         // the property value cannot be changed.
4309                         
4310                         if (PropertyName.IsEmpty()){
4311                         
4312                                 continue;
4313                         
4314                         }
4315                         
4316                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4317                         
4318                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4319                         
4320                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4321                         
4322                                 } else {
4323                         
4324                                         PropertyDataMap->erase(PropertyName);
4325                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4326                         
4327                                 }
4328                                 
4329                         }
4330                 
4331                 }
4332                 
4333                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4334                 *XVCardV4Value = TRUE;
4335                                 
4336         }
4337         
4338         // X-VCARD4-ROLE
4339         
4340         if (wxSProperty == wxT("X-VCARD4-ROLE")){
4342                 if (ProcessItemData == TRUE){
4343         
4344                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
4345                 
4346                 } else {
4347                 
4348                         intPropertyLen = wxSPropertySeg1Ptr->Len();
4349                 
4350                 }
4351                 
4352                 std::map<int, int> SplitPoints;
4353                 std::map<int, int> SplitLength;
4354                 std::map<int, int>::iterator SLiter;
4355                 std::map<wxString, bool>::iterator BIter;;                      
4356                 wxString PropertyData;
4357                 wxString PropertyName;
4358                 wxString PropertyValue;
4359                 wxString PropertyTokens;
4360                 bool FirstToken = TRUE;
4361                 int intPrevValue = 15;
4363                 if (ProcessItemData == TRUE){
4364                 
4365                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4366                         
4367                 } else {
4368                         
4369                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4370                         *wxSPropertyDataNameOut = wxT("ROLE");
4371                         
4372                 }
4373                 
4374                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
4375                 intiter != SplitPoints.end(); ++intiter){
4376                 
4377                         SLiter = SplitLength.find(intiter->first);
4378                 
4379                         if (ProcessItemData == TRUE){
4381                                 if (FirstToken == TRUE){
4382                 
4383                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4384                                         FirstToken = FALSE;
4385                                 
4386                                 } else {
4387                                 
4388                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4389                                 
4390                                 }
4391                         
4392                         } else {
4393                         
4394                                 if (FirstToken == TRUE){
4395                         
4396                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4397                                         FirstToken = FALSE;
4398                                                                 
4399                                 } else {
4400                                 
4401                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4402                                         
4403                                 }
4404                         
4405                         }
4406                         
4407                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4408                         PropertyName = PropertyElement.GetNextToken();                          
4409                         PropertyValue = PropertyElement.GetNextToken();
4410                         
4411                         intPrevValue = intiter->second;
4412                         
4413                         // Process properties.
4414                         
4415                         // Check if there is a lock on the property value. If there is a lock then
4416                         // the property value cannot be changed.
4417                         
4418                         if (PropertyName.IsEmpty()){
4419                         
4420                                 continue;
4421                         
4422                         }
4423                         
4424                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4425                         
4426                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4427                         
4428                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4429                         
4430                                 } else {
4431                         
4432                                         PropertyDataMap->erase(PropertyName);
4433                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4434                         
4435                                 }
4436                                 
4437                         }
4438                 
4439                 }
4440                 
4441                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4442                 *XVCardV4Value = TRUE;
4443                                 
4444         }
4445         
4446         // X-VCARD4-ORG
4447         
4448         if (wxSProperty == wxT("X-VCARD4-ORG")){
4450                 if (ProcessItemData == TRUE){
4451         
4452                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
4453                 
4454                 } else {
4455                 
4456                         intPropertyLen = wxSPropertySeg1Ptr->Len();
4457                 
4458                 }
4459                 
4460                 std::map<int, int> SplitPoints;
4461                 std::map<int, int> SplitLength;
4462                 std::map<int, int>::iterator SLiter;
4463                 std::map<wxString, bool>::iterator BIter;;                      
4464                 wxString PropertyData;
4465                 wxString PropertyName;
4466                 wxString PropertyValue;
4467                 wxString PropertyTokens;
4468                 bool FirstToken = TRUE;
4469                 int intPrevValue = 14;
4471                 if (ProcessItemData == TRUE){
4472                 
4473                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4474                         
4475                 } else {
4476                         
4477                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4478                         *wxSPropertyDataNameOut = wxT("ORG");
4479                         
4480                 }
4481                 
4482                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
4483                 intiter != SplitPoints.end(); ++intiter){
4484                 
4485                         SLiter = SplitLength.find(intiter->first);
4486                 
4487                         if (ProcessItemData == TRUE){
4489                                 if (FirstToken == TRUE){
4490                 
4491                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4492                                         FirstToken = FALSE;
4493                                 
4494                                 } else {
4495                                 
4496                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4497                                 
4498                                 }
4499                         
4500                         } else {
4501                         
4502                                 if (FirstToken == TRUE){
4503                         
4504                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4505                                         FirstToken = FALSE;
4506                                                                 
4507                                 } else {
4508                                 
4509                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4510                                         
4511                                 }
4512                         
4513                         }
4514                         
4515                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4516                         PropertyName = PropertyElement.GetNextToken();                          
4517                         PropertyValue = PropertyElement.GetNextToken();
4518                         
4519                         intPrevValue = intiter->second;
4520                         
4521                         // Process properties.
4522                         
4523                         // Check if there is a lock on the property value. If there is a lock then
4524                         // the property value cannot be changed.
4525                         
4526                         if (PropertyName.IsEmpty()){
4527                         
4528                                 continue;
4529                         
4530                         }
4531                         
4532                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4533                         
4534                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4535                         
4536                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4537                         
4538                                 } else {
4539                         
4540                                         PropertyDataMap->erase(PropertyName);
4541                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4542                         
4543                                 }
4544                                 
4545                         }
4546                 
4547                 }
4548                 
4549                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4550                 *XVCardV4Value = TRUE;
4551                                 
4552         }
4553         
4554         // X-VCARD4-NOTE
4555         
4556         if (wxSProperty == wxT("X-VCARD4-NOTE")){
4558                 if (ProcessItemData == TRUE){
4559         
4560                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
4561                 
4562                 } else {
4563                 
4564                         intPropertyLen = wxSPropertySeg1Ptr->Len();
4565                 
4566                 }
4567                 
4568                 std::map<int, int> SplitPoints;
4569                 std::map<int, int> SplitLength;
4570                 std::map<int, int>::iterator SLiter;
4571                 std::map<wxString, bool>::iterator BIter;;                      
4572                 wxString PropertyData;
4573                 wxString PropertyName;
4574                 wxString PropertyValue;
4575                 wxString PropertyTokens;
4576                 bool FirstToken = TRUE;
4577                 int intPrevValue = 15;
4579                 if (ProcessItemData == TRUE){
4580                 
4581                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4582                         
4583                 } else {
4584                         
4585                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4586                         *wxSPropertyDataNameOut = wxT("NOTE");
4587                         
4588                 }
4589                 
4590                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
4591                 intiter != SplitPoints.end(); ++intiter){
4592                 
4593                         SLiter = SplitLength.find(intiter->first);
4594                 
4595                         if (ProcessItemData == TRUE){
4597                                 if (FirstToken == TRUE){
4598                 
4599                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4600                                         FirstToken = FALSE;
4601                                 
4602                                 } else {
4603                                 
4604                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4605                                 
4606                                 }
4607                         
4608                         } else {
4609                         
4610                                 if (FirstToken == TRUE){
4611                         
4612                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4613                                         FirstToken = FALSE;
4614                                                                 
4615                                 } else {
4616                                 
4617                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4618                                         
4619                                 }
4620                         
4621                         }
4622                         
4623                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4624                         PropertyName = PropertyElement.GetNextToken();                          
4625                         PropertyValue = PropertyElement.GetNextToken();
4626                         
4627                         intPrevValue = intiter->second;
4628                         
4629                         // Process properties.
4630                         
4631                         // Check if there is a lock on the property value. If there is a lock then
4632                         // the property value cannot be changed.
4633                         
4634                         if (PropertyName.IsEmpty()){
4635                         
4636                                 continue;
4637                         
4638                         }
4639                         
4640                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4641                         
4642                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4643                         
4644                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4645                         
4646                                 } else {
4647                         
4648                                         PropertyDataMap->erase(PropertyName);
4649                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4650                         
4651                                 }
4652                                 
4653                         }
4654                 
4655                 }
4656                 
4657                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4658                 *XVCardV4Value = TRUE;
4659                                 
4660         }
4661         
4662         // X-VCARD4-CATEGORIES
4663         
4664         if (wxSProperty == wxT("X-VCARD4-CATEGORIES")){
4666                 if (ProcessItemData == TRUE){
4667         
4668                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
4669                 
4670                 } else {
4671                 
4672                         intPropertyLen = wxSPropertySeg1Ptr->Len();
4673                 
4674                 }
4675                 
4676                 std::map<int, int> SplitPoints;
4677                 std::map<int, int> SplitLength;
4678                 std::map<int, int>::iterator SLiter;
4679                 std::map<wxString, bool>::iterator BIter;;                      
4680                 wxString PropertyData;
4681                 wxString PropertyName;
4682                 wxString PropertyValue;
4683                 wxString PropertyTokens;
4684                 bool FirstToken = TRUE;
4685                 int intPrevValue = 21;
4687                 if (ProcessItemData == TRUE){
4688                 
4689                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4690                         
4691                 } else {
4692                         
4693                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4694                         *wxSPropertyDataNameOut = wxT("CATEGORIES");
4695                         
4696                 }
4697                 
4698                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
4699                 intiter != SplitPoints.end(); ++intiter){
4700                 
4701                         SLiter = SplitLength.find(intiter->first);
4702                 
4703                         if (ProcessItemData == TRUE){
4705                                 if (FirstToken == TRUE){
4706                 
4707                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4708                                         FirstToken = FALSE;
4709                                 
4710                                 } else {
4711                                 
4712                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4713                                 
4714                                 }
4715                         
4716                         } else {
4717                         
4718                                 if (FirstToken == TRUE){
4719                         
4720                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4721                                         FirstToken = FALSE;
4722                                                                 
4723                                 } else {
4724                                 
4725                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4726                                         
4727                                 }
4728                         
4729                         }
4730                         
4731                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4732                         PropertyName = PropertyElement.GetNextToken();                          
4733                         PropertyValue = PropertyElement.GetNextToken();
4734                         
4735                         intPrevValue = intiter->second;
4736                         
4737                         // Process properties.
4738                         
4739                         // Check if there is a lock on the property value. If there is a lock then
4740                         // the property value cannot be changed.
4741                         
4742                         if (PropertyName.IsEmpty()){
4743                         
4744                                 continue;
4745                         
4746                         }
4747                         
4748                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4749                         
4750                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4751                         
4752                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4753                         
4754                                 } else {
4755                         
4756                                         PropertyDataMap->erase(PropertyName);
4757                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4758                         
4759                                 }
4760                                 
4761                         }
4762                 
4763                 }
4764                 
4765                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4766                 *XVCardV4Value = TRUE;
4767                                 
4768         }
4769         
4770         // X-VCARD4-PHOTO
4771         
4772         if (wxSProperty == wxT("X-VCARD4-PHOTO")){
4774                 if (ProcessItemData == TRUE){
4775         
4776                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
4777                 
4778                 } else {
4779                 
4780                         intPropertyLen = wxSPropertySeg1Ptr->Len();
4781                 
4782                 }
4783                 
4784                 std::map<int, int> SplitPoints;
4785                 std::map<int, int> SplitLength;
4786                 std::map<int, int>::iterator SLiter;
4787                 std::map<wxString, bool>::iterator BIter;;                      
4788                 wxString PropertyData;
4789                 wxString PropertyName;
4790                 wxString PropertyValue;
4791                 wxString PropertyTokens;
4792                 bool FirstToken = TRUE;
4793                 int intPrevValue = 16;
4795                 if (ProcessItemData == TRUE){
4796                 
4797                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4798                         
4799                 } else {
4800                         
4801                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4802                         *wxSPropertyDataNameOut = wxT("PHOTO");
4803                         
4804                 }
4805                 
4806                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
4807                 intiter != SplitPoints.end(); ++intiter){
4808                 
4809                         SLiter = SplitLength.find(intiter->first);
4810                 
4811                         if (ProcessItemData == TRUE){
4813                                 if (FirstToken == TRUE){
4814                 
4815                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4816                                         FirstToken = FALSE;
4817                                 
4818                                 } else {
4819                                 
4820                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4821                                 
4822                                 }
4823                         
4824                         } else {
4825                         
4826                                 if (FirstToken == TRUE){
4827                         
4828                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4829                                         FirstToken = FALSE;
4830                                                                 
4831                                 } else {
4832                                 
4833                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4834                                         
4835                                 }
4836                         
4837                         }
4838                         
4839                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4840                         PropertyName = PropertyElement.GetNextToken();                          
4841                         PropertyValue = PropertyElement.GetNextToken();
4842                         
4843                         intPrevValue = intiter->second;
4844                         
4845                         // Process properties.
4846                         
4847                         // Check if there is a lock on the property value. If there is a lock then
4848                         // the property value cannot be changed.
4849                         
4850                         if (PropertyName.IsEmpty()){
4851                         
4852                                 continue;
4853                         
4854                         }
4855                         
4856                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4857                         
4858                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4859                         
4860                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4861                         
4862                                 } else {
4863                         
4864                                         PropertyDataMap->erase(PropertyName);
4865                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4866                         
4867                                 }
4868                                 
4869                         }
4870                 
4871                 }
4872                 
4873                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4874                 *XVCardV4Value = TRUE;
4875                                 
4876         }
4877         
4878         // X-VCARD4-LOGO
4879         
4880         if (wxSProperty == wxT("X-VCARD4-LOGO")){
4882                 if (ProcessItemData == TRUE){
4883         
4884                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
4885                 
4886                 } else {
4887                 
4888                         intPropertyLen = wxSPropertySeg1Ptr->Len();
4889                 
4890                 }
4891                 
4892                 std::map<int, int> SplitPoints;
4893                 std::map<int, int> SplitLength;
4894                 std::map<int, int>::iterator SLiter;
4895                 std::map<wxString, bool>::iterator BIter;;                      
4896                 wxString PropertyData;
4897                 wxString PropertyName;
4898                 wxString PropertyValue;
4899                 wxString PropertyTokens;
4900                 bool FirstToken = TRUE;
4901                 int intPrevValue = 15;
4903                 if (ProcessItemData == TRUE){
4904                 
4905                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4906                         
4907                 } else {
4908                         
4909                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4910                         *wxSPropertyDataNameOut = wxT("LOGO");
4911                         
4912                 }
4913                 
4914                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
4915                 intiter != SplitPoints.end(); ++intiter){
4916                 
4917                         SLiter = SplitLength.find(intiter->first);
4918                 
4919                         if (ProcessItemData == TRUE){
4921                                 if (FirstToken == TRUE){
4922                 
4923                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4924                                         FirstToken = FALSE;
4925                                 
4926                                 } else {
4927                                 
4928                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4929                                 
4930                                 }
4931                         
4932                         } else {
4933                         
4934                                 if (FirstToken == TRUE){
4935                         
4936                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4937                                         FirstToken = FALSE;
4938                                                                 
4939                                 } else {
4940                                 
4941                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4942                                         
4943                                 }
4944                         
4945                         }
4946                         
4947                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4948                         PropertyName = PropertyElement.GetNextToken();                          
4949                         PropertyValue = PropertyElement.GetNextToken();
4950                         
4951                         intPrevValue = intiter->second;
4952                         
4953                         // Process properties.
4954                         
4955                         // Check if there is a lock on the property value. If there is a lock then
4956                         // the property value cannot be changed.
4957                         
4958                         if (PropertyName.IsEmpty()){
4959                         
4960                                 continue;
4961                         
4962                         }
4963                         
4964                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4965                         
4966                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4967                         
4968                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4969                         
4970                                 } else {
4971                         
4972                                         PropertyDataMap->erase(PropertyName);
4973                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4974                         
4975                                 }
4976                                 
4977                         }
4978                 
4979                 }
4980                 
4981                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4982                 *XVCardV4Value = TRUE;
4983                                 
4984         }
4985         
4986         // X-VCARD4-SOUND
4987         
4988         if (wxSProperty == wxT("X-VCARD4-SOUND")){
4990                 if (ProcessItemData == TRUE){
4991         
4992                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
4993                 
4994                 } else {
4995                 
4996                         intPropertyLen = wxSPropertySeg1Ptr->Len();
4997                 
4998                 }
4999                 
5000                 std::map<int, int> SplitPoints;
5001                 std::map<int, int> SplitLength;
5002                 std::map<int, int>::iterator SLiter;
5003                 std::map<wxString, bool>::iterator BIter;;                      
5004                 wxString PropertyData;
5005                 wxString PropertyName;
5006                 wxString PropertyValue;
5007                 wxString PropertyTokens;
5008                 bool FirstToken = TRUE;
5009                 int intPrevValue = 16;
5011                 if (ProcessItemData == TRUE){
5012                 
5013                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5014                         
5015                 } else {
5016                         
5017                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5018                         *wxSPropertyDataNameOut = wxT("SOUND");
5019                         
5020                 }
5021                 
5022                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
5023                 intiter != SplitPoints.end(); ++intiter){
5024                 
5025                         SLiter = SplitLength.find(intiter->first);
5026                 
5027                         if (ProcessItemData == TRUE){
5029                                 if (FirstToken == TRUE){
5030                 
5031                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5032                                         FirstToken = FALSE;
5033                                 
5034                                 } else {
5035                                 
5036                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5037                                 
5038                                 }
5039                         
5040                         } else {
5041                         
5042                                 if (FirstToken == TRUE){
5043                         
5044                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5045                                         FirstToken = FALSE;
5046                                                                 
5047                                 } else {
5048                                 
5049                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5050                                         
5051                                 }
5052                         
5053                         }
5054                         
5055                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5056                         PropertyName = PropertyElement.GetNextToken();                          
5057                         PropertyValue = PropertyElement.GetNextToken();
5058                         
5059                         intPrevValue = intiter->second;
5060                         
5061                         // Process properties.
5062                         
5063                         // Check if there is a lock on the property value. If there is a lock then
5064                         // the property value cannot be changed.
5065                         
5066                         if (PropertyName.IsEmpty()){
5067                         
5068                                 continue;
5069                         
5070                         }
5071                         
5072                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5073                         
5074                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5075                         
5076                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5077                         
5078                                 } else {
5079                         
5080                                         PropertyDataMap->erase(PropertyName);
5081                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5082                         
5083                                 }
5084                                 
5085                         }
5086                 
5087                 }
5088                 
5089                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5090                 *XVCardV4Value = TRUE;
5091                                 
5092         }
5093         
5094         // X-VCARD4-CALURI
5095         
5096         if (wxSProperty == wxT("X-VCARD4-CALURI")){
5098                 if (ProcessItemData == TRUE){
5099         
5100                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
5101                 
5102                 } else {
5103                 
5104                         intPropertyLen = wxSPropertySeg1Ptr->Len();
5105                 
5106                 }
5107                 
5108                 std::map<int, int> SplitPoints;
5109                 std::map<int, int> SplitLength;
5110                 std::map<int, int>::iterator SLiter;
5111                 std::map<wxString, bool>::iterator BIter;;                      
5112                 wxString PropertyData;
5113                 wxString PropertyName;
5114                 wxString PropertyValue;
5115                 wxString PropertyTokens;
5116                 bool FirstToken = TRUE;
5117                 int intPrevValue = 17;
5119                 if (ProcessItemData == TRUE){
5120                 
5121                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5122                         
5123                 } else {
5124                         
5125                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5126                         *wxSPropertyDataNameOut = wxT("CALURI");
5127                         
5128                 }
5129                 
5130                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
5131                 intiter != SplitPoints.end(); ++intiter){
5132                 
5133                         SLiter = SplitLength.find(intiter->first);
5134                 
5135                         if (ProcessItemData == TRUE){
5137                                 if (FirstToken == TRUE){
5138                 
5139                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5140                                         FirstToken = FALSE;
5141                                 
5142                                 } else {
5143                                 
5144                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5145                                 
5146                                 }
5147                         
5148                         } else {
5149                         
5150                                 if (FirstToken == TRUE){
5151                         
5152                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5153                                         FirstToken = FALSE;
5154                                                                 
5155                                 } else {
5156                                 
5157                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5158                                         
5159                                 }
5160                         
5161                         }
5162                         
5163                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5164                         PropertyName = PropertyElement.GetNextToken();                          
5165                         PropertyValue = PropertyElement.GetNextToken();
5166                         
5167                         intPrevValue = intiter->second;
5168                         
5169                         // Process properties.
5170                         
5171                         // Check if there is a lock on the property value. If there is a lock then
5172                         // the property value cannot be changed.
5173                         
5174                         if (PropertyName.IsEmpty()){
5175                         
5176                                 continue;
5177                         
5178                         }
5179                         
5180                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5181                         
5182                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5183                         
5184                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5185                         
5186                                 } else {
5187                         
5188                                         PropertyDataMap->erase(PropertyName);
5189                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5190                         
5191                                 }
5192                                 
5193                         }
5194                 
5195                 }
5196                 
5197                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5198                 *XVCardV4Value = TRUE;
5199                                 
5200         }
5201         
5202         // X-VCARD4-CALADRURI
5203         
5204         if (wxSProperty == wxT("X-VCARD4-CALADRURI")){
5206                 if (ProcessItemData == TRUE){
5207         
5208                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
5209                 
5210                 } else {
5211                 
5212                         intPropertyLen = wxSPropertySeg1Ptr->Len();
5213                 
5214                 }
5215                 
5216                 std::map<int, int> SplitPoints;
5217                 std::map<int, int> SplitLength;
5218                 std::map<int, int>::iterator SLiter;
5219                 std::map<wxString, bool>::iterator BIter;;                      
5220                 wxString PropertyData;
5221                 wxString PropertyName;
5222                 wxString PropertyValue;
5223                 wxString PropertyTokens;
5224                 bool FirstToken = TRUE;
5225                 int intPrevValue = 20;
5227                 if (ProcessItemData == TRUE){
5228                 
5229                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5230                         
5231                 } else {
5232                         
5233                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5234                         *wxSPropertyDataNameOut = wxT("CALADRURI");
5235                         
5236                 }
5237                 
5238                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
5239                 intiter != SplitPoints.end(); ++intiter){
5240                 
5241                         SLiter = SplitLength.find(intiter->first);
5242                 
5243                         if (ProcessItemData == TRUE){
5245                                 if (FirstToken == TRUE){
5246                 
5247                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5248                                         FirstToken = FALSE;
5249                                 
5250                                 } else {
5251                                 
5252                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5253                                 
5254                                 }
5255                         
5256                         } else {
5257                         
5258                                 if (FirstToken == TRUE){
5259                         
5260                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5261                                         FirstToken = FALSE;
5262                                                                 
5263                                 } else {
5264                                 
5265                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5266                                         
5267                                 }
5268                         
5269                         }
5270                         
5271                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5272                         PropertyName = PropertyElement.GetNextToken();                          
5273                         PropertyValue = PropertyElement.GetNextToken();
5274                         
5275                         intPrevValue = intiter->second;
5276                         
5277                         // Process properties.
5278                         
5279                         // Check if there is a lock on the property value. If there is a lock then
5280                         // the property value cannot be changed.
5281                         
5282                         if (PropertyName.IsEmpty()){
5283                         
5284                                 continue;
5285                         
5286                         }
5287                         
5288                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5289                         
5290                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5291                         
5292                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5293                         
5294                                 } else {
5295                         
5296                                         PropertyDataMap->erase(PropertyName);
5297                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5298                         
5299                                 }
5300                                 
5301                         }
5302                 
5303                 }
5304                 
5305                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5306                 *XVCardV4Value = TRUE;
5307                                 
5308         }
5309         
5310         // X-VCARD4-FBURL
5311         
5312         if (wxSProperty == wxT("X-VCARD4-FBURL")){
5314                 if (ProcessItemData == TRUE){
5315         
5316                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
5317                 
5318                 } else {
5319                 
5320                         intPropertyLen = wxSPropertySeg1Ptr->Len();
5321                 
5322                 }
5323                 
5324                 std::map<int, int> SplitPoints;
5325                 std::map<int, int> SplitLength;
5326                 std::map<int, int>::iterator SLiter;
5327                 std::map<wxString, bool>::iterator BIter;;                      
5328                 wxString PropertyData;
5329                 wxString PropertyName;
5330                 wxString PropertyValue;
5331                 wxString PropertyTokens;
5332                 bool FirstToken = TRUE;
5333                 int intPrevValue = 16;
5335                 if (ProcessItemData == TRUE){
5336                 
5337                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5338                         
5339                 } else {
5340                         
5341                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5342                         *wxSPropertyDataNameOut = wxT("FBURL");
5343                         
5344                 }
5345                 
5346                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
5347                 intiter != SplitPoints.end(); ++intiter){
5348                 
5349                         SLiter = SplitLength.find(intiter->first);
5350                 
5351                         if (ProcessItemData == TRUE){
5353                                 if (FirstToken == TRUE){
5354                 
5355                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5356                                         FirstToken = FALSE;
5357                                 
5358                                 } else {
5359                                 
5360                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5361                                 
5362                                 }
5363                         
5364                         } else {
5365                         
5366                                 if (FirstToken == TRUE){
5367                         
5368                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5369                                         FirstToken = FALSE;
5370                                                                 
5371                                 } else {
5372                                 
5373                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5374                                         
5375                                 }
5376                         
5377                         }
5378                         
5379                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5380                         PropertyName = PropertyElement.GetNextToken();                          
5381                         PropertyValue = PropertyElement.GetNextToken();
5382                         
5383                         intPrevValue = intiter->second;
5384                         
5385                         // Process properties.
5386                         
5387                         // Check if there is a lock on the property value. If there is a lock then
5388                         // the property value cannot be changed.
5389                         
5390                         if (PropertyName.IsEmpty()){
5391                         
5392                                 continue;
5393                         
5394                         }
5395                         
5396                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5397                         
5398                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5399                         
5400                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5401                         
5402                                 } else {
5403                         
5404                                         PropertyDataMap->erase(PropertyName);
5405                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5406                         
5407                                 }
5408                                 
5409                         }
5410                 
5411                 }
5412                 
5413                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5414                 *XVCardV4Value = TRUE;
5415                                 
5416         }
5417         
5418         // X-VCARD4-KEY
5419         
5420         if (wxSProperty == wxT("X-VCARD4-KEY")){
5422                 if (ProcessItemData == TRUE){
5423         
5424                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
5425                 
5426                 } else {
5427                 
5428                         intPropertyLen = wxSPropertySeg1Ptr->Len();
5429                 
5430                 }
5431                 
5432                 std::map<int, int> SplitPoints;
5433                 std::map<int, int> SplitLength;
5434                 std::map<int, int>::iterator SLiter;
5435                 std::map<wxString, bool>::iterator BIter;;                      
5436                 wxString PropertyData;
5437                 wxString PropertyName;
5438                 wxString PropertyValue;
5439                 wxString PropertyTokens;
5440                 bool FirstToken = TRUE;
5441                 int intPrevValue = 14;
5443                 if (ProcessItemData == TRUE){
5444                 
5445                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5446                         
5447                 } else {
5448                         
5449                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5450                         *wxSPropertyDataNameOut = wxT("KEY");
5451                         
5452                 }
5453                 
5454                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
5455                 intiter != SplitPoints.end(); ++intiter){
5456                 
5457                         SLiter = SplitLength.find(intiter->first);
5458                 
5459                         if (ProcessItemData == TRUE){
5461                                 if (FirstToken == TRUE){
5462                 
5463                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5464                                         FirstToken = FALSE;
5465                                 
5466                                 } else {
5467                                 
5468                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5469                                 
5470                                 }
5471                         
5472                         } else {
5473                         
5474                                 if (FirstToken == TRUE){
5475                         
5476                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5477                                         FirstToken = FALSE;
5478                                                                 
5479                                 } else {
5480                                 
5481                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5482                                         
5483                                 }
5484                         
5485                         }
5486                         
5487                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5488                         PropertyName = PropertyElement.GetNextToken();                          
5489                         PropertyValue = PropertyElement.GetNextToken();
5490                         
5491                         intPrevValue = intiter->second;
5492                         
5493                         // Process properties.
5494                         
5495                         // Check if there is a lock on the property value. If there is a lock then
5496                         // the property value cannot be changed.
5497                         
5498                         if (PropertyName.IsEmpty()){
5499                         
5500                                 continue;
5501                         
5502                         }
5503                         
5504                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5505                         
5506                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5507                         
5508                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5509                         
5510                                 } else {
5511                         
5512                                         PropertyDataMap->erase(PropertyName);
5513                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5514                         
5515                                 }
5516                                 
5517                         }
5518                 
5519                 }
5520                 
5521                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5522                 *XVCardV4Value = TRUE;
5523                                 
5524         }
5525         
5526         // X-VCARD4-VND-*
5527         
5528         if (wxSProperty.Mid(0, 12) == wxT("X-VCARD4-VND")){
5530                 if (ProcessItemData == TRUE){
5531         
5532                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
5533                 
5534                 } else {
5535                 
5536                         intPropertyLen = wxSPropertySeg1Ptr->Len();
5537                 
5538                 }
5539                 
5540                 std::map<int, int> SplitPoints;
5541                 std::map<int, int> SplitLength;
5542                 std::map<int, int>::iterator SLiter;
5543                 std::map<wxString, bool>::iterator BIter;;                      
5544                 wxString PropertyData;
5545                 wxString PropertyName;
5546                 wxString PropertyValue;
5547                 wxString PropertyTokens;
5548                 bool FirstToken = TRUE;
5549                 int intPrevValue = 14;
5551                 if (ProcessItemData == TRUE){
5552                 
5553                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5554                         
5555                 } else {
5556                         
5557                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5558                         *wxSPropertyDataNameOut = wxSProperty.Mid(9);
5559                         
5560                 }
5561                 
5562                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
5563                 intiter != SplitPoints.end(); ++intiter){
5564                 
5565                         SLiter = SplitLength.find(intiter->first);
5566                 
5567                         if (ProcessItemData == TRUE){
5569                                 if (FirstToken == TRUE){
5570                 
5571                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5572                                         FirstToken = FALSE;
5573                                 
5574                                 } else {
5575                                 
5576                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5577                                 
5578                                 }
5579                         
5580                         } else {
5581                         
5582                                 if (FirstToken == TRUE){
5583                         
5584                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5585                                         FirstToken = FALSE;
5586                                                                 
5587                                 } else {
5588                                 
5589                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5590                                         
5591                                 }
5592                         
5593                         }
5594                         
5595                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5596                         PropertyName = PropertyElement.GetNextToken();                          
5597                         PropertyValue = PropertyElement.GetNextToken();
5598                         
5599                         intPrevValue = intiter->second;
5600                         
5601                         // Process properties.
5602                         
5603                         // Check if there is a lock on the property value. If there is a lock then
5604                         // the property value cannot be changed.
5605                         
5606                         if (PropertyName.IsEmpty()){
5607                         
5608                                 continue;
5609                         
5610                         }
5611                         
5612                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5613                         
5614                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5615                         
5616                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5617                         
5618                                 } else {
5619                         
5620                                         PropertyDataMap->erase(PropertyName);
5621                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5622                         
5623                                 }
5624                                 
5625                         }
5626                 
5627                 }
5628                 
5629                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5630                 *XVCardV4Value = TRUE;          
5631         
5632         }
5633         
5634         // X-ADDRESSBOOKSERVER-KIND
5635         
5636         if (wxSProperty == wxT("X-ADDRESSBOOKSERVER-KIND")){
5637                 
5638                 // Process Data.
5640                 if (ProcessItemData == TRUE){
5641         
5642                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
5643                 
5644                 } else {
5645                 
5646                         intPropertyLen = wxSPropertySeg1Ptr->Len();
5647                 
5648                 }
5649                 
5650                 std::map<int, int> SplitPoints;
5651                 std::map<int, int> SplitLength;
5652                 std::map<int, int>::iterator SLiter;
5653                 std::map<wxString, bool>::iterator BIter;;                      
5654                 wxString PropertyData;
5655                 wxString PropertyName;
5656                 wxString PropertyValue;
5657                 wxString PropertyTokens;
5658                 bool FirstToken = TRUE;
5659                 int intPrevValue = 26;
5661                 if (ProcessItemData == TRUE){
5662                 
5663                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5664                         
5665                 } else {
5666                         
5667                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5668                         
5669                 }
5670                 
5671                 *wxSPropertyDataNameOut = wxT("KIND");
5672                 
5673                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
5674                 intiter != SplitPoints.end(); ++intiter){
5675                 
5676                         SLiter = SplitLength.find(intiter->first);
5677                 
5678                         if (ProcessItemData == TRUE){
5680                                 if (FirstToken == TRUE){
5681                 
5682                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5683                                         FirstToken = FALSE;
5684                                 
5685                                 } else {
5686                                 
5687                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5688                                 
5689                                 }
5690                         
5691                         } else {
5692                         
5693                                 if (FirstToken == TRUE){
5694                         
5695                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5696                                         FirstToken = FALSE;
5697                                                                 
5698                                 } else {
5699                                 
5700                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5701                                         
5702                                 }
5703                         
5704                         }
5705                         
5706                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5707                         PropertyName = PropertyElement.GetNextToken();                          
5708                         PropertyValue = PropertyElement.GetNextToken();
5709                         
5710                         intPrevValue = intiter->second;
5711                         
5712                         // Process properties.
5713                         
5714                         // Check if there is a lock on the property value. If there is a lock then
5715                         // the property value cannot be changed.
5716                         
5717                         if (PropertyName.IsEmpty()){
5718                         
5719                                 continue;
5720                         
5721                         }
5722                         
5723                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5724                         
5725                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5726                         
5727                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5728                         
5729                                 } else {
5730                         
5731                                         PropertyDataMap->erase(PropertyName);
5732                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5733                         
5734                                 }
5735                                 
5736                         }
5737                 
5738                 }
5739                 
5740                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5741                 *XVCardV4Value = TRUE;
5742                 
5743         }
5744         
5745         // X-ADDRESSBOOKSERVER-MEMBER
5746         
5747         if (wxSProperty == wxT("X-ADDRESSBOOKSERVER-MEMBER")){
5748                 
5749                 // Process Data.
5751                 if (ProcessItemData == TRUE){
5752         
5753                         intPropertyLen = wxSPropertySeg1Chopped.Len();          
5754                 
5755                 } else {
5756                 
5757                         intPropertyLen = wxSPropertySeg1Ptr->Len();
5758                 
5759                 }
5760                 
5761                 std::map<int, int> SplitPoints;
5762                 std::map<int, int> SplitLength;
5763                 std::map<int, int>::iterator SLiter;
5764                 std::map<wxString, bool>::iterator BIter;;
5765                 wxString PropertyData;
5766                 wxString PropertyName;
5767                 wxString PropertyValue;
5768                 wxString PropertyTokens;
5769                 bool FirstToken = TRUE;
5770                 int intPrevValue = 28;
5772                 if (ProcessItemData == TRUE){
5773                 
5774                         SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5775                         
5776                 } else {
5777                         
5778                         SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5779                         
5780                 }
5781                 
5782                 *wxSPropertyDataNameOut = wxT("MEMBER");
5783                 
5784                 for (std::map<int, int>::iterator intiter = SplitPoints.begin(); 
5785                 intiter != SplitPoints.end(); ++intiter){
5786                 
5787                         SLiter = SplitLength.find(intiter->first);
5788                 
5789                         if (ProcessItemData == TRUE){
5791                                 if (FirstToken == TRUE){
5792                 
5793                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5794                                         FirstToken = FALSE;
5795                                 
5796                                 } else {
5797                                 
5798                                         PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5799                                 
5800                                 }
5801                         
5802                         } else {
5803                         
5804                                 if (FirstToken == TRUE){
5805                         
5806                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5807                                         FirstToken = FALSE;
5808                                                                 
5809                                 } else {
5810                                 
5811                                         PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5812                                         
5813                                 }
5814                         
5815                         }
5816                         
5817                         wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5818                         PropertyName = PropertyElement.GetNextToken();                          
5819                         PropertyValue = PropertyElement.GetNextToken();
5820                         
5821                         intPrevValue = intiter->second;
5822                         
5823                         // Process properties.
5824                         
5825                         // Check if there is a lock on the property value. If there is a lock then
5826                         // the property value cannot be changed.
5827                         
5828                         if (PropertyName.IsEmpty()){
5829                         
5830                                 continue;
5831                         
5832                         }
5833                         
5834                         if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5835                         
5836                                 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5837                         
5838                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5839                         
5840                                 } else {
5841                         
5842                                         PropertyDataMap->erase(PropertyName);
5843                                         PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5844                         
5845                                 }
5846                                 
5847                         }
5848                 
5849                 }
5850                 
5851                 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5852                 *XVCardV4Value = TRUE;
5853                 
5854                 
5855         }
5856         
5857         // Deal with X-ABLabel specifically.
5858         
5859         if (wxSProperty == wxT("X-ABLabel") && ProcessItemData == TRUE){
5860         
5861         intPropertyLen = wxSPropertySeg1Ptr->Len();
5862         std::map<int, int> SplitPoints;
5863                 std::map<int, int> SplitLength;
5864                 std::map<int, int>::iterator SLiter;                    
5865                 wxString PropertyData;
5866                 wxString PropertyName;
5867                 wxString PropertyValue;
5868                 wxString PropertyTokens;
5869                 int intPrevValue = 11;
5870                 
5871                 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5873                 PropertyDataMap->insert(std::make_pair(wxT("X-ABLabel"), *wxSPropertySeg2Ptr));
5874                                 
5875         }
5879 void vCard34Conv::ProcessCaptureStringsProc(wxString *strCapture){
5881     CaptureString(strCapture, FALSE);
5885 void vCard34Conv::SplitValues(wxString *PropertyLine, 
5886         std::map<int,int> *SplitPoints, 
5887         std::map<int,int> *SplitLength, 
5888         int intSize){
5889         
5890         size_t intPropertyLen = PropertyLine->Len();
5891         int intSplitsFound = 0;
5892         int intSplitSize = 0;
5893         int intSplitSeek = 0;
5894         
5895         for (int i = intSize; i <= intPropertyLen; i++){
5897                 intSplitSize++;
5898         
5899                 if (PropertyLine->Mid(i, 1) == wxT(";") &&
5900                     PropertyLine->Mid((i - 1), 1) != wxT("\\")){
5901            
5902                     if (intSplitsFound == 0){
5903             
5904                         SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
5905           
5906                     } else {
5907            
5908                         SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
5909             
5910                     }
5911             
5912                     SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
5913             
5914                     intSplitsFound++;
5915                     intSplitSeek = i;
5916                     intSplitSize = 0;
5917             
5918                 }
5920         }
5922         if (intSplitsFound == 0){
5924                 SplitPoints->insert(std::make_pair(intSplitsFound, (8 + 1)));
5925                 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
5927         } else {
5929                 SplitPoints->insert(std::make_pair(intSplitsFound, (intSplitSeek + 1)));
5930                 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
5932         }
5936 void vCard34Conv::SplitValuesData(wxString *PropertyLine, 
5937         std::map<int,int> *SplitPoints, 
5938         std::map<int,int> *SplitLength, 
5939         int intSize,
5940         std::map<wxString,wxString> *SplitData){
5941         
5942         wxString DataStr;
5943         wxStringTokenizer PropertyElement;
5944         wxString PropertyName;
5945         wxString PropertyValue;
5946         size_t intPropertyLen = PropertyLine->Len();
5947         int intSplitsFound = 0;
5948         int intSplitSize = 0;
5949         int intSplitSeek = (intSize - 1);
5950         
5951         for (int i = intSize; i <= intPropertyLen; i++){
5953                 intSplitSize++;
5954         
5955                 if (PropertyLine->Mid(i, 1) == wxT(";") &&
5956                     PropertyLine->Mid((i - 1), 1) != wxT("\\")){
5957            
5958                     if (intSplitsFound == 0){
5959             
5960                                 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize));
5961                                 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
5962           
5963                         } else {
5965                                 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize - 1));
5966                                 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
5968                         }
5969                     
5970                     SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
5971             
5972                     intSplitsFound++;
5973                     intSplitSeek = (i + 1);
5974                     intSplitSize = 0;
5975                     
5976                     if (!DataStr.IsEmpty()){
5977                     
5978                         PropertyElement.SetString(DataStr, wxT("="));
5979                         PropertyName = PropertyElement.GetNextToken();
5980                         PropertyValue = PropertyElement.GetNextToken();
5981                         SplitData->insert(std::make_pair(PropertyName, PropertyValue));
5982                     
5983                     }
5984                     
5985                     DataStr.clear();
5986                     PropertyName.clear();
5987                     PropertyValue.clear();
5988             
5989                 }
5991         }
5993         if (intSplitsFound == 0){
5995                 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize));
5997                 SplitPoints->insert(std::make_pair(intSplitsFound, (8 + 1)));
5998                 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
6000         } else {
6001                 
6002                 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize - 1));
6004                 SplitPoints->insert(std::make_pair(intSplitsFound, (intSplitSeek + 1)));
6005                 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
6007         }
6009         if (!DataStr.IsEmpty()){
6010                 
6011                 PropertyElement.SetString(DataStr, wxT("="));
6012                 PropertyName = PropertyElement.GetNextToken();
6013                 PropertyValue = PropertyElement.GetNextToken();
6014                 SplitData->insert(std::make_pair(PropertyName, PropertyValue));         
6015                 
6016         }
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy