]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/tex2rtf/src/tex2rtf.cpp
fixes for wxDP_ALLOWNONE case
[wxWidgets.git] / utils / tex2rtf / src / tex2rtf.cpp
index 38fef85e0af3682df98acb7a2177b6b60a3410ba..9e78bad8a9999cf356a7eeeb74aa1d3882f00981 100644 (file)
@@ -27,6 +27,7 @@
         #include "wx/textctrl.h"
         #include "wx/filedlg.h"
         #include "wx/msgdlg.h"
+        #include "wx/icon.h"
     #endif
 #endif
 
@@ -154,7 +155,7 @@ bool MyApp::OnInit()
   WinHelpContentsFileName = new wxChar[300];
   RefFileName = new wxChar[300];
 
-  ColourTable.DeleteContents(true);
+  WX_CLEAR_LIST(wxList,ColourTable);
 
   int n = 1;
 
@@ -269,10 +270,17 @@ bool MyApp::OnInit()
         }
       }
     }
+    else if (wxStrcmp(argv[i], _T("-checkcurlybraces")) == 0)
+    {
+      i ++;
+      checkCurlyBraces = true;
+    }
     else if (wxStrcmp(argv[i], _T("-checkcurleybraces")) == 0)
     {
+      // Support the old, incorrectly spelled version of -checkcurlybraces
+      // so that old scripts which run tex2rtf -checkcurleybraces still work.
       i ++;
-      checkCurleyBraces = true;
+      checkCurlyBraces = true;
     }
     else if (wxStrcmp(argv[i], _T("-checksyntax")) == 0)
     {
@@ -351,10 +359,10 @@ bool MyApp::OnInit()
 
     wxMenu *options_menu = new wxMenu;
 
-    options_menu->Append(TEX_OPTIONS_CURLEY_BRACE, _T("Curley brace matching"), _T("Checks for mismatched curley braces"),true);
+    options_menu->Append(TEX_OPTIONS_CURLY_BRACE, _T("Curly brace matching"), _T("Checks for mismatched curly braces"),true);
     options_menu->Append(TEX_OPTIONS_SYNTAX_CHECKING, _T("Syntax checking"), _T("Syntax checking for common errors"),true);
 
-    options_menu->Check(TEX_OPTIONS_CURLEY_BRACE, checkCurleyBraces);
+    options_menu->Check(TEX_OPTIONS_CURLY_BRACE, checkCurlyBraces);
     options_menu->Check(TEX_OPTIONS_SYNTAX_CHECKING, checkSyntax);
 
     wxMenu *help_menu = new wxMenu;
@@ -398,7 +406,7 @@ bool MyApp::OnInit()
     switch (convertMode)
     {
       case TEX_RTF:
-        wxStrcat(buf, (winHelp) ? _T("WinHelp RTF"), _T("linear RTF"));
+        wxStrcat(buf, (winHelp) ? _T("WinHelp RTF") : _T("linear RTF"));
         break;
       case TEX_HTML:
         wxStrcat(buf, _T("HTML"));
@@ -430,7 +438,7 @@ bool MyApp::OnInit()
       ReadCustomMacros((wxChar*)path.c_str());
 
     Go();
-    if (runTwice) 
+    if (runTwice)
     {
         Go();
     }
@@ -590,7 +598,7 @@ void ShowOptions(void)
     OnInform(_T("    -charset <pc | pca | ansi | mac> (default ansi)"));
     OnInform(_T("    -twice"));
     OnInform(_T("    -sync"));
-    OnInform(_T("    -checkcurleybraces"));
+    OnInform(_T("    -checkcurlybraces"));
     OnInform(_T("    -checksyntax"));
     OnInform(_T("    -macros <filename>"));
     OnInform(_T("    -winhelp"));
@@ -616,7 +624,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_CURLEY_BRACE, MyFrame::OnOptionsCurleyBrace)
+    EVT_MENU(TEX_OPTIONS_CURLY_BRACE, MyFrame::OnOptionsCurlyBrace)
     EVT_MENU(TEX_OPTIONS_SYNTAX_CHECKING, MyFrame::OnOptionsSyntaxChecking)
     EVT_MENU(TEX_HELP, MyFrame::OnHelp)
     EVT_MENU(TEX_ABOUT, MyFrame::OnAbout)
@@ -793,17 +801,17 @@ void MyFrame::OnModeXLP(wxCommandEvent& WXUNUSED(event))
 #endif // wxUSE_STATUSBAR
 }
 
-void MyFrame::OnOptionsCurleyBrace(wxCommandEvent& WXUNUSED(event))
+void MyFrame::OnOptionsCurlyBrace(wxCommandEvent& WXUNUSED(event))
 {
-    checkCurleyBraces = !checkCurleyBraces;
+    checkCurlyBraces = !checkCurlyBraces;
 #if wxUSE_STATUSBAR
-    if (checkCurleyBraces)
+    if (checkCurlyBraces)
     {
-        SetStatusText(_T("Checking curley braces: YES"), 1);
+        SetStatusText(_T("Checking curly braces: YES"), 1);
     }
     else
     {
-        SetStatusText(_T("Checking curley braces: NO"), 1);
+        SetStatusText(_T("Checking curly braces: NO"), 1);
     }
 #endif // wxUSE_STATUSBAR
 }
@@ -1118,7 +1126,7 @@ void OnInform(const wxChar *msg)
 /* 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 
+   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__
@@ -1213,10 +1221,6 @@ Tex2RTFConnection::Tex2RTFConnection(wxChar *buf, int size):wxDDEConnection(buf,
 {
 }
 
-Tex2RTFConnection::~Tex2RTFConnection(void)
-{
-}
-
 bool SplitCommand(wxChar *data, wxChar *firstArg, wxChar *secondArg)
 {
   firstArg[0] = 0;