Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added subroutine to clear data within the object.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Fri, 1 Jan 2016 16:10:38 +0000 (16:10 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Fri, 1 Jan 2016 16:10:38 +0000 (16:10 +0000)
source/contacteditor/cdo/ContactDataObject.cpp
source/contacteditor/cdo/ContactDataObject.h

index 7a19c0e..1a6e6be 100644 (file)
@@ -1,6 +1,6 @@
 // ContactDataObject.cpp - Client Data Object.
 //
-// (c) 2012-2015 Xestia Software Development.
+// (c) 2012-2016 Xestia Software Development.
 //
 // This file is part of Xestia Address Book.
 //
@@ -375,13 +375,6 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){
                        ProcessLogo(PropertySeg1, PropertySeg2, &LogoCount);
                        LogoCount++;
 
-               } else if (Property == wxT("LOGO")) {
-               
-                       // See frmContactEditor-LoadPhoto.cpp
-                       
-                       ProcessLogo(PropertySeg1, PropertySeg2, &LogoCount);
-                       LogoCount++;
-
                } else if (Property == wxT("SOUND")) {
                
                        // See frmContactEditor-LoadSound.cpp
@@ -1167,7 +1160,6 @@ void ContactDataObject::ProcessBirthday(wxString PropertySeg1, wxString Property
        wxString PropertyName;
        wxString PropertyValue;
        wxString PropertyTokens;
-       bool BirthdayText = FALSE;
        int intPrevValue = 6;
 
        SplitValues(&PropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
@@ -1270,7 +1262,6 @@ void ContactDataObject::ProcessAnniversary(wxString PropertySeg1, wxString Prope
        wxString PropertyName;
        wxString PropertyValue;
        wxString PropertyTokens;
-       bool AnniversaryText = FALSE;
        int intPrevValue = 13;
 
        SplitValues(&PropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
@@ -3812,7 +3803,7 @@ void ContactDataObject::ProcessLogo(wxString PropertySeg1, wxString PropertySeg2
        }
        
        // Add the data to the General/Home/Work address variables.
-       
+               
        LogosList.insert(std::make_pair(*LogoCount, base64enc));
        LogosListPictureType.insert(std::make_pair(*LogoCount, wxSPhotoMIME));
        LogosListPicEncType.insert(std::make_pair(*LogoCount, wxSPhotoEncoding));
@@ -4529,6 +4520,510 @@ void ContactDataObject::ProcessVendor(wxString PropertySeg1, wxString PropertySe
 
 }
 
+void ContactDataObject::ClearData(){
+
+    NameTitle.clear();
+    NameForename.clear();
+    NameSurname.clear();
+    NameOtherNames.clear();
+    NameSuffix.clear();
+    NameNickname.clear();
+    NameDisplayAs.clear();
+    NameLanguage.clear();
+    NameAltID.clear();
+    NameTokens.clear();
+    
+    Birthday.clear();
+    BirthdayAltID.clear();
+    BirthdayCalScale.clear();
+    BirthdayTokens.clear();
+    Anniversary.clear();
+    AnniversaryAltID.clear();
+    AnniversaryCalScale.clear();
+    AnniversaryTokens.clear();
+    
+    Gender.clear();
+    GenderDetails.clear();
+    GenderTokens.clear();
+    
+    UIDToken.clear();
+    Revision.clear();
+    RevisionTokens.clear();
+    
+    SourceList.clear();
+    SourceListAltID.clear();
+    SourceListPID.clear();
+    SourceListType.clear();
+    SourceListTokens.clear();
+    SourceListMediatype.clear();
+    SourceListPref.clear();
+    
+    XMLList.clear();
+    XMLListAltID.clear();
+    
+    ClientPIDList.clear();
+    ClientPIDListTokens.clear();
+    
+    FullNamesList.clear();    
+    FullNamesListType.clear();
+    FullNamesListLanguage.clear();
+    FullNamesListAltID.clear();
+    FullNamesListPID.clear();
+    FullNamesListTokens.clear();
+    FullNamesListPref.clear();
+    
+    GeneralNicknamesList.clear();
+    GeneralNicknamesListType.clear();
+    GeneralNicknamesListLanguage.clear();
+    GeneralNicknamesListAltID.clear();
+    GeneralNicknamesListPID.clear();
+    GeneralNicknamesListTokens.clear();        
+    GeneralNicknamesListPref.clear();        
+    
+    GeneralAddressList.clear();
+    GeneralAddressListTown.clear();
+    GeneralAddressListCounty.clear();
+    GeneralAddressListPostCode.clear();
+    GeneralAddressListCountry.clear();
+    GeneralAddressListLabel.clear();
+    GeneralAddressListLang.clear();        
+    GeneralAddressListAltID.clear();
+    GeneralAddressListPID.clear();
+    GeneralAddressListTokens.clear();
+    GeneralAddressListGeo.clear();
+    GeneralAddressListTimezone.clear();        
+    GeneralAddressListType.clear();
+    GeneralAddressListMediatype.clear();
+    GeneralAddressListPref.clear();
+    
+    GeneralEmailList.clear();
+    GeneralEmailListAltID.clear();
+    GeneralEmailListPID.clear();
+    GeneralEmailListType.clear();
+    GeneralEmailListTokens.clear();
+    GeneralEmailListPref.clear();
+    
+    GeneralIMList.clear();
+    GeneralIMListAltID.clear();
+    GeneralIMListPID.clear();
+    GeneralIMListType.clear();
+    GeneralIMListTypeInfo.clear();
+    GeneralIMListTokens.clear();
+    GeneralIMListMediatype.clear();
+    GeneralIMListPref.clear();
+    
+    GeneralTelephoneList.clear();
+    GeneralTelephoneListAltID.clear();
+    GeneralTelephoneListPID.clear();
+    GeneralTelephoneListType.clear();
+    GeneralTelephoneListTokens.clear();
+    GeneralTelephoneListTypeInfo.clear();
+    GeneralTelephoneListPref.clear();
+    
+    GeneralLanguageList.clear();
+    GeneralLanguageListAltID.clear();
+    GeneralLanguageListPID.clear();
+    GeneralLanguageListType.clear();
+    GeneralLanguageListTokens.clear();
+    GeneralLanguageListPref.clear();
+    
+    GeneralTZList.clear();
+    GeneralTZListAltID.clear();
+    GeneralTZListPID.clear();
+    GeneralTZListType.clear();
+    GeneralTZListTokens.clear();
+    GeneralTZListMediatype.clear();
+    GeneralTZListPref.clear();
+    
+    GeneralGeographyList.clear();
+    GeneralGeographyListAltID.clear();
+    GeneralGeographyListPID.clear();
+    GeneralGeographyListType.clear();
+    GeneralGeographyListTokens.clear();
+    GeneralGeographyListMediatype.clear();
+    GeneralGeographyListPref.clear();
+    
+    GeneralRelatedList.clear();
+    GeneralRelatedListRelType.clear();
+    GeneralRelatedListLanguage.clear();
+    GeneralRelatedListAltID.clear();
+    GeneralRelatedListPID.clear();
+    GeneralRelatedListType.clear();
+    GeneralRelatedListTokens.clear();
+    GeneralRelatedListPref.clear();
+    
+    GeneralWebsiteList.clear();
+    GeneralWebsiteListAltID.clear();
+    GeneralWebsiteListPID.clear();
+    GeneralWebsiteListType.clear();
+    GeneralWebsiteListTokens.clear();
+    GeneralWebsiteListMediatype.clear();
+    GeneralWebsiteListPref.clear();
+    
+    GeneralTitleList.clear();
+    GeneralTitleListLanguage.clear();        
+    GeneralTitleListAltID.clear();
+    GeneralTitleListPID.clear();
+    GeneralTitleListType.clear();
+    GeneralTitleListTokens.clear();
+    GeneralTitleListPref.clear();
+    
+    GeneralRoleList.clear();
+    GeneralRoleListLanguage.clear();        
+    GeneralRoleListAltID.clear();
+    GeneralRoleListPID.clear();
+    GeneralRoleListType.clear();
+    GeneralRoleListTokens.clear();
+    GeneralRoleListPref.clear();
+    
+    GeneralOrganisationsList.clear();
+    GeneralOrganisationsListLanguage.clear();        
+    GeneralOrganisationsListAltID.clear();
+    GeneralOrganisationsListPID.clear();
+    GeneralOrganisationsListType.clear();
+    GeneralOrganisationsListTokens.clear();
+    GeneralOrganisationsListSortAs.clear();
+    GeneralOrganisationsListPref.clear();
+    
+    GeneralNoteList.clear();
+    GeneralNoteListLanguage.clear();        
+    GeneralNoteListAltID.clear();
+    GeneralNoteListPID.clear();
+    GeneralNoteListType.clear();
+    GeneralNoteListTokens.clear();
+    GeneralNoteListPref.clear();
+    
+    /* Items on Home Tab */        
+    
+    HomeNicknamesList.clear();
+    HomeNicknamesListType.clear();
+    HomeNicknamesListLanguage.clear();
+    HomeNicknamesListAltID.clear();
+    HomeNicknamesListPID.clear();
+    HomeNicknamesListTokens.clear();        
+    HomeNicknamesListPref.clear();        
+    
+    HomeAddressList.clear();
+    HomeAddressListTown.clear();
+    HomeAddressListCounty.clear();
+    HomeAddressListPostCode.clear();
+    HomeAddressListCountry.clear();
+    HomeAddressListLabel.clear();
+    HomeAddressListLang.clear();        
+    HomeAddressListAltID.clear();
+    HomeAddressListPID.clear();
+    HomeAddressListTokens.clear();
+    HomeAddressListGeo.clear();
+    HomeAddressListTimezone.clear();        
+    HomeAddressListType.clear();
+    HomeAddressListMediatype.clear();
+    HomeAddressListPref.clear();
+    
+    HomeEmailList.clear();
+    HomeEmailListAltID.clear();
+    HomeEmailListPID.clear();
+    HomeEmailListType.clear();
+    HomeEmailListTokens.clear();
+    HomeEmailListPref.clear();
+    
+    HomeIMList.clear();
+    HomeIMListAltID.clear();
+    HomeIMListPID.clear();
+    HomeIMListType.clear();
+    HomeIMListTypeInfo.clear();
+    HomeIMListTokens.clear();
+    HomeIMListMediatype.clear();
+    HomeIMListPref.clear();
+    
+    HomeTelephoneList.clear();
+    HomeTelephoneListAltID.clear();
+    HomeTelephoneListPID.clear();
+    HomeTelephoneListType.clear();
+    HomeTelephoneListTokens.clear();
+    HomeTelephoneListTypeInfo.clear();
+    HomeTelephoneListPref.clear();
+    
+    HomeLanguageList.clear();
+    HomeLanguageListAltID.clear();
+    HomeLanguageListPID.clear();
+    HomeLanguageListType.clear();
+    HomeLanguageListTokens.clear();
+    HomeLanguageListPref.clear();
+    
+    HomeTZList.clear();
+    HomeTZListAltID.clear();
+    HomeTZListPID.clear();
+    HomeTZListType.clear();
+    HomeTZListTokens.clear();
+    HomeTZListMediatype.clear();
+    HomeTZListPref.clear();
+    
+    HomeGeographyList.clear();
+    HomeGeographyListAltID.clear();
+    HomeGeographyListPID.clear();
+    HomeGeographyListType.clear();
+    HomeGeographyListTokens.clear();
+    HomeGeographyListMediatype.clear();
+    HomeGeographyListPref.clear();       
+    
+    HomeWebsiteList.clear();
+    HomeWebsiteListAltID.clear();
+    HomeWebsiteListPID.clear();
+    HomeWebsiteListType.clear();
+    HomeWebsiteListTokens.clear();
+    HomeWebsiteListMediatype.clear();
+    HomeWebsiteListPref.clear();
+    
+    HomeTitleList.clear();
+    HomeTitleListLanguage.clear();
+    HomeTitleListAltID.clear();
+    HomeTitleListPID.clear();
+    HomeTitleListType.clear();
+    HomeTitleListTokens.clear();
+    HomeTitleListPref.clear();
+    
+    HomeRoleList.clear();
+    HomeRoleListLanguage.clear();        
+    HomeRoleListAltID.clear();
+    HomeRoleListPID.clear();
+    HomeRoleListType.clear();
+    HomeRoleListTokens.clear();
+    HomeRoleListPref.clear();
+    
+    HomeOrganisationsList.clear();
+    HomeOrganisationsListLanguage.clear();        
+    HomeOrganisationsListAltID.clear();
+    HomeOrganisationsListPID.clear();
+    HomeOrganisationsListType.clear();
+    HomeOrganisationsListTokens.clear();
+    HomeOrganisationsListSortAs.clear();
+    HomeOrganisationsListPref.clear();
+    
+    HomeNoteList.clear();
+    HomeNoteListLanguage.clear();        
+    HomeNoteListAltID.clear();
+    HomeNoteListPID.clear();
+    HomeNoteListType.clear();
+    HomeNoteListTokens.clear();
+    HomeNoteListPref.clear();        
+    
+    /* Items on the Business tab */
+    
+    BusinessNicknamesList.clear();
+    BusinessNicknamesListType.clear();
+    BusinessNicknamesListLanguage.clear();
+    BusinessNicknamesListAltID.clear();
+    BusinessNicknamesListPID.clear();
+    BusinessNicknamesListTokens.clear();        
+    BusinessNicknamesListPref.clear();        
+    
+    BusinessAddressList.clear();
+    BusinessAddressListTown.clear();
+    BusinessAddressListCounty.clear();
+    BusinessAddressListPostCode.clear();
+    BusinessAddressListCountry.clear();
+    BusinessAddressListLabel.clear();
+    BusinessAddressListLang.clear();        
+    BusinessAddressListAltID.clear();
+    BusinessAddressListPID.clear();
+    BusinessAddressListTokens.clear();
+    BusinessAddressListGeo.clear();
+    BusinessAddressListTimezone.clear();        
+    BusinessAddressListType.clear();
+    BusinessAddressListMediatype.clear();
+    BusinessAddressListPref.clear();
+    
+    BusinessEmailList.clear();
+    BusinessEmailListAltID.clear();
+    BusinessEmailListPID.clear();
+    BusinessEmailListType.clear();
+    BusinessEmailListTokens.clear();
+    BusinessEmailListPref.clear();
+    
+    BusinessIMList.clear();
+    BusinessIMListAltID.clear();
+    BusinessIMListPID.clear();
+    BusinessIMListType.clear();
+    BusinessIMListTokens.clear();
+    BusinessIMListMediatype.clear();
+    BusinessIMListPref.clear();
+    
+    BusinessTelephoneList.clear();
+    BusinessTelephoneListAltID.clear();
+    BusinessTelephoneListPID.clear();
+    BusinessTelephoneListType.clear();
+    BusinessTelephoneListTokens.clear();
+    BusinessTelephoneListPref.clear();
+    
+    BusinessLanguageList.clear();
+    BusinessLanguageListAltID.clear();
+    BusinessLanguageListPID.clear();
+    BusinessLanguageListType.clear();
+    BusinessLanguageListTokens.clear();
+    BusinessLanguageListPref.clear();
+    
+    BusinessTZList.clear();
+    BusinessTZListAltID.clear();
+    BusinessTZListPID.clear();
+    BusinessTZListType.clear();
+    BusinessTZListTokens.clear();
+    BusinessTZListMediatype.clear();
+    BusinessTZListPref.clear();
+    
+    BusinessGeographyList.clear();
+    BusinessGeographyListAltID.clear();
+    BusinessGeographyListPID.clear();
+    BusinessGeographyListType.clear();
+    BusinessGeographyListTokens.clear();
+    BusinessGeographyListMediatype.clear();
+    BusinessGeographyListPref.clear();          
+    
+    BusinessWebsiteList.clear();
+    BusinessWebsiteListAltID.clear();
+    BusinessWebsiteListPID.clear();
+    BusinessWebsiteListType.clear();
+    BusinessWebsiteListTokens.clear();
+    BusinessWebsiteListMediatype.clear();
+    BusinessWebsiteListPref.clear();
+    
+    BusinessTitleList.clear();
+    BusinessTitleListLanguage.clear();        
+    BusinessTitleListAltID.clear();
+    BusinessTitleListPID.clear();
+    BusinessTitleListType.clear();
+    BusinessTitleListTokens.clear();
+    BusinessTitleListPref.clear();
+    
+    BusinessRoleList.clear();
+    BusinessRoleListLanguage.clear();        
+    BusinessRoleListAltID.clear();
+    BusinessRoleListPID.clear();
+    BusinessRoleListType.clear();
+    BusinessRoleListTokens.clear();
+    BusinessRoleListPref.clear();
+    
+    BusinessOrganisationsList.clear();
+    BusinessOrganisationsListLanguage.clear();        
+    BusinessOrganisationsListAltID.clear();
+    BusinessOrganisationsListPID.clear();
+    BusinessOrganisationsListType.clear();
+    BusinessOrganisationsListTokens.clear();
+    BusinessOrganisationsListSortAs.clear();        
+    BusinessOrganisationsListPref.clear();
+    
+    BusinessNoteList.clear();
+    BusinessNoteListLanguage.clear();        
+    BusinessNoteListAltID.clear();
+    BusinessNoteListPID.clear();
+    BusinessNoteListType.clear();
+    BusinessNoteListTokens.clear();
+    BusinessNoteListPref.clear();        
+    
+    /* Items on the Categories tab */
+    
+    CategoriesList.clear();
+    CategoriesListAltID.clear();
+    CategoriesListPID.clear();
+    CategoriesListType.clear();
+    CategoriesListTokens.clear();
+    CategoriesListLanguage.clear();
+    CategoriesListPref.clear();    
+    
+    /* Items on the Groups tab */
+    
+    GroupsList.clear();
+    GroupsListAltID.clear();
+    GroupsListPID.clear();
+    GroupsListType.clear();
+    GroupsListMediaType.clear();
+    GroupsListTokens.clear();
+    GroupsListPref.clear();
+    
+    /* Items on the Pictures tab */
+    
+    PicturesList.clear();
+    PicturesListAltID.clear();
+    PicturesListPID.clear();
+    PicturesListType.clear();
+    PicturesListPicEncType.clear();
+    PicturesListPictureType.clear();
+    PicturesListTokens.clear();
+    PicturesListMediatype.clear();        
+    PicturesListPref.clear();
+    
+    /* Items on the Logos tab */
+    
+    LogosList.clear();
+    LogosListAltID.clear();
+    LogosListPID.clear();
+    LogosListType.clear();
+    LogosListPicEncType.clear();        
+    LogosListPictureType.clear();
+    LogosListTokens.clear();
+    LogosListMediatype.clear();        
+    LogosListPref.clear();
+    
+    /* Items on the Sounds tab */
+    
+    SoundsList.clear();
+    SoundsListAltID.clear();
+    SoundsListPID.clear();
+    SoundsListType.clear();
+    SoundsListAudioEncType.clear();        
+    SoundsListAudioType.clear();        
+    SoundsListTokens.clear();
+    SoundsListMediatype.clear();        
+    SoundsListPref.clear();    
+    
+    /* Items on the Calendaring tab */
+    
+    CalendarList.clear();
+    CalendarListAltID.clear();
+    CalendarListPID.clear();
+    CalendarListType.clear();
+    CalendarListTokens.clear();
+    CalendarListMediatype.clear();        
+    CalendarListPref.clear();
+    
+    CalendarRequestList.clear();
+    CalendarRequestListAltID.clear();
+    CalendarRequestListPID.clear();
+    CalendarRequestListType.clear();
+    CalendarRequestListTokens.clear();
+    CalendarRequestListMediatype.clear();        
+    CalendarRequestListPref.clear();        
+    
+    FreeBusyList.clear();
+    FreeBusyListAltID.clear();
+    FreeBusyListPID.clear();
+    FreeBusyListType.clear();
+    FreeBusyListTokens.clear();
+    FreeBusyListMediatype.clear();        
+    FreeBusyListPref.clear();
+    
+    /* Items on the Security tab */
+    
+    KeyList.clear();
+    KeyListAltID.clear();
+    KeyListPID.clear();
+    KeyListKeyType.clear();        
+    KeyListDataType.clear();        
+    KeyListDataEncType.clear();
+    KeyListType.clear();
+    KeyListTokens.clear();
+    KeyListPref.clear();
+    
+    /* Items on the Other tab */
+    
+    VendorList.clear();
+    VendorListPEN.clear();
+    VendorListElement.clear();
+    
+    XTokenList.clear();
+    XTokenListTokens.clear();
+
+}
+
 void ProcessNameValue(wxString *PropertyData, 
        wxString *PropertyName, 
        wxString *PropertyValue){
index 4ff7478..46edb7e 100644 (file)
@@ -1,6 +1,6 @@
 // ContactDataObject.h - Client Data Object header.
 //
-// (c) 2012-2015 Xestia Software Development.
+// (c) 2012-2016 Xestia Software Development.
 //
 // This file is part of Xestia Address Book.
 //
@@ -110,10 +110,13 @@ class ContactDataObject{
        wxString BirthdayAltID;
        wxString BirthdayCalScale;
        wxString BirthdayTokens;
+       bool BirthdayText = FALSE;
+       
        wxString Anniversary;
        wxString AnniversaryAltID;
        wxString AnniversaryCalScale;
        wxString AnniversaryTokens;
+       bool AnniversaryText = FALSE;
        
        wxString Gender;
        wxString GenderDetails;
@@ -137,12 +140,6 @@ class ContactDataObject{
        std::map<int, wxString> ClientPIDList;
        std::map<int, wxString> ClientPIDListTokens;
 
-       /* We don't use these at the moment but we want to keep
-         them for compatability reasons */
-
-       /*std::map<int, wxString> ExtraFullNames;*/
-       /*std::map<int, wxString> ExtraNicknames;*/
-
        std::map<int, wxString> FullNamesList;  
        std::map<int, wxString> FullNamesListType;
        std::map<int, wxString> FullNamesListLanguage;
@@ -186,6 +183,7 @@ class ContactDataObject{
        std::map<int, wxString> GeneralIMListAltID;
        std::map<int, wxString> GeneralIMListPID;
        std::map<int, wxString> GeneralIMListType;
+       std::map<int, wxString> GeneralIMListTypeInfo;
        std::map<int, wxString> GeneralIMListTokens;
        std::map<int, wxString> GeneralIMListMediatype;
        std::map<int, int> GeneralIMListPref;
@@ -308,6 +306,7 @@ class ContactDataObject{
        std::map<int, wxString> HomeIMListAltID;
        std::map<int, wxString> HomeIMListPID;
        std::map<int, wxString> HomeIMListType;
+       std::map<int, wxString> HomeIMListTypeInfo;
        std::map<int, wxString> HomeIMListTokens;
        std::map<int, wxString> HomeIMListMediatype;
        std::map<int, int> HomeIMListPref;
@@ -421,6 +420,7 @@ class ContactDataObject{
        std::map<int, wxString> BusinessIMListAltID;
        std::map<int, wxString> BusinessIMListPID;
        std::map<int, wxString> BusinessIMListType;
+       std::map<int, wxString> BusinessIMListTypeInfo;
        std::map<int, wxString> BusinessIMListTokens;
        std::map<int, wxString> BusinessIMListMediatype;
        std::map<int, int> BusinessIMListPref;
@@ -604,6 +604,7 @@ class ContactDataObject{
        // Subroutines.
        
        ContactLoadStatus LoadFile(wxString Filename);
+       void ClearData();
 
 };
 
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