merged 2.4 branch into the trunk
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18040 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -262,7 +262,7 @@ bool wxDocument::SaveAs()
|
||||
|
||||
if (ext.IsEmpty() || ext == wxT(""))
|
||||
{
|
||||
fileName += ".";
|
||||
fileName += wxT(".");
|
||||
fileName += docTemplate->GetDefaultExtension();
|
||||
}
|
||||
|
||||
@@ -295,11 +295,11 @@ bool wxDocument::OnSaveDocument(const wxString& file)
|
||||
msgTitle = wxString(_("File error"));
|
||||
|
||||
#if wxUSE_STD_IOSTREAM
|
||||
wxSTD ofstream store(wxString(file.fn_str()).mb_str());
|
||||
wxSTD ofstream store(wxString(file.fn_str()).mb_str()); // ?????
|
||||
if (store.fail() || store.bad())
|
||||
#else
|
||||
wxFileOutputStream store(wxString(file.fn_str()));
|
||||
if (store.LastError() != wxSTREAM_NOERROR)
|
||||
wxFileOutputStream store( file );
|
||||
if (store.GetLastError() != wxSTREAM_NO_ERROR)
|
||||
#endif
|
||||
{
|
||||
(void)wxMessageBox(_("Sorry, could not open this file for saving."), msgTitle, wxOK | wxICON_EXCLAMATION,
|
||||
@@ -332,11 +332,11 @@ bool wxDocument::OnOpenDocument(const wxString& file)
|
||||
msgTitle = wxString(_("File error"));
|
||||
|
||||
#if wxUSE_STD_IOSTREAM
|
||||
wxSTD ifstream store(wxString(file.fn_str()).mb_str());
|
||||
wxSTD ifstream store(wxString(file.fn_str()).mb_str()); // ????
|
||||
if (store.fail() || store.bad())
|
||||
#else
|
||||
wxFileInputStream store(wxString(file.fn_str()));
|
||||
if (store.LastError() != wxSTREAM_NOERROR)
|
||||
wxFileInputStream store( file );
|
||||
if (store.GetLastError() != wxSTREAM_NO_ERROR)
|
||||
#endif
|
||||
{
|
||||
(void)wxMessageBox(_("Sorry, could not open this file."), msgTitle, wxOK|wxICON_EXCLAMATION,
|
||||
@@ -347,8 +347,8 @@ bool wxDocument::OnOpenDocument(const wxString& file)
|
||||
LoadObject(store);
|
||||
if ( !store && !store.eof() )
|
||||
#else
|
||||
int res = LoadObject(store).LastError();
|
||||
if ((res != wxSTREAM_NOERROR) &&
|
||||
int res = LoadObject(store).GetLastError();
|
||||
if ((res != wxSTREAM_NO_ERROR) &&
|
||||
(res != wxSTREAM_EOF))
|
||||
#endif
|
||||
{
|
||||
@@ -506,7 +506,8 @@ void wxDocument::UpdateAllViews(wxView *sender, wxObject *hint)
|
||||
while (node)
|
||||
{
|
||||
wxView *view = (wxView *)node->Data();
|
||||
view->OnUpdate(sender, hint);
|
||||
if (view != sender)
|
||||
view->OnUpdate(sender, hint);
|
||||
node = node->Next();
|
||||
}
|
||||
}
|
||||
@@ -838,12 +839,12 @@ void wxDocManager::OnFileCloseAll(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
void wxDocManager::OnFileNew(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
CreateDocument(wxString(""), wxDOC_NEW);
|
||||
CreateDocument( wxT(""), wxDOC_NEW );
|
||||
}
|
||||
|
||||
void wxDocManager::OnFileOpen(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
if ( !CreateDocument(wxString(""), 0) )
|
||||
if ( !CreateDocument( wxT(""), 0) )
|
||||
{
|
||||
OnOpenFileFailure();
|
||||
}
|
||||
@@ -2214,7 +2215,7 @@ bool wxTransferStreamToFile(wxInputStream& stream, const wxString& filename)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int len = stream.StreamSize();
|
||||
int len = stream.GetSize();
|
||||
// TODO: is this the correct test for EOF?
|
||||
while (stream.TellI() < (len - 1))
|
||||
{
|
||||
|
Reference in New Issue
Block a user