Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
frmContactEditor: Stop XAB crashing when pressing Modify/Delete
[xestiaab/.git] / source / contacteditor / frmContactEditor-Category.cpp
index ef3439c..3fc61ae 100644 (file)
 void frmContactEditor::AddCategory( wxCommandEvent& event )
 {
 
-       int intResult = 0;
+       // Bring up the window to add a category.
     
        frmContactEditorCategory *frameCECategory = new frmContactEditorCategory ( this );
        frameCECategory->SetEditorMode(FALSE);
-       intResult = GetLastInt(&ContactEditorData.CategoriesList);
        frameCECategory->SetupPointers(&ContactEditorData.CategoriesList,
                &ContactEditorData.CategoriesListAltID,
                &ContactEditorData.CategoriesListPID,
@@ -44,10 +43,12 @@ void frmContactEditor::AddCategory( wxCommandEvent& event )
 void frmContactEditor::ModifyCategory( wxCommandEvent& event )
 {
 
+       // Bring up the window to edit a category.
+
        long longSelected = -1;
        int intSelectedData = 0;
     
-       if (!GetSelectedItem(lboCategories,
+       if (lboCategories->GetItemCount() == 0 || !GetSelectedItem(lboCategories,
                &longSelected,
                &intSelectedData)){
                
@@ -74,10 +75,12 @@ void frmContactEditor::ModifyCategory( wxCommandEvent& event )
 void frmContactEditor::DeleteCategory( wxCommandEvent& event )
 {
 
+       // Bring up the window to delete the category.
+
        long longSelected = -1;
        int intSelectedData = 0;
     
-       if (!GetSelectedItem(lboCategories,
+       if (lboCategories->GetItemCount() == 0 || !GetSelectedItem(lboCategories,
                &longSelected,
                &intSelectedData)){
                
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