if (ext.IsEmpty() || ext == wxT(""))
{
- fileName += ".";
+ fileName += wxT(".");
fileName += docTemplate->GetDefaultExtension();
}
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,
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,
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
{
while (node)
{
wxView *view = (wxView *)node->Data();
- view->OnUpdate(sender, hint);
+ if (view != sender)
+ view->OnUpdate(sender, hint);
node = node->Next();
}
}
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();
}
// template extension.
wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
-#if defined(__WXMSW__) || defined(__WXGTK__)
+#if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXMAC__)
int noTemplates,
#else
int WXUNUSED(noTemplates),
bool WXUNUSED(save))
{
// We can only have multiple filters in Windows and GTK
-#if defined(__WXMSW__) || defined(__WXGTK__)
+#if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXMAC__)
wxString descrBuf;
int i;
return FALSE;
}
- int len = stream.StreamSize();
+ int len = stream.GetSize();
// TODO: is this the correct test for EOF?
while (stream.TellI() < (len - 1))
{