From d41264070f6e7fc2314c76f701e667f4a794875c Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 13 Mar 2016 12:24:12 +0000 Subject: [PATCH] Indented code properly contacteditor/frmContactEditor-Load.cpp --- .../contacteditor/frmContactEditor-Load.cpp | 156 +++++++++--------- 1 file changed, 82 insertions(+), 74 deletions(-) diff --git a/source/contacteditor/frmContactEditor-Load.cpp b/source/contacteditor/frmContactEditor-Load.cpp index 5f10c46..296427f 100644 --- a/source/contacteditor/frmContactEditor-Load.cpp +++ b/source/contacteditor/frmContactEditor-Load.cpp @@ -1748,102 +1748,106 @@ void frmContactEditor::LoadMember(std::map *GroupList){ vCardFilename.Right(5) == wxT(".vcard") || vCardFilename.Right(5) == wxT(".VCARD")){ - vCard Person; + vCard Person; - vCardFilenameFull.Append(AccountDirFinal); - vCardFilenameFull.Append(wxT("/")); - vCardFilenameFull.Append(vCardFilename); + vCardFilenameFull.Append(AccountDirFinal); + vCardFilenameFull.Append(wxT("/")); + vCardFilenameFull.Append(vCardFilename); - Person.LoadFile(vCardFilenameFull); + Person.LoadFile(vCardFilenameFull); - if (MemberData.Left(9) == wxT("urn:uuid:")){ + if (MemberData.Left(9) == wxT("urn:uuid:")){ - wxString NewPropValue; - NewPropValue = MemberData.Mid(9, wxString::npos); - MemberData = NewPropValue; + wxString NewPropValue; + NewPropValue = MemberData.Mid(9, wxString::npos); + MemberData = NewPropValue; - } + } - if (Person.MeetBaseSpecification()){ + if (Person.MeetBaseSpecification()){ - wxString KindStatus = Person.Get(wxT("KIND")); + wxString KindStatus = Person.Get(wxT("KIND")); - if (KindStatus == wxT("group")){ + if (KindStatus == wxT("group")){ - vCardFilename.Clear(); - vCardFilenameFull.Clear(); - vCardDataString.Clear(); - ProcFiles = vcardaccdir.GetNext(&vCardFilename); - continue; + vCardFilename.Clear(); + vCardFilenameFull.Clear(); + vCardDataString.Clear(); + ProcFiles = vcardaccdir.GetNext(&vCardFilename); + continue; - } + } - wxString PersonName = Person.Get(wxT("N")); - wxString PersonUID = Person.Get(wxT("UID")); - wxString PersonFilename = vCardFilenameFull; - - if (PersonUID != MemberData){ + wxString PersonName = Person.Get(wxT("N")); + wxString PersonUID = Person.Get(wxT("UID")); + wxString PersonFilename = vCardFilenameFull; + + if (PersonUID != MemberData){ - vCardFilename.Clear(); - vCardFilenameFull.Clear(); - vCardDataString.Clear(); - ProcFiles = vcardaccdir.GetNext(&vCardFilename); - continue; + vCardFilename.Clear(); + vCardFilenameFull.Clear(); + vCardDataString.Clear(); + ProcFiles = vcardaccdir.GetNext(&vCardFilename); + continue; - } else { - FoundContact = TRUE; - } + } else { + + FoundContact = TRUE; + + } - //ContactsNames.insert(std::make_pair(PersonName, ContactIndex)); - //ContactsUIDs.insert(std::make_pair(ContactIndex, PersonUID)); + //ContactsNames.insert(std::make_pair(PersonName, ContactIndex)); + //ContactsUIDs.insert(std::make_pair(ContactIndex, PersonUID)); - if (XVMData.SortMode == 1){ + if (XVMData.SortMode == 1){ - // Split the name into sections. + // Split the name into sections. - vCardDataString = Person.Get(wxT("N")); + vCardDataString = Person.Get(wxT("N")); - vCardName NameData = Person.GetName(); + vCardName NameData = Person.GetName(); - vCardDataString = NameData.Forename + wxT(" ") + NameData.Surname; + vCardDataString = NameData.Forename + wxT(" ") + NameData.Surname; - } else if (XVMData.SortMode == 2){ + } else if (XVMData.SortMode == 2){ - // Split the name into sections. + // Split the name into sections. - vCardName NameData = Person.GetName(); + vCardName NameData = Person.GetName(); - vCardDataString = NameData.Surname + wxT(", ") + NameData.Forename; + vCardDataString = NameData.Surname + wxT(", ") + NameData.Forename; - } else if (XVMData.SortMode == 3){ + } else if (XVMData.SortMode == 3){ - // Check and make sure that the top most nickname is used. + // Check and make sure that the top most nickname is used. - vCardDataString = Person.Get(wxT("NICKNAME")); + vCardDataString = Person.Get(wxT("NICKNAME")); - if (vCardDataString.IsEmpty()){ + if (vCardDataString.IsEmpty()){ - vCardDataString = wxT("(no nickname)"); + vCardDataString = wxT("(no nickname)"); - } + } - } else if (XVMData.SortMode == 4){ + } else if (XVMData.SortMode == 4){ - vCardDataString = Person.Get(wxT("FN")); + vCardDataString = Person.Get(wxT("FN")); - } + } + + if (XVMData.AscendingMode == TRUE){ + + vCardNamesAsc.insert(std::make_pair(vCardDataString, PersonUID)); + + } else { + + vCardNamesDsc.insert(std::make_pair(vCardDataString, PersonUID)); + + } - if (XVMData.AscendingMode == TRUE){ - vCardNamesAsc.insert(std::make_pair(vCardDataString, PersonUID)); } else { - vCardNamesDsc.insert(std::make_pair(vCardDataString, PersonUID)); - } - - } else { - - } - + } } @@ -1852,44 +1856,48 @@ void frmContactEditor::LoadMember(std::map *GroupList){ vCardDataString.Clear(); ProcFiles = vcardaccdir.GetNext(&vCardFilename); - } + } - if (FoundContact == FALSE){ + if (FoundContact == FALSE){ + if (XVMData.AscendingMode == TRUE){ - vCardNamesAsc.insert(std::make_pair(MemberIter->second, MemberIter->second)); + + vCardNamesAsc.insert(std::make_pair(MemberIter->second, MemberIter->second)); + } else { - vCardNamesDsc.insert(std::make_pair(MemberIter->second, MemberIter->second)); + + vCardNamesDsc.insert(std::make_pair(MemberIter->second, MemberIter->second)); + } - } - if (XVMData.AscendingMode == TRUE){ + } + + if (XVMData.AscendingMode == TRUE){ for (std::map::iterator iter = vCardNamesAsc.begin(); - iter != vCardNamesAsc.end(); ++iter){ + iter != vCardNamesAsc.end(); ++iter){ wxListItem ItemData; ItemData.SetId(0); ItemData.SetText(iter->first); - lboGroups->InsertItem(ItemData); } - - } else { + } else { for (std::map::iterator iter = vCardNamesDsc.begin(); - iter != vCardNamesDsc.end(); ++iter){ + iter != vCardNamesDsc.end(); ++iter){ wxListItem ItemData; ItemData.SetId(0); ItemData.SetText(iter->first); - + lboGroups->InsertItem(ItemData); - } + } } -- 2.39.5