MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / OnSaveDocument

Method OnSaveDocument

Source/FamiTrackerDoc.cpp:131–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131BOOL 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
160void CFamiTrackerDoc::OnCloseDocument()
161{

Callers 1

ExceptionHandlerFunction · 0.80

Calls 2

FormattedWFunction · 0.85
GetSettingsMethod · 0.45

Tested by

no test coverage detected