X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aed0ed3c420d6821e81ca6243482e620c4aeeffd..3e418ffc1002c514f0e3e876809c33ae9ad8695b:/utils/tex2rtf/src/tex2rtf.cpp diff --git a/utils/tex2rtf/src/tex2rtf.cpp b/utils/tex2rtf/src/tex2rtf.cpp index a61db85708..5e35432637 100644 --- a/utils/tex2rtf/src/tex2rtf.cpp +++ b/utils/tex2rtf/src/tex2rtf.cpp @@ -101,6 +101,9 @@ bool Go(void); void ShowOptions(void); #ifdef NO_GUI + +extern char *wxBuffer; // we must init it, otherwise tex2rtf will crash + int main(int argc, char **argv) #else wxMenuBar *menuBar = NULL; @@ -146,12 +149,16 @@ 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"; ShowOptions(); exit(1); } + #endif if (InputFile) { @@ -374,10 +381,12 @@ bool MyApp::OnInit() // Return the main frame window return TRUE; #else + delete[] wxBuffer; return FALSE; #endif } +#ifndef NO_GUI int MyApp::OnExit() { wxNode *node = CustomMacroList.First(); @@ -411,7 +420,7 @@ int MyApp::OnExit() return 0; } - +#endif void ShowOptions(void) { char buf[100]; @@ -1073,3 +1082,15 @@ char *Tex2RTFConnection::OnRequest(const wxString& topic, const wxString& item, #endif + +#ifndef NO_GUI +#ifndef __WXGTK__ +void wxObject::Dump(ostream& str) +{ + if (GetClassInfo() && GetClassInfo()->GetClassName()) + str << GetClassInfo()->GetClassName(); + else + str << "unknown object class"; +} +#endif +#endif \ No newline at end of file