From eca5f1c8831fd0776e57a174362b0515104174c2 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 16:50:45 +0200 Subject: 1.7 --- library/misc.cpp | 59 +++++++++++++++++++++++++++----------------------------- 1 file changed, 28 insertions(+), 31 deletions(-) (limited to 'library/misc.cpp') diff --git a/library/misc.cpp b/library/misc.cpp index 2a5c0ec2..44dcaf0e 100644 --- a/library/misc.cpp +++ b/library/misc.cpp @@ -3,15 +3,13 @@ #include #include "resources.h" -wxString exchangeEscapeChars(char* temp) +void exchangeEscapeChars(wxString& data) { - wxString output(temp); - output.Replace("\\\\", "\\"); - output.Replace("\\n", "\n"); - output.Replace("\\t", "\t"); - output.Replace("\"\"", """"); - output.Replace("\\\"", "\""); - return output; + data.Replace(wxT("\\\\"), wxT("\\")); + data.Replace(wxT("\\n"), wxT("\n")); + data.Replace(wxT("\\t"), wxT("\t")); + data.Replace(wxT("\"\""), wxT("""")); + data.Replace(wxT("\\\""), wxT("\"")); } @@ -25,13 +23,13 @@ CustomLocale::~CustomLocale() { //write language to file ofstream output("lang.dat"); - if (!output) + if (output) { - wxMessageBox(wxString(_("Could not write to ")) + "\"" + "lang.dat" + "\"", _("An exception occured!"), wxOK | wxICON_ERROR); - return; + output<