| 341 | } |
| 342 | |
| 343 | bool CHexMergeDoc::DoFileSaveAs(int nBuffer, bool packing) |
| 344 | { |
| 345 | const String &path = m_filePaths.GetPath(nBuffer); |
| 346 | String strPath; |
| 347 | String title; |
| 348 | if (nBuffer == 0) |
| 349 | title = _("Save Left File As"); |
| 350 | else if (nBuffer == m_nBuffers - 1) |
| 351 | title = _("Save Right File As"); |
| 352 | else |
| 353 | title = _("Save Middle File As"); |
| 354 | if (SelectFile(AfxGetMainWnd()->GetSafeHwnd(), strPath, false, path.c_str(), title)) |
| 355 | { |
| 356 | HRESULT hr = m_pView[nBuffer]->SaveFile(strPath.c_str()); |
| 357 | if (Try(hr) == IDCANCEL) |
| 358 | return false; |
| 359 | if (FAILED(hr)) |
| 360 | return false; |
| 361 | if (path.empty()) |
| 362 | { |
| 363 | // We are saving scratchpad (unnamed file) |
| 364 | m_nBufferType[nBuffer] = BUFFERTYPE::UNNAMED_SAVED; |
| 365 | m_strDesc[nBuffer].erase(); |
| 366 | } |
| 367 | |
| 368 | m_filePaths.SetPath(nBuffer, strPath); |
| 369 | UpdateLastCompareResult(); |
| 370 | UpdateHeaderPath(nBuffer); |
| 371 | |
| 372 | CMergeFrameCommon::LogFileSaved(m_filePaths[nBuffer]); |
| 373 | |
| 374 | return true; |
| 375 | } |
| 376 | return false; |
| 377 | } |
| 378 | |
| 379 | /** |
| 380 | * @brief Saves left-side file |