X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b014db05bb062ddacf19e22b4c638d8ac5429d95..69659fd770f615210efac4b4fa741b3ad6223616:/src/msw/filedlg.cpp?ds=sidebyside diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index 63e5f18dfd..175b241358 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -276,13 +276,7 @@ int wxFileDialog::ShowModal() *fileNameBuffer = wxT('\0'); *titleBuffer = wxT('\0'); -#if WXWIN_COMPATIBILITY_2_4 - long msw_flags = 0; - if ( HasFdFlag(wxHIDE_READONLY) || HasFdFlag(wxFD_SAVE) ) - msw_flags |= OFN_HIDEREADONLY; -#else long msw_flags = OFN_HIDEREADONLY; -#endif if ( HasFdFlag(wxFD_FILE_MUST_EXIST) ) msw_flags |= OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; @@ -326,7 +320,7 @@ int wxFileDialog::ShowModal() of.lStructSize = gs_ofStructSize; of.hwndOwner = hWnd; - of.lpstrTitle = WXSTRINGCAST m_message; + of.lpstrTitle = m_message.wx_str(); of.lpstrFileTitle = titleBuffer; of.nMaxFileTitle = wxMAXFILE + 1 + wxMAXEXT; @@ -397,12 +391,12 @@ int wxFileDialog::ShowModal() } } - of.lpstrFilter = (LPTSTR)filterBuffer.c_str(); + of.lpstrFilter = (LPTSTR)filterBuffer.wx_str(); of.nFilterIndex = m_filterIndex + 1; //=== Setting defaultFileName >>========================================= - wxStrncpy( fileNameBuffer, (const wxChar *)m_fileName, wxMAXPATH-1 ); + wxStrncpy(fileNameBuffer, m_fileName, wxMAXPATH-1); fileNameBuffer[ wxMAXPATH-1 ] = wxT('\0'); of.lpstrFile = fileNameBuffer; // holds returned filename @@ -415,7 +409,7 @@ int wxFileDialog::ShowModal() wxString defextBuffer; // we need it to be alive until GetSaveFileName()! if (HasFdFlag(wxFD_SAVE)) { - const wxChar* extension = filterBuffer; + const wxChar* extension = filterBuffer.wx_str(); int maxFilter = (int)(of.nFilterIndex*2L) - 1; for( int i = 0; i < maxFilter; i++ ) // get extension @@ -425,7 +419,7 @@ int wxFileDialog::ShowModal() defextBuffer = AppendExtension(wxT("a"), extension); if (defextBuffer.StartsWith(wxT("a."))) { - defextBuffer.Mid(2); + defextBuffer = defextBuffer.Mid(2); // remove "a." of.lpstrDefExt = defextBuffer.c_str(); } } @@ -517,7 +511,7 @@ int wxFileDialog::ShowModal() (of.nFileExtension && fileNameBuffer[of.nFileExtension] == wxT('\0')) ) { // User has typed a filename without an extension: - const wxChar* extension = filterBuffer; + const wxChar* extension = filterBuffer.wx_str(); int maxFilter = (int)(of.nFilterIndex*2L) - 1; for( int i = 0; i < maxFilter; i++ ) // get extension