| 485 | } |
| 486 | |
| 487 | void CHogEditView::OnFileSave() { |
| 488 | // TODO: Add your command handler code here |
| 489 | CHogEditDoc *doc = GetDocument(); |
| 490 | CListCtrl &list = GetListCtrl(); |
| 491 | |
| 492 | // If the current document is a hog file, then call the hog |
| 493 | // creation routine to save it |
| 494 | if (doc->m_StaticHog) { |
| 495 | UseCurrentHogFilename = TRUE; |
| 496 | OnActionCreate(); |
| 497 | UseCurrentHogFilename = FALSE; |
| 498 | return; |
| 499 | } |
| 500 | |
| 501 | // If a filename has not yet been specified by the user, |
| 502 | // Make them do a "Save As" instead |
| 503 | if (doc->m_NoNameChosen) { |
| 504 | OnFileSaveAs(); |
| 505 | return; |
| 506 | } |
| 507 | |
| 508 | // Display Wait Cursor |
| 509 | CWaitCursor wc; |
| 510 | |
| 511 | if (!doc->SaveDocument(doc->m_DocumentName)) { |
| 512 | MessageBox("The file was not written successfully.", "File Write Error"); |
| 513 | return; |
| 514 | } |
| 515 | |
| 516 | DocModified = false; |
| 517 | UpdateTitle(doc->m_DocumentName, DocModified); |
| 518 | UpdateTotalFiles(list.GetItemCount()); |
| 519 | } |
| 520 | |
| 521 | void CHogEditView::OnFileSaveAs() { |
| 522 |
nothing calls this directly
no test coverage detected