]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/filedlg.cpp
always properly check if SeekI() calls succeded; this makes CanRead() functions of...
[wxWidgets.git] / src / msw / filedlg.cpp
index b788f8a7cf3a393eaea48b82de1d00a2f7c58848..0cc25b19d6a77f1aba06954f35e0ed158cba216a 100644 (file)
@@ -88,10 +88,10 @@ wxFileDialogHookFunction(HWND      hDlg,
     {
         case WM_NOTIFY:
             {
-                OFNOTIFY *pNotifyCode = wx_reinterpret_cast(OFNOTIFY *, lParam);
+                OFNOTIFY *pNotifyCode = reinterpret_cast<OFNOTIFY *>(lParam);
                 if ( pNotifyCode->hdr.code == CDN_INITDONE )
                 {
-                    wx_reinterpret_cast(wxFileDialog *,
+                    reinterpret_cast<wxFileDialog *>(
                                         pNotifyCode->lpOFN->lCustData)
                         ->MSWOnInitDone((WXHWND)hDlg);
                  }
@@ -167,7 +167,7 @@ void wxFileDialog::GetFilenames(wxArrayString& files) const
 void wxFileDialog::SetPath(const wxString& path)
 {
     wxString ext;
-    wxSplitPath(path, &m_dir, &m_fileName, &ext);
+    wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext);
     if ( !ext.empty() )
         m_fileName << _T('.') << ext;
 }
@@ -494,8 +494,7 @@ int wxFileDialog::ShowModal()
 
     //=== Setting defaultFileName >>=========================================
 
-    wxStrncpy(fileNameBuffer, m_fileName, wxMAXPATH-1);
-    fileNameBuffer[ wxMAXPATH-1 ] = wxT('\0');
+    wxStrlcpy(fileNameBuffer, m_fileName.c_str(), WXSIZEOF(fileNameBuffer));
 
     of.lpstrFile = fileNameBuffer;  // holds returned filename
     of.nMaxFile  = wxMAXPATH;
@@ -596,8 +595,7 @@ int wxFileDialog::ShowModal()
                 extension = extension + wxStrlen( extension ) + 1;
 
             m_fileName = AppendExtension(fileNameBuffer, extension);
-            wxStrncpy(fileNameBuffer, m_fileName.c_str(), wxMin(m_fileName.length(), wxMAXPATH-1));
-            fileNameBuffer[wxMin(m_fileName.length(), wxMAXPATH-1)] = wxT('\0');
+            wxStrlcpy(fileNameBuffer, m_fileName.c_str(), WXSIZEOF(fileNameBuffer));
         }
 
         m_path = fileNameBuffer;