* @brief Load one file */
| 489 | * @brief Load one file |
| 490 | */ |
| 491 | HRESULT CHexMergeDoc::LoadOneFile(int index, const tchar_t* filename, bool readOnly, const String& strDesc) |
| 492 | { |
| 493 | if (filename[0] && !paths::IsNullDeviceName(filename)) |
| 494 | { |
| 495 | if (Try(m_pView[index]->LoadFile(filename), MB_ICONSTOP) != 0) |
| 496 | return E_FAIL; |
| 497 | m_pView[index]->SetReadOnly(readOnly); |
| 498 | m_filePaths.SetPath(index, filename, false); |
| 499 | ASSERT(m_nBufferType[index] == BUFFERTYPE::NORMAL); // should have been initialized to BUFFERTYPE::NORMAL in constructor |
| 500 | if (!strDesc.empty()) |
| 501 | { |
| 502 | m_strDesc[index] = strDesc; |
| 503 | m_nBufferType[index] = BUFFERTYPE::NORMAL_NAMED; |
| 504 | } |
| 505 | } |
| 506 | else |
| 507 | { |
| 508 | m_nBufferType[index] = BUFFERTYPE::UNNAMED; |
| 509 | m_strDesc[index] = strDesc; |
| 510 | if (m_strDesc[index].empty()) |
| 511 | m_strDesc[index] = (index == 0) ? _("Untitled Left") : ((m_nBuffers < 3 || index == 2) ? _("Untitled Right") : _("Untitled Middle")); |
| 512 | } |
| 513 | m_pView[index]->ResizeWindow(); |
| 514 | return S_OK; |
| 515 | } |
| 516 | |
| 517 | /** |
| 518 | * @brief Load files and initialize frame's compare result icon |
nothing calls this directly
no test coverage detected