X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4538b3f1b0a3f36d5fe91559afa86c1a1063f751..a2d541ca9c552d1a30ba75970968a7a220f4955a:/utils/tex2rtf/src/tex2rtf.cpp diff --git a/utils/tex2rtf/src/tex2rtf.cpp b/utils/tex2rtf/src/tex2rtf.cpp index 163bac5cec..a1d0838110 100644 --- a/utils/tex2rtf/src/tex2rtf.cpp +++ b/utils/tex2rtf/src/tex2rtf.cpp @@ -132,13 +132,9 @@ int BufSize = 500; bool Go(void); void ShowOptions(void); -#ifdef NO_GUI +char wxTex2RTFBuffer[1500]; -#if wxUSE_GUI || !defined(__UNIX__) -// wxBase for Unix does not have wxBuffer -extern -#endif -char *wxBuffer; // we must init it, otherwise tex2rtf will crash +#ifdef NO_GUI int main(int argc, char **argv) #else @@ -187,12 +183,9 @@ bool MyApp::OnInit() } #ifdef NO_GUI - wxBuffer = new char[1500]; - // this is done in wxApp, but NO_GUI version doesn't call it :-( - if (!InputFile || !OutputFile) { - cout << "Tex2RTF: input or output file is missing.\n"; + wxSTD cout << "Tex2RTF: input or output file is missing.\n"; ShowOptions(); exit(1); } @@ -446,7 +439,6 @@ bool MyApp::OnInit() // Return the main frame window return TRUE; #else - delete[] wxBuffer; return FALSE; #endif } @@ -1080,21 +1072,21 @@ void OnError(const char *msg) errorCount++; #ifdef NO_GUI - cerr << "Error: " << msg << "\n"; - cerr.flush(); + wxSTD cerr << "Error: " << msg << "\n"; + wxSTD cerr.flush(); #else if (isInteractive && frame) (*frame->textWindow) << "Error: " << msg << "\n"; else #ifdef __UNIX__ { - cerr << "Error: " << msg << "\n"; - cerr.flush(); + wxSTD cerr << "Error: " << msg << "\n"; + wxSTD cerr.flush(); } #endif #ifdef __WXMSW__ - wxError(msg); + wxLogError(msg); #endif Tex2RTFYield(TRUE); #endif // NO_GUI @@ -1103,8 +1095,8 @@ void OnError(const char *msg) void OnInform(const char *msg) { #ifdef NO_GUI - cout << msg << "\n"; - cout.flush(); + wxSTD cout << msg << "\n"; + wxSTD cout.flush(); #else if (isInteractive && frame) (*frame->textWindow) << msg << "\n"; @@ -1116,8 +1108,8 @@ void OnInform(const char *msg) else #ifdef __WXMSW__ { - cout << msg << "\n"; - cout.flush(); + wxSTD cout << msg << "\n"; + wxSTD cout.flush(); } #endif #ifdef __WXMSW__