]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/docview.cpp
O_BINARY added to wxFile::Create
[wxWidgets.git] / src / common / docview.cpp
index 58c3f43fd810650f136c21cf2fbf20304b81649e..5f8f8967915fe81ecfd6603ab825a7ad53e6ab82 100644 (file)
@@ -76,7 +76,6 @@
 // wxWindows macros
 // ----------------------------------------------------------------------------
 
-#if !USE_SHARED_LIBRARY
     IMPLEMENT_ABSTRACT_CLASS(wxDocument, wxEvtHandler)
     IMPLEMENT_ABSTRACT_CLASS(wxView, wxEvtHandler)
     IMPLEMENT_ABSTRACT_CLASS(wxDocTemplate, wxObject)
@@ -91,7 +90,6 @@
     IMPLEMENT_CLASS(wxCommand, wxObject)
     IMPLEMENT_DYNAMIC_CLASS(wxCommandProcessor, wxObject)
     IMPLEMENT_DYNAMIC_CLASS(wxFileHistory, wxObject)
-#endif
 
 // ----------------------------------------------------------------------------
 // function prototypes
@@ -293,7 +291,7 @@ bool wxDocument::OnSaveDocument(const wxString& file)
     if (store.fail() || store.bad())
 #else
     wxFileOutputStream store(wxString(file.fn_str()));
-    if (store.LastError() != 0)
+    if (store.LastError() != wxSTREAM_NOERROR)
 #endif
     {
         (void)wxMessageBox(_("Sorry, could not open this file for saving."), msgTitle, wxOK | wxICON_EXCLAMATION,
@@ -329,14 +327,20 @@ bool wxDocument::OnOpenDocument(const wxString& file)
     if (store.fail() || store.bad())
 #else
     wxFileInputStream store(wxString(file.fn_str()));
-    if (store.LastError() != 0)
+    if (store.LastError() != wxSTREAM_NOERROR)
 #endif
     {
         (void)wxMessageBox(_("Sorry, could not open this file."), msgTitle, wxOK|wxICON_EXCLAMATION,
                            GetDocumentWindow());
         return FALSE;
     }
+#if wxUSE_STD_IOSTREAM
     if (!LoadObject(store))
+#else
+    int res = LoadObject(store).LastError();
+    if ((res != wxSTREAM_NOERROR) &&
+        (res != wxSTREAM_EOF))
+#endif
     {
         (void)wxMessageBox(_("Sorry, could not open this file."), msgTitle, wxOK|wxICON_EXCLAMATION,
                            GetDocumentWindow());