* @brief Called when "Browse..." button is selected for N path. */
| 640 | * @brief Called when "Browse..." button is selected for N path. |
| 641 | */ |
| 642 | void COpenView::OnPathButton(UINT nId) |
| 643 | { |
| 644 | const int index = nId - IDC_PATH0_BUTTON; |
| 645 | String s; |
| 646 | String sfolder; |
| 647 | UpdateData(TRUE); |
| 648 | |
| 649 | paths::PATH_EXISTENCE existence = paths::DoesPathExist(m_strPath[index]); |
| 650 | switch (existence) |
| 651 | { |
| 652 | case paths::IS_EXISTING_DIR: |
| 653 | sfolder = m_strPath[index]; |
| 654 | break; |
| 655 | case paths::IS_EXISTING_FILE: |
| 656 | sfolder = paths::GetPathOnly(m_strPath[index]); |
| 657 | break; |
| 658 | case paths::DOES_NOT_EXIST: |
| 659 | if (!m_strPath[index].empty()) |
| 660 | sfolder = paths::GetParentPath(m_strPath[index]); |
| 661 | break; |
| 662 | default: |
| 663 | _RPTF0(_CRT_ERROR, "Invalid return value from paths::DoesPathExist()"); |
| 664 | break; |
| 665 | } |
| 666 | |
| 667 | if (SelectFileOrFolder(GetSafeHwnd(), s, sfolder.c_str())) |
| 668 | { |
| 669 | m_strPath[index] = s; |
| 670 | m_strBrowsePath[index] = std::move(s); |
| 671 | UpdateData(FALSE); |
| 672 | UpdateButtonStates(); |
| 673 | } |
| 674 | } |
| 675 | |
| 676 | void COpenView::OnSwapButton(int id1, int id2) |
| 677 | { |
nothing calls this directly
no test coverage detected