]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/docview.cpp
added wxEncodingConverter
[wxWidgets.git] / src / common / docview.cpp
index a2863a485c926bb488deca460b5fed12bdc1233e..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());
@@ -522,7 +526,7 @@ wxView::wxView()
     //  SetDocument(doc);
     m_viewDocument = (wxDocument*) NULL;
 
-    m_viewTypeName = "";
+    m_viewTypeName = wxT("");
     m_viewFrame = (wxFrame *) NULL;
 }
 
@@ -1989,7 +1993,7 @@ void wxFileHistory::Load(wxConfigBase& config)
         m_fileHistory[m_fileHistoryN] = copystring((const wxChar*) historyFile);
         m_fileHistoryN ++;
         buf.Printf(wxT("file%d"), m_fileHistoryN+1);
-        historyFile = "";
+        historyFile = wxT("");
     }
     AddFilesToMenu();
 }