X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/008270942921dba2c5e725504ea5cf652418e142..12b58624e9975726334e2f9b2ee7f3e7b86595f0:/utils/tex2rtf/src/tex2rtf.cpp diff --git a/utils/tex2rtf/src/tex2rtf.cpp b/utils/tex2rtf/src/tex2rtf.cpp index 86074e2fd0..e3b7b8ce4f 100644 --- a/utils/tex2rtf/src/tex2rtf.cpp +++ b/utils/tex2rtf/src/tex2rtf.cpp @@ -31,9 +31,16 @@ #endif #ifndef NO_GUI -#include "wx/help.h" -#include "wx/timer.h" -#endif + #include "wx/timer.h" + #include "wx/help.h" + #include "wx/cshelp.h" + #include "wx/helphtml.h" + #ifdef __WXMSW__ + #include "wx/msw/helpchm.h" + #else + #include "wx/html/helpctrl.h" + #endif +#endif // !NO_GUI #if wxUSE_IOSTREAMH #include @@ -78,18 +85,17 @@ extern wxChar *TexTmpBibName; // Temporary bibliography output file name extern wxList ColourTable; extern TexChunk *TopLevel; - - #if wxUSE_HELP -wxHelpController *HelpInstance = NULL; +wxHelpControllerBase *HelpInstance = NULL; #endif // wxUSE_HELP #ifdef __WXMSW__ static wxChar *ipc_buffer = NULL; static wxChar Tex2RTFLastStatus[100]; Tex2RTFServer *TheTex2RTFServer = NULL; -#endif -#endif +#endif // __WXMSW__ + +#endif // !NO_GUI wxChar *bulletFile = NULL; @@ -293,11 +299,6 @@ bool MyApp::OnInit() TheTex2RTFServer->Create(_T("TEX2RTF")); #endif -#if defined(__WXMSW__) && defined(__WIN16__) - // Limit to max Windows array size - if (BufSize > 64) BufSize = 64; -#endif - TexInitialize(BufSize); ResetContentsLevels(0); @@ -347,10 +348,10 @@ bool MyApp::OnInit() wxMenu *options_menu = new wxMenu; - options_menu->Append(TEX_OPTIONS_CURELY_BRACE, _T("Curley brace matching"), _T("Checks for mismatched curley braces"),true); + options_menu->Append(TEX_OPTIONS_CURLEY_BRACE, _T("Curley brace matching"), _T("Checks for mismatched curley braces"),true); options_menu->Append(TEX_OPTIONS_SYNTAX_CHECKING, _T("Syntax checking"), _T("Syntax checking for common errors"),true); - options_menu->Check(TEX_OPTIONS_CURELY_BRACE, checkCurleyBraces); + options_menu->Check(TEX_OPTIONS_CURLEY_BRACE, checkCurleyBraces); options_menu->Check(TEX_OPTIONS_SYNTAX_CHECKING, checkSyntax); wxMenu *help_menu = new wxMenu; @@ -372,7 +373,11 @@ bool MyApp::OnInit() // ShowOptions(); #if wxUSE_HELP - HelpInstance = new wxHelpController(); +#if wxUSE_MS_HTML_HELP && !defined(__WXUNIVERSAL__) + HelpInstance = new wxCHMHelpController; +#else + HelpInstance = new wxHtmlHelpController; +#endif HelpInstance->Initialize(_T("tex2rtf")); #endif // wxUSE_HELP @@ -437,12 +442,12 @@ int MyApp::OnExit() node = CustomMacroList.GetFirst(); } MacroDefs.BeginFind(); - node = MacroDefs.Next(); - while (node) + wxHashTable::Node* mNode = MacroDefs.Next(); + while (mNode) { - TexMacroDef* def = (TexMacroDef*) node->GetData(); + TexMacroDef* def = (TexMacroDef*) mNode->GetData(); delete def; - node = MacroDefs.Next(); + mNode = MacroDefs.Next(); } MacroDefs.Clear(); #ifdef __WXMSW__ @@ -598,7 +603,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(TEX_MODE_WINHELP, MyFrame::OnModeWinHelp) EVT_MENU(TEX_MODE_HTML, MyFrame::OnModeHTML) EVT_MENU(TEX_MODE_XLP, MyFrame::OnModeXLP) - EVT_MENU(TEX_OPTIONS_CURELY_BRACE, MyFrame::OnOptionsCurleyBrace) + EVT_MENU(TEX_OPTIONS_CURLEY_BRACE, MyFrame::OnOptionsCurleyBrace) EVT_MENU(TEX_OPTIONS_SYNTAX_CHECKING, MyFrame::OnOptionsSyntaxChecking) EVT_MENU(TEX_HELP, MyFrame::OnHelp) EVT_MENU(TEX_ABOUT, MyFrame::OnAbout) @@ -865,13 +870,8 @@ void ChooseOutputFile(bool force) } case TEX_HTML: { -#if defined(__WXMSW__) && defined(__WIN16__) - wxStrcpy(extensionBuf, _T("htm")); - wxStrcat(wildBuf, _T("htm")); -#else wxStrcpy(extensionBuf, _T("html")); wxStrcat(wildBuf, _T("html")); -#endif break; } } @@ -1086,9 +1086,9 @@ void OnInform(const wxChar *msg) (*frame->textWindow) << msg << _T("\n"); /* This whole block of code is just wrong I think. It would behave completely wrong under anything other than MSW due to the ELSE - with no statement, and the cout calls would fail under MSW, as - the code in this block is compiled if !NO_GUI This code has been - here since v1.1 of this file too. - gt + with no statement, and the cout calls would fail under MSW, as + the code in this block is compiled if !NO_GUI This code has been + here since v1.1 of this file too. - gt else #ifdef __WXMSW__ {