Fix for saving in Unicode mode (Bug #1172299).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33329 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-04-04 18:48:35 +00:00
parent 57133d5cdb
commit 8d3261f9d9
2 changed files with 37 additions and 31 deletions

View File

@@ -21,6 +21,7 @@
#endif
#include "wx/wfstream.h"
#include "wx/txtstrm.h"
#include "configtoolview.h"
#include "configtooldoc.h"
#include "configtree.h"
@@ -923,13 +924,14 @@ void ctConfigToolView::OnSaveSetupFile(wxCommandEvent& WXUNUSED(event))
wxString fullPath = dialog.GetPath();
wxGetApp().GetSettings().m_lastSetupSaveDir = wxPathOnly(fullPath);
wxFileOutputStream stream(fullPath);
if (!stream.Ok())
wxFileOutputStream osFile(fullPath);
if (!osFile.Ok())
{
wxMessageBox(_("Sorry, could not save this file."), _("Save Setup File"), wxICON_EXCLAMATION|wxOK);
return;
}
wxTextOutputStream stream(osFile);
stream << setupStr;
}
}
@@ -955,13 +957,14 @@ void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event))
wxString fullPath = dialog.GetPath();
wxGetApp().GetSettings().m_lastSetupSaveDir = wxPathOnly(fullPath);
wxFileOutputStream stream(fullPath);
if (!stream.Ok())
wxFileOutputStream osFile(fullPath);
if (!osFile.Ok())
{
wxMessageBox(_("Sorry, could not save this file."), _("Save Configure Command File"), wxICON_EXCLAMATION|wxOK);
return;
}
wxTextOutputStream stream(osFile);
stream << configureStr;
}
}