X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/11aab0d0005a2dca111b24a7088eb834b26894ed..ae8f57691329af997e274a3fce5b25c5e5f00f2f:/src/common/docview.cpp diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 33cde3d1f2..61c7923fa1 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -42,6 +42,7 @@ #include "wx/intl.h" #endif + #ifdef __WXGTK__ #include "wx/mdi.h" #endif @@ -281,10 +282,10 @@ bool wxDocument::OnSaveDocument(const wxString& file) msgTitle = wxString(_("File error")); #if wxUSE_STD_IOSTREAM - ofstream store(FNSTRINGCAST file.fn_str()); + ofstream store(wxString(file.fn_str())); if (store.fail() || store.bad()) #else - wxFileOutputStream store(FNSTRINGCAST file.fn_str()); + wxFileOutputStream store(wxString(file.fn_str())); if (store.LastError() != 0) #endif { @@ -293,7 +294,7 @@ bool wxDocument::OnSaveDocument(const wxString& file) // Saving error return FALSE; } - if (SaveObject(store)==FALSE) + if (!SaveObject(store)) { (void)wxMessageBox(_("Sorry, could not save this file."), msgTitle, wxOK | wxICON_EXCLAMATION, GetDocumentWindow()); @@ -317,10 +318,10 @@ bool wxDocument::OnOpenDocument(const wxString& file) msgTitle = wxString(_("File error")); #if wxUSE_STD_IOSTREAM - ifstream store(FNSTRINGCAST file.fn_str()); + ifstream store(wxString(file.fn_str())); if (store.fail() || store.bad()) #else - wxFileInputStream store(FNSTRINGCAST file.fn_str()); + wxFileInputStream store(wxString(file.fn_str())); if (store.LastError() != 0) #endif { @@ -328,7 +329,7 @@ bool wxDocument::OnOpenDocument(const wxString& file) GetDocumentWindow()); return FALSE; } - if (LoadObject(store)==FALSE) + if (!LoadObject(store)) { (void)wxMessageBox(_("Sorry, could not open this file."), msgTitle, wxOK|wxICON_EXCLAMATION, GetDocumentWindow()); @@ -345,25 +346,21 @@ bool wxDocument::OnOpenDocument(const wxString& file) #if wxUSE_STD_IOSTREAM istream& wxDocument::LoadObject(istream& stream) +#else +wxInputStream& wxDocument::LoadObject(wxInputStream& stream) +#endif { return stream; } +#if wxUSE_STD_IOSTREAM ostream& wxDocument::SaveObject(ostream& stream) -{ - return stream; -} #else -bool wxDocument::LoadObject(wxInputStream& stream) -{ - return TRUE; -} - -bool wxDocument::SaveObject(wxOutputStream& stream) +wxOutputStream& wxDocument::SaveObject(wxOutputStream& stream) +#endif { - return TRUE; + return stream; } -#endif bool wxDocument::Revert() { @@ -834,7 +831,7 @@ void wxDocManager::OnPrintSetup(wxCommandEvent& WXUNUSED(event)) wxPrintDialogData data; - wxPrintDialog printerDialog(parentWin, & data); + wxPrintDialog printerDialog(parentWin, &data); printerDialog.GetPrintDialogData().SetSetupDialog(TRUE); printerDialog.ShowModal(); #endif // wxUSE_PRINTING_ARCHITECTURE