X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dd107c50be43e8d4dbdba20df162faf119a3781c..34a1d7328f198b5ad31c33a07a6078f089feb45f:/utils/tex2rtf/src/tex2rtf.cpp diff --git a/utils/tex2rtf/src/tex2rtf.cpp b/utils/tex2rtf/src/tex2rtf.cpp index cc8f64acae..425b828075 100644 --- a/utils/tex2rtf/src/tex2rtf.cpp +++ b/utils/tex2rtf/src/tex2rtf.cpp @@ -45,7 +45,7 @@ #include "tex2rtf.h" #include "rtfutils.h" -#if (defined(__WXGTK__) || defined(__WXMOTIF__)) && !defined(NO_GUI) +#if (defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__)) && !defined(NO_GUI) #include "tex2rtf.xpm" #endif @@ -591,7 +591,9 @@ void ShowOptions(void) OnInform(buf); OnInform("Usage: tex2rtf [input] [output] [switches]\n"); OnInform("where valid switches are"); +#ifndef NO_GUI OnInform(" -interactive"); +#endif OnInform(" -bufsize "); OnInform(" -charset (default ansi)"); OnInform(" -twice"); @@ -665,7 +667,16 @@ void MyFrame::OnGo(wxCommandEvent& event) Tex2RTFYield(TRUE); Go(); - if (runTwice) + if (stopRunning) + { + SetStatusText("Build aborted!"); + wxString errBuf; + errBuf.Printf("\nErrors encountered during this pass: %lu\n", errorCount); + OnInform((char *)errBuf.c_str()); + } + + + if (runTwice && !stopRunning) { Tex2RTFYield(TRUE); Go(); @@ -907,7 +918,7 @@ bool Go(void) ChooseOutputFile(); #endif - if (!InputFile || !OutputFile) + if (!InputFile || !OutputFile || stopRunning) return FALSE; #ifndef NO_GUI @@ -981,6 +992,12 @@ bool Go(void) OnInform("Reading LaTeX file..."); TexLoadFile(InputFile); + if (stopRunning) + { + OkToClose = TRUE; + return FALSE; + } + switch (convertMode) { case TEX_RTF: @@ -1005,6 +1022,7 @@ bool Go(void) OnInform("*** Aborted by user."); success = FALSE; stopRunning = FALSE; + OkToClose = TRUE; } if (success)