1 // frmContactEditor-LoadAddress.cpp - frmContactEditor load address subroutines.
3 // (c) 2012-2015 Xestia Software Development.
5 // This file is part of Xestia Address Book.
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.
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.
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 "frmContactEditor.h"
21 void frmContactEditor::LoadAddress(std::map<int, wxString> *GeneralAddressList,
22 std::map<int, wxString> *GeneralAddressListTown,
23 std::map<int, wxString> *GeneralAddressListCounty,
24 std::map<int, wxString> *GeneralAddressListPostCode,
25 std::map<int, int> *GeneralAddressListPref,
26 std::map<int, wxString> *HomeAddressList,
27 std::map<int, wxString> *HomeAddressListTown,
28 std::map<int, wxString> *HomeAddressListCounty,
29 std::map<int, wxString> *HomeAddressListPostCode,
30 std::map<int, int> *HomeAddressListPref,
31 std::map<int, wxString> *BusinessAddressList,
32 std::map<int, wxString> *BusinessAddressListTown,
33 std::map<int, wxString> *BusinessAddressListCounty,
34 std::map<int, wxString> *BusinessAddressListPostCode,
35 std::map<int, int> *BusinessAddressListPref,
38 long ListCtrlIndex = -1;
40 // Deal with the general addresses.
42 for (std::map<int,wxString>::iterator GenAdrListIter = GeneralAddressList->begin();
43 GenAdrListIter != GeneralAddressList->end();
48 coldata.SetId(*AddressCount);
49 coldata.SetData(*AddressCount);
50 coldata.SetText(GenAdrListIter->second);
52 ListCtrlIndex = lboAddresses->InsertItem(coldata);
54 if (MapDataExists(AddressCount, GeneralAddressListTown)){
56 lboAddresses->SetItem(ListCtrlIndex, 1, GeneralAddressListTown->find(*AddressCount)->second);
60 if (MapDataExists(AddressCount, GeneralAddressListCounty)){
62 lboAddresses->SetItem(ListCtrlIndex, 2, GeneralAddressListCounty->find(*AddressCount)->second);
66 if (MapDataExists(AddressCount, GeneralAddressListPostCode)){
68 lboAddresses->SetItem(ListCtrlIndex, 3, GeneralAddressListPostCode->find(*AddressCount)->second);
72 if (MapDataExists(AddressCount, GeneralAddressListPref)){
74 lboAddresses->SetItem(ListCtrlIndex, 4, wxString::Format("%i", GeneralAddressListPref->find(*AddressCount)->second));
82 // Deal with the home addresses.
84 for (std::map<int,wxString>::iterator GenAdrListIter = HomeAddressList->begin();
85 GenAdrListIter != HomeAddressList->end();
90 coldata.SetId(*AddressCount);
91 coldata.SetData(*AddressCount);
92 coldata.SetText(GenAdrListIter->second);
94 ListCtrlIndex = lboHomeAddresses->InsertItem(coldata);
96 if (MapDataExists(AddressCount, HomeAddressListTown)){
98 lboHomeAddresses->SetItem(ListCtrlIndex, 1, HomeAddressListTown->find(*AddressCount)->second);
102 if (MapDataExists(AddressCount, HomeAddressListCounty)){
104 lboHomeAddresses->SetItem(ListCtrlIndex, 2, HomeAddressListCounty->find(*AddressCount)->second);
108 if (MapDataExists(AddressCount, HomeAddressListPostCode)){
110 lboHomeAddresses->SetItem(ListCtrlIndex, 3, HomeAddressListPostCode->find(*AddressCount)->second);
114 if (MapDataExists(AddressCount, HomeAddressListPref)){
116 lboHomeAddresses->SetItem(ListCtrlIndex, 4, wxString::Format("%i", HomeAddressListPref->find(*AddressCount)->second));
124 // Deal with the work addresses.
126 for (std::map<int,wxString>::iterator GenAdrListIter = BusinessAddressList->begin();
127 GenAdrListIter != BusinessAddressList->end();
132 coldata.SetId(*AddressCount);
133 coldata.SetData(*AddressCount);
134 coldata.SetText(GenAdrListIter->second);
136 ListCtrlIndex = lboBusinessAddresses->InsertItem(coldata);
138 if (MapDataExists(AddressCount, BusinessAddressListTown)){
140 lboBusinessAddresses->SetItem(ListCtrlIndex, 1, BusinessAddressListTown->find(*AddressCount)->second);
144 if (MapDataExists(AddressCount, BusinessAddressListCounty)){
146 lboBusinessAddresses->SetItem(ListCtrlIndex, 2, BusinessAddressListCounty->find(*AddressCount)->second);
150 if (MapDataExists(AddressCount, BusinessAddressListPostCode)){
152 lboBusinessAddresses->SetItem(ListCtrlIndex, 3, BusinessAddressListPostCode->find(*AddressCount)->second);
156 if (MapDataExists(AddressCount, BusinessAddressListPref)){
158 lboBusinessAddresses->SetItem(ListCtrlIndex, 4, wxString::Format("%i", BusinessAddressListPref->find(*AddressCount)->second));
168 void frmContactEditor::LoadADR(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *ADRCount){
170 size_t intPropertyLen = wxSPropertySeg1.Len();
171 std::map<int, int> SplitPoints;
172 std::map<int, int> SplitLength;
173 std::map<int, int>::iterator SLiter;
174 wxString PropertyData;
175 wxString PropertyName;
176 wxString PropertyValue;
177 wxString PropertyTokens;
178 wxString AddressLabel;
179 wxString AddressLang;
180 wxString AddressAltID;
182 wxString AddressTokens;
184 wxString AddressTimezone;
185 wxString AddressType;
186 wxString AddressMediatype;
187 wxString AddressPOBox;
188 wxString AddressExtended;
189 wxString AddressStreet;
190 wxString AddressLocality;
191 wxString AddressCity;
192 wxString AddressRegion;
193 wxString AddressPostalCode;
194 wxString AddressCountry;
195 bool FirstToken = TRUE;
196 int intSplitsFound = 0;
197 int intSplitSize = 0;
198 int intPrevValue = 5;
203 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
207 // Look for type before continuing.
209 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
210 intiter != SplitPoints.end(); ++intiter){
212 SLiter = SplitLength.find(intiter->first);
214 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
216 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
217 PropertyName = PropertyElement.GetNextToken();
218 PropertyValue = PropertyElement.GetNextToken();
220 intPrevValue = intiter->second;
222 if (PropertyName == wxT("TYPE")){
224 if (PropertyValue == wxT("work")){
228 } else if (PropertyValue == wxT("home")){
242 // Setup blank lines for later on.
246 GeneralAddressList.insert(std::make_pair(intValueSeek, wxT("")));
247 GeneralAddressListTown.insert(std::make_pair(intValueSeek, wxT("")));
248 GeneralAddressListCounty.insert(std::make_pair(intValueSeek, wxT("")));
249 GeneralAddressListPostCode.insert(std::make_pair(intValueSeek, wxT("")));
250 GeneralAddressListCountry.insert(std::make_pair(intValueSeek, wxT("")));
251 GeneralAddressListLabel.insert(std::make_pair(intValueSeek, wxT("")));
252 GeneralAddressListLang.insert(std::make_pair(intValueSeek, wxT("")));
253 GeneralAddressListAltID.insert(std::make_pair(intValueSeek, wxT("")));
254 GeneralAddressListPID.insert(std::make_pair(intValueSeek, wxT("")));
255 GeneralAddressListGeo.insert(std::make_pair(intValueSeek, wxT("")));
256 GeneralAddressListTimezone.insert(std::make_pair(intValueSeek, wxT("")));
257 GeneralAddressListMediatype.insert(std::make_pair(intValueSeek, wxT("")));
258 GeneralAddressListPref.insert(std::make_pair(intValueSeek, 0));
259 GeneralAddressListTokens.insert(std::make_pair(intValueSeek, wxT("")));
261 } else if (intType == 1){
263 HomeAddressList.insert(std::make_pair(intValueSeek, wxT("")));
264 HomeAddressListTown.insert(std::make_pair(intValueSeek, wxT("")));
265 HomeAddressListCounty.insert(std::make_pair(intValueSeek, wxT("")));
266 HomeAddressListPostCode.insert(std::make_pair(intValueSeek, wxT("")));
267 HomeAddressListCountry.insert(std::make_pair(intValueSeek, wxT("")));
268 HomeAddressListLabel.insert(std::make_pair(intValueSeek, wxT("")));
269 HomeAddressListLang.insert(std::make_pair(intValueSeek, wxT("")));
270 HomeAddressListAltID.insert(std::make_pair(intValueSeek, wxT("")));
271 HomeAddressListPID.insert(std::make_pair(intValueSeek, wxT("")));
272 HomeAddressListGeo.insert(std::make_pair(intValueSeek, wxT("")));
273 HomeAddressListTimezone.insert(std::make_pair(intValueSeek, wxT("")));
274 HomeAddressListMediatype.insert(std::make_pair(intValueSeek, wxT("")));
275 HomeAddressListPref.insert(std::make_pair(intValueSeek, 0));
276 HomeAddressListTokens.insert(std::make_pair(intValueSeek, wxT("")));
278 } else if (intType == 2){
280 BusinessAddressList.insert(std::make_pair(intValueSeek, wxT("")));
281 BusinessAddressListTown.insert(std::make_pair(intValueSeek, wxT("")));
282 BusinessAddressListCounty.insert(std::make_pair(intValueSeek, wxT("")));
283 BusinessAddressListPostCode.insert(std::make_pair(intValueSeek, wxT("")));
284 BusinessAddressListCountry.insert(std::make_pair(intValueSeek, wxT("")));
285 BusinessAddressListLabel.insert(std::make_pair(intValueSeek, wxT("")));
286 BusinessAddressListLang.insert(std::make_pair(intValueSeek, wxT("")));
287 BusinessAddressListAltID.insert(std::make_pair(intValueSeek, wxT("")));
288 BusinessAddressListPID.insert(std::make_pair(intValueSeek, wxT("")));
289 BusinessAddressListGeo.insert(std::make_pair(intValueSeek, wxT("")));
290 BusinessAddressListTimezone.insert(std::make_pair(intValueSeek, wxT("")));
291 BusinessAddressListMediatype.insert(std::make_pair(intValueSeek, wxT("")));
292 BusinessAddressListPref.insert(std::make_pair(intValueSeek, 0));
293 BusinessAddressListTokens.insert(std::make_pair(intValueSeek, wxT("")));
299 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
300 intiter != SplitPoints.end(); ++intiter){
302 SLiter = SplitLength.find(intiter->first);
304 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
306 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
307 PropertyName = PropertyElement.GetNextToken();
308 PropertyValue = PropertyElement.GetNextToken();
310 intPrevValue = intiter->second;
312 ProcessCaptureStrings(&PropertyValue);
314 // Process properties.
316 if (PropertyName == wxT("LABEL")){
318 if (intType == 0){ GeneralAddressListLabel.erase(intValueSeek); GeneralAddressListLabel.insert(std::make_pair(intValueSeek, PropertyValue)); }
319 else if (intType == 1){ HomeAddressListLabel.erase(intValueSeek); HomeAddressListLabel.insert(std::make_pair(intValueSeek, PropertyValue)); }
320 else if (intType == 2){ BusinessAddressListLabel.erase(intValueSeek); BusinessAddressListLabel.insert(std::make_pair(intValueSeek, PropertyValue));}
322 } else if (PropertyName == wxT("LANGUAGE")){
324 if (intType == 0){ GeneralAddressListLang.erase(intValueSeek); GeneralAddressListLang.insert(std::make_pair(intValueSeek, PropertyValue)); }
325 else if (intType == 1){ HomeAddressListLang.erase(intValueSeek); HomeAddressListLang.insert(std::make_pair(intValueSeek, PropertyValue)); }
326 else if (intType == 2){ BusinessAddressListLang.erase(intValueSeek); BusinessAddressListLang.insert(std::make_pair(intValueSeek, PropertyValue)); }
328 } else if (PropertyName == wxT("ALTID")){
330 if (intType == 0){ GeneralAddressListAltID.erase(intValueSeek); GeneralAddressListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
331 else if (intType == 1){ HomeAddressListAltID.erase(intValueSeek); HomeAddressListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
332 else if (intType == 2){ BusinessAddressListAltID.erase(intValueSeek); BusinessAddressListAltID.insert(std::make_pair(intValueSeek, PropertyValue)); }
334 } else if (PropertyName == wxT("PID")){
336 if (intType == 0){ GeneralAddressListPID.erase(intValueSeek); GeneralAddressListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
337 else if (intType == 1){ HomeAddressListPID.erase(intValueSeek); HomeAddressListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
338 else if (intType == 2){ BusinessAddressListPID.erase(intValueSeek); BusinessAddressListPID.insert(std::make_pair(intValueSeek, PropertyValue)); }
340 } else if (PropertyName == wxT("GEO")){
342 if (intType == 0){ GeneralAddressListGeo.erase(intValueSeek); GeneralAddressListGeo.insert(std::make_pair(intValueSeek, PropertyValue)); }
343 else if (intType == 1){ HomeAddressListGeo.erase(intValueSeek); HomeAddressListGeo.insert(std::make_pair(intValueSeek, PropertyValue)); }
344 else if (intType == 2){ BusinessAddressListGeo.erase(intValueSeek); BusinessAddressListGeo.insert(std::make_pair(intValueSeek, PropertyValue)); }
346 } else if (PropertyName == wxT("TZ")){
348 if (intType == 0){ GeneralAddressListTimezone.erase(intValueSeek); GeneralAddressListTimezone.insert(std::make_pair(intValueSeek, PropertyValue)); }
349 else if (intType == 1){ HomeAddressListTimezone.erase(intValueSeek); HomeAddressListTimezone.insert(std::make_pair(intValueSeek, PropertyValue)); }
350 else if (intType == 2){ BusinessAddressListTimezone.erase(intValueSeek); BusinessAddressListTimezone.insert(std::make_pair(intValueSeek, PropertyValue)); }
352 } else if (PropertyName == wxT("MEDIATYPE")){
354 if (intType == 0){ GeneralAddressListMediatype.erase(intValueSeek); GeneralAddressListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
355 else if (intType == 1){ HomeAddressListMediatype.erase(intValueSeek); HomeAddressListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
356 else if (intType == 2){ BusinessAddressListMediatype.erase(intValueSeek); BusinessAddressListMediatype.insert(std::make_pair(intValueSeek, PropertyValue)); }
358 } else if (PropertyName == wxT("PREF")){
360 intPref = wxAtoi(PropertyValue);
362 if (intPref > 0 && intPref < 101){
364 if (intType == 0){ GeneralAddressListPref.erase(intValueSeek); GeneralAddressListPref.insert(std::make_pair(intValueSeek, intPref)); }
365 else if (intType == 1){ HomeAddressListPref.erase(intValueSeek); HomeAddressListPref.insert(std::make_pair(intValueSeek, intPref)); }
366 else if (intType == 2){ BusinessAddressListPref.erase(intValueSeek); BusinessAddressListPref.insert(std::make_pair(intValueSeek, intPref)); }
372 if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
374 if (FirstToken == TRUE){
376 PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
381 PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
391 // Split the address.
393 //std::map<int, int>::iterator SLiter;
394 intPropertyLen = wxSPropertySeg2.Len();
401 for (int i = 0; i <= intPropertyLen; i++){
405 if (wxSPropertySeg2.Mid(i, 1) == wxT(";") && wxSPropertySeg2.Mid((i - 1), 1) != wxT("\\")){
408 SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
410 if (intSplitsFound == 6){
412 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
417 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
427 // Split the data into several parts.
429 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
430 intiter != SplitPoints.end(); ++intiter){
432 if (intiter->first == 1){
436 SLiter = SplitLength.find(1);
438 //txtSurname->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(0, SLiter->second), TRUE));
439 AddressPOBox = wxSPropertySeg2.Mid(0, SLiter->second);
440 intPrevValue = intiter->second;
442 } else if (intiter->first == 2){
444 // Deal with extended address.
446 SLiter = SplitLength.find(2);
448 AddressExtended = wxSPropertySeg2.Mid(intPrevValue, SLiter->second);
449 //txtForename->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue, SLiter->second), TRUE));
450 intPrevValue = intiter->second;
452 } else if (intiter->first == 3){
454 // Deal with street address.
456 SLiter = SplitLength.find(3);
458 AddressStreet = wxSPropertySeg2.Mid(intPrevValue, SLiter->second);
459 //txtOtherNames->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue, SLiter->second), TRUE));
460 intPrevValue = intiter->second;
462 } else if (intiter->first == 4){
464 // Deal with locality
466 SLiter = SplitLength.find(4);
468 AddressLocality = wxSPropertySeg2.Mid(intPrevValue, SLiter->second);
469 //txtTitle->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue, SLiter->second), TRUE));
470 intPrevValue = intiter->second;
472 //txtSuffix->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue), TRUE));
474 } else if (intiter->first == 5){
478 SLiter = SplitLength.find(5);
480 AddressRegion = wxSPropertySeg2.Mid(intPrevValue, SLiter->second);
481 //txtTitle->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue, SLiter->second), TRUE));
482 intPrevValue = intiter->second;
484 //txtSuffix->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue), TRUE));
486 } else if (intiter->first == 6){
488 // Deal with post code.
490 SLiter = SplitLength.find(6);
492 AddressPostalCode = wxSPropertySeg2.Mid(intPrevValue, SLiter->second);
493 //txtTitle->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue, SLiter->second), TRUE));
494 intPrevValue = intiter->second;
496 // Deal with country.
498 AddressCountry = wxSPropertySeg2.Mid(intPrevValue);
499 //txtSuffix->SetValue(ContactData.Convert(wxSPropertySeg2.Mid(intPrevValue), TRUE));
505 // Add the data to the General/Home/Work address variables.
507 ProcessCaptureStrings(&AddressStreet, &AddressLocality, &AddressRegion, &AddressPostalCode, &AddressCountry);
511 coldata.SetId(intValueSeek);
512 coldata.SetData(intValueSeek);
513 coldata.SetText(AddressStreet);
517 ListCtrlIndex = lboAddresses->InsertItem(coldata);
518 lboAddresses->SetItem(ListCtrlIndex, 1, AddressLocality);
519 lboAddresses->SetItem(ListCtrlIndex, 2, AddressRegion);
520 lboAddresses->SetItem(ListCtrlIndex, 3, AddressPostalCode);
522 if (intPref > 0 && intPref < 101){
524 lboAddresses->SetItem(ListCtrlIndex, 4, wxString::Format(wxT("%i"), intPref));
528 GeneralAddressList.erase(intValueSeek);
529 GeneralAddressListTown.erase(intValueSeek);
530 GeneralAddressListCounty.erase(intValueSeek);
531 GeneralAddressListPostCode.erase(intValueSeek);
532 GeneralAddressListCountry.erase(intValueSeek);
533 GeneralAddressListType.erase(intValueSeek);
534 GeneralAddressListTokens.erase(intValueSeek);
535 GeneralAddressList.insert(std::make_pair(intValueSeek, AddressStreet));
536 GeneralAddressListTown.insert(std::make_pair(intValueSeek, AddressLocality));
537 GeneralAddressListCounty.insert(std::make_pair(intValueSeek, AddressRegion));
538 GeneralAddressListPostCode.insert(std::make_pair(intValueSeek, AddressPostalCode));
539 GeneralAddressListCountry.insert(std::make_pair(intValueSeek, AddressCountry));
540 GeneralAddressListType.insert(std::make_pair(intValueSeek, wxT("")));
541 GeneralAddressListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
543 } else if (intType == 1){
545 ListCtrlIndex = lboHomeAddresses->InsertItem(coldata);
546 lboHomeAddresses->SetItem(ListCtrlIndex, 1, AddressLocality);
547 lboHomeAddresses->SetItem(ListCtrlIndex, 2, AddressRegion);
548 lboHomeAddresses->SetItem(ListCtrlIndex, 3, AddressPostalCode);
550 if (intPref > 0 && intPref < 101){
552 lboHomeAddresses->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
556 HomeAddressList.erase(intValueSeek);
557 HomeAddressListTown.erase(intValueSeek);
558 HomeAddressListCounty.erase(intValueSeek);
559 HomeAddressListPostCode.erase(intValueSeek);
560 HomeAddressListCountry.erase(intValueSeek);
561 HomeAddressListType.erase(intValueSeek);
562 HomeAddressListTokens.erase(intValueSeek);
563 HomeAddressList.insert(std::make_pair(intValueSeek, AddressStreet));
564 HomeAddressListTown.insert(std::make_pair(intValueSeek, AddressLocality));
565 HomeAddressListCounty.insert(std::make_pair(intValueSeek, AddressRegion));
566 HomeAddressListPostCode.insert(std::make_pair(intValueSeek, AddressPostalCode));
567 HomeAddressListCountry.insert(std::make_pair(intValueSeek, AddressCountry));
568 HomeAddressListType.insert(std::make_pair(intValueSeek, wxT("home")));
569 HomeAddressListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));
571 } else if (intType == 2){
573 ListCtrlIndex = lboBusinessAddresses->InsertItem(coldata);
574 lboBusinessAddresses->SetItem(ListCtrlIndex, 1, AddressLocality);
575 lboBusinessAddresses->SetItem(ListCtrlIndex, 2, AddressRegion);
576 lboBusinessAddresses->SetItem(ListCtrlIndex, 3, AddressPostalCode);
578 if (intPref > 0 && intPref < 101){
580 lboBusinessAddresses->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), intPref));
584 BusinessAddressList.erase(intValueSeek);
585 BusinessAddressListTown.erase(intValueSeek);
586 BusinessAddressListCounty.erase(intValueSeek);
587 BusinessAddressListPostCode.erase(intValueSeek);
588 BusinessAddressListCountry.erase(intValueSeek);
589 BusinessAddressListType.erase(intValueSeek);
590 BusinessAddressListTokens.erase(intValueSeek);
591 BusinessAddressList.insert(std::make_pair(intValueSeek, AddressStreet));
592 BusinessAddressListTown.insert(std::make_pair(intValueSeek, AddressLocality));
593 BusinessAddressListCounty.insert(std::make_pair(intValueSeek, AddressRegion));
594 BusinessAddressListPostCode.insert(std::make_pair(intValueSeek, AddressPostalCode));
595 BusinessAddressListCountry.insert(std::make_pair(intValueSeek, AddressCountry));
596 BusinessAddressListType.insert(std::make_pair(intValueSeek, wxT("work")));
597 BusinessAddressListTokens.insert(std::make_pair(intValueSeek, PropertyTokens));