X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditorVendor.cpp;h=2ca399b11e5d7a7780ca568216079313670e1828;hb=f69e09d827e06435ea94bb73aa71ab5f9d5c035b;hp=4696a9ddf15af017aec890313f1168170de83c76;hpb=da64d37d0a13895554e4ad945c46dd0af6d1c0e6;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditorVendor.cpp b/source/contacteditor/frmContactEditorVendor.cpp index 4696a9d..2ca399b 100644 --- a/source/contacteditor/frmContactEditorVendor.cpp +++ b/source/contacteditor/frmContactEditorVendor.cpp @@ -29,6 +29,7 @@ frmContactEditorVendorADT( parent ) void frmContactEditorVendor::SetEditorMode(bool EditMode) { + // Set if the editor is adding or editing an address. // FALSE = Add // TRUE = Edit @@ -67,7 +68,8 @@ void frmContactEditorVendor::SetEditorMode(bool EditMode) striter = VendorListElementPtr->find(VendorListIndex); - if (striter->first == VendorListIndex){ + if (striter->first == VendorListIndex && + striter != VendorListElementPtr->end()){ strValue = striter->second; @@ -81,7 +83,8 @@ void frmContactEditorVendor::SetEditorMode(bool EditMode) striter = VendorListPtr->find(VendorListIndex); - if (striter->first == VendorListIndex){ + if (striter->first == VendorListIndex && + striter != VendorListPtr->end()){ strValue = striter->second; @@ -98,6 +101,8 @@ void frmContactEditorVendor::SetEditorMode(bool EditMode) void frmContactEditorVendor::ProcessAction( wxCommandEvent& event ) { + // Process action. + if (EditorMode == FALSE){ wxString strValue; @@ -180,7 +185,8 @@ void frmContactEditorVendor::SetupPointers( std::map *VendorList, wxListCtrl *VendorListCtrl, int VendorIndex ) { - + // Setup the pointers. + VendorListPtr = VendorList; VendorListPENPtr = VendorListPEN; VendorListElementPtr = VendorListElement; @@ -191,5 +197,9 @@ void frmContactEditorVendor::SetupPointers( std::map *VendorList, void frmContactEditorVendor::CloseWindow( wxCommandEvent& event ) { + + // Close the window. + this->Close(); + }