| 129 | } |
| 130 | |
| 131 | BOOL CFamiTrackerDoc::OnSaveDocument(LPCWSTR lpszPathName) |
| 132 | { |
| 133 | #ifdef DISABLE_SAVE // // // |
| 134 | static_cast<CFrameWnd*>(AfxGetMainWnd())->SetMessageText(IDS_DISABLE_SAVE); |
| 135 | return FALSE; |
| 136 | #endif |
| 137 | |
| 138 | // This function is called by the GUI to save the file |
| 139 | |
| 140 | if (!IsFileLoaded()) |
| 141 | return FALSE; |
| 142 | |
| 143 | // File backup, now performed on save instead of open |
| 144 | if ((m_bForceBackup || FTEnv.GetSettings()->General.bBackups) && !m_bBackupDone) { |
| 145 | CopyFileW(lpszPathName, FormattedW(L"%s.bak", lpszPathName), FALSE); |
| 146 | m_bBackupDone = true; |
| 147 | } |
| 148 | |
| 149 | if (!SaveDocument(lpszPathName)) |
| 150 | return FALSE; |
| 151 | |
| 152 | // Reset modified flag |
| 153 | SetModifiedFlag(FALSE); |
| 154 | |
| 155 | SetExceededFlag(FALSE); // // // |
| 156 | |
| 157 | return TRUE; |
| 158 | } |
| 159 | |
| 160 | void CFamiTrackerDoc::OnCloseDocument() |
| 161 | { |
no test coverage detected