X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditorPicture.cpp;h=0be593115f491336237c5d711ccebe75096910c4;hb=4f4ef609869729894a13a7e37b6aa5ea0ddaa32b;hp=9a723724ff3a8f426e23aec8ce38efb1e51db09b;hpb=77cdd6167df1f549e03d074166c7544a483bc89e;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditorPicture.cpp b/source/contacteditor/frmContactEditorPicture.cpp index 9a72372..0be5931 100644 --- a/source/contacteditor/frmContactEditorPicture.cpp +++ b/source/contacteditor/frmContactEditorPicture.cpp @@ -33,16 +33,23 @@ frmContactEditorPicture::frmContactEditorPicture( wxWindow* parent ) : frmContactEditorPictureADT( parent ) { + + // Setup the window. + EditorMode = FALSE; sliPriority->Disable(); cmbType->Append(wxT("")); cmbType->Append(_("Home")); cmbType->Append(_("Work")); + } void frmContactEditorPicture::EnablePriority( wxCommandEvent& event ) { + + // Enable/disable the priority. + if (chkUsePref->IsChecked()){ sliPriority->Enable(); } else { @@ -52,6 +59,9 @@ void frmContactEditorPicture::EnablePriority( wxCommandEvent& event ) void frmContactEditorPicture::ProcessData( wxCommandEvent& event ) { + + // Process data. + long ListCtrlIndex; if (EditorMode == FALSE){ @@ -267,8 +277,7 @@ void frmContactEditorPicture::ProcessData( wxCommandEvent& event ) return; } - if (PictureLogo == TRUE){ - + if (PictureLogo == TRUE){ PictureListCtrlPtr->SetItem(longSelected, 0, _("Picture")); } else { @@ -296,11 +305,18 @@ void frmContactEditorPicture::ProcessData( wxCommandEvent& event ) void frmContactEditorPicture::CloseWindow( wxCommandEvent& event ) { + + // Close this window. + this->Close(); + } void frmContactEditorPicture::SetEditorMode(bool EditMode) { + + // Set the editor mode. + // Set if the editor is adding or editing an address. // FALSE = Add // TRUE = Edit @@ -326,7 +342,8 @@ void frmContactEditorPicture::SetEditorMode(bool EditMode) striter = PictureListTypePtr->find(PictureListIndex); - if (striter->first == PictureListIndex){ + if (striter->first == PictureListIndex && + striter != PictureListTypePtr->end()){ strValue = striter->second; @@ -352,7 +369,8 @@ void frmContactEditorPicture::SetEditorMode(bool EditMode) intiter = PictureListPrefPtr->find(PictureListIndex); - if (intiter->first == PictureListIndex && intiter->second > 0){ + if (intiter->first == PictureListIndex && intiter->second > 0 && + intiter != PictureListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable(); @@ -378,6 +396,8 @@ void frmContactEditorPicture::SetupPointers(std::map *PictureL bool PictureLogoIn ) { + // Setup the pointers. + PictureListPtr = PictureList; PictureListAltIDPtr = PictureListAltID; PictureListPIDPtr = PictureListPID;