]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/docview.cpp
Set svn properties correctly for the newly added files.
[wxWidgets.git] / src / common / docview.cpp
index 51c55bcaf3f2ed8a999213b811bdd914d64bc550..6658e51f0e7d4e5e7c199b93648bafee5138577b 100644 (file)
@@ -991,9 +991,9 @@ wxString wxDocManager::GetLastDirectory() const
         // this ensures that if the user opens a file, closes the program and
         // runs it again the "Open file" dialog will open in the directory of
         // the last file he used
-        wxString lastOpened = GetHistoryFile(0);
-        if ( !lastOpened.empty() )
+        if ( m_fileHistory && m_fileHistory->GetCount() )
         {
+            const wxString lastOpened = m_fileHistory->GetHistoryFile(0);
             const wxFileName fn(lastOpened);
             if ( fn.DirExists() )
             {
@@ -1001,6 +1001,7 @@ wxString wxDocManager::GetLastDirectory() const
             }
             //else: should we try the next one?
         }
+        //else: no history yet
 
         // if we don't have any files in the history (yet?), use the
         // system-dependent default location for the document files
@@ -2235,7 +2236,11 @@ void wxFileHistory::AddFilesToMenu(wxMenu* menu)
 
 bool wxTransferFileToStream(const wxString& filename, wxSTD ostream& stream)
 {
-    wxFFile file(filename, _T("rb"));
+#if wxUSE_FFILE
+    wxFFile file(filename, wxT("rb"));
+#elif wxUSE_FILE
+    wxFile file(filename, wxFile::read);
+#endif
     if ( !file.IsOpened() )
         return false;
 
@@ -2259,7 +2264,11 @@ bool wxTransferFileToStream(const wxString& filename, wxSTD ostream& stream)
 
 bool wxTransferStreamToFile(wxSTD istream& stream, const wxString& filename)
 {
-    wxFFile file(filename, _T("wb"));
+#if wxUSE_FFILE
+    wxFFile file(filename, wxT("wb"));
+#elif wxUSE_FILE
+    wxFile file(filename, wxFile::write);
+#endif
     if ( !file.IsOpened() )
         return false;
 
@@ -2282,7 +2291,11 @@ bool wxTransferStreamToFile(wxSTD istream& stream, const wxString& filename)
 
 bool wxTransferFileToStream(const wxString& filename, wxOutputStream& stream)
 {
-    wxFFile file(filename, _T("rb"));
+#if wxUSE_FFILE
+    wxFFile file(filename, wxT("rb"));
+#elif wxUSE_FILE
+    wxFile file(filename, wxFile::read);
+#endif
     if ( !file.IsOpened() )
         return false;
 
@@ -2306,7 +2319,11 @@ bool wxTransferFileToStream(const wxString& filename, wxOutputStream& stream)
 
 bool wxTransferStreamToFile(wxInputStream& stream, const wxString& filename)
 {
-    wxFFile file(filename, _T("wb"));
+#if wxUSE_FFILE
+    wxFFile file(filename, wxT("wb"));
+#elif wxUSE_FILE
+    wxFile file(filename, wxFile::write);
+#endif
     if ( !file.IsOpened() )
         return false;