Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
frmContactEditor: Stop XAB crashing when pressing Modify/Delete
[xestiaab/.git] / source / contacteditor / frmContactEditor-Calendar.cpp
index 95235c1..083dc80 100644 (file)
 void frmContactEditor::AddCalendarAddress( wxCommandEvent& event )
 {
 
-       int intResult = 0;
+       // Bring up the window to add the calendar address.
     
        frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
        frameCECalAdr->SetEditorMode(FALSE);
-       intResult = GetLastInt(&ContactEditorData.CalendarList);
        frameCECalAdr->SetupPointers(&ContactEditorData.CalendarList,
                &ContactEditorData.CalendarListAltID,
                &ContactEditorData.CalendarListPID,
@@ -44,10 +43,12 @@ void frmContactEditor::AddCalendarAddress( wxCommandEvent& event )
 void frmContactEditor::ModifyCalendarAddress( wxCommandEvent& event )
 {
 
+       // Bring up the window to modify the calendar address.
+
        long longSelected = -1;
        int intSelectedData = 0;
     
-       if (!GetSelectedItem(lboCalendarAddresses,
+       if (lboCalendarAddresses->GetItemCount() == 0 || !GetSelectedItem(lboCalendarAddresses,
                &longSelected,
                &intSelectedData)){
                
@@ -74,10 +75,12 @@ void frmContactEditor::ModifyCalendarAddress( wxCommandEvent& event )
 void frmContactEditor::DeleteCalendarAddress( wxCommandEvent& event )
 {
 
+       // Bring up the window to delete the calendar address.
+
        long longSelected = -1;
        int intSelectedData = 0;
     
-       if (!GetSelectedItem(lboCalendarAddresses,
+       if (lboCalendarAddresses->GetItemCount() == 0 || !GetSelectedItem(lboCalendarAddresses,
                &longSelected,
                &intSelectedData)){
                
@@ -96,11 +99,10 @@ void frmContactEditor::DeleteCalendarAddress( wxCommandEvent& event )
 void frmContactEditor::AddCalendarRequest( wxCommandEvent& event )
 {
 
-       int intResult = 0;
+       // Bring up the window to add a calendar request address.
     
        frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
        frameCECalAdr->SetEditorMode(FALSE);
-       intResult = GetLastInt(&ContactEditorData.CalendarRequestList);
        frameCECalAdr->SetupPointers(&ContactEditorData.CalendarRequestList,
                &ContactEditorData.CalendarRequestListAltID,
                &ContactEditorData.CalendarRequestListPID,
@@ -118,10 +120,12 @@ void frmContactEditor::AddCalendarRequest( wxCommandEvent& event )
 void frmContactEditor::ModifyCalendarRequest( wxCommandEvent& event )
 {
 
+       // Bring up the window to modify a calendar request address.
+
        long longSelected = -1;
        int intSelectedData = 0;
     
-       if (!GetSelectedItem(lboCalendarRequestAddress,
+       if (lboCalendarRequestAddress->GetItemCount() == 0 || !GetSelectedItem(lboCalendarRequestAddress,
                &longSelected,
                &intSelectedData)){
                
@@ -148,10 +152,12 @@ void frmContactEditor::ModifyCalendarRequest( wxCommandEvent& event )
 void frmContactEditor::DeleteCalendarRequest( wxCommandEvent& event )
 {
 
+       // Bring up the window to delete a calendar request address.
+
        long longSelected = -1;
        int intSelectedData = 0;
     
-       if (!GetSelectedItem(lboCalendarRequestAddress,
+       if (lboCalendarRequestAddress->GetItemCount() == 0 || !GetSelectedItem(lboCalendarRequestAddress,
                &longSelected,
                &intSelectedData)){
                
@@ -171,11 +177,10 @@ void frmContactEditor::DeleteCalendarRequest( wxCommandEvent& event )
 void frmContactEditor::AddFreeBusy( wxCommandEvent& event )
 {
 
-       int intResult = 0;
+       // Bring up the window to add a calendar free/busy address.
     
        frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
        frameCECalAdr->SetEditorMode(FALSE);
-       intResult = GetLastInt(&ContactEditorData.FreeBusyList);
        frameCECalAdr->SetupPointers(&ContactEditorData.FreeBusyList,
                &ContactEditorData.FreeBusyListAltID,
                &ContactEditorData.FreeBusyListPID,
@@ -193,10 +198,12 @@ void frmContactEditor::AddFreeBusy( wxCommandEvent& event )
 void frmContactEditor::ModifyFreeBusy( wxCommandEvent& event )
 {
 
+       // Bring up the window to modify a calendar free/busy address.
+
        long longSelected = -1;
        int intSelectedData = 0;
     
-       if (!GetSelectedItem(lboFreeBusyAddresses,
+       if (lboFreeBusyAddresses->GetItemCount() == 0 || !GetSelectedItem(lboFreeBusyAddresses,
                &longSelected,
                &intSelectedData)){
                
@@ -223,10 +230,12 @@ void frmContactEditor::ModifyFreeBusy( wxCommandEvent& event )
 void frmContactEditor::DeleteFreeBusy( wxCommandEvent& event )
 {
 
+       // Bring up the window to delete a calendar free/busy address.
+
        long longSelected = -1;
        int intSelectedData = 0;
     
-       if (!GetSelectedItem(lboFreeBusyAddresses,
+       if (lboFreeBusyAddresses->GetItemCount() == 0 || !GetSelectedItem(lboFreeBusyAddresses,
                &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