| 863 | // |
| 864 | |
| 865 | BOOL CDocManager0CC::DoPromptFileName(CStringW &fileName, UINT nIDSTitle, DWORD lFlags, BOOL bOpenFileDialog, CDocTemplate *pTemplate) |
| 866 | { |
| 867 | // Copied from MFC |
| 868 | // // // disregard doc template |
| 869 | CStringW path = theApp.GetSettings()->GetPath(PATH_FTM).c_str(); |
| 870 | |
| 871 | CFileDialog OpenFileDlg(bOpenFileDialog, L"0cc", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, LoadDefaultFilter(IDS_FILTER_0CC, L"*.0cc; *.ftm")); // // // |
| 872 | OpenFileDlg.m_ofn.Flags |= lFlags; |
| 873 | OpenFileDlg.m_ofn.lpstrFile = fileName.GetBuffer(_MAX_PATH); |
| 874 | OpenFileDlg.m_ofn.lpstrInitialDir = path.GetBuffer(_MAX_PATH); |
| 875 | CStringW title(MAKEINTRESOURCEW(nIDSTitle)); |
| 876 | OpenFileDlg.m_ofn.lpstrTitle = title; |
| 877 | INT_PTR nResult = OpenFileDlg.DoModal(); |
| 878 | fileName.ReleaseBuffer(); |
| 879 | path.ReleaseBuffer(); |
| 880 | |
| 881 | if (nResult == IDOK) { |
| 882 | theApp.GetSettings()->SetPath(fs::path {(LPCWSTR)fileName}.parent_path(), PATH_FTM); |
| 883 | return true; |
| 884 | } |
| 885 | return false; |
| 886 | } |
no test coverage detected